Aggregate variants

Aggregates in the building automation field tend to have variants - most likely variants of certain actuator types. An aggregate providing a valve “variant aspect” (continuous valve vs. thermal actuator valve) can be considered as a simple example.

The CODESYS Building Automation library supports building aggregates with variants with the concept “external composition” described hereafter.

  • Generalized functionality is abstracted by interfaces (example: IActuatorContinuous).

  • Specific function blocks implement those interfaces (example: ValveContinuous and ValveThermo implementing IValveContinuous).

  • Aggregate function blocks supporting variants provide one (interface type) input per “variant aspect” (example: |RoomControlFCUSimple|).

  • The user of such an aggregate function blocks (which supports variants) connects a specific function block instance to the “variant aspect” input of the aggregate function block instance. So the specific function block instance which implements the generalized functionality of the “variant aspect” in fact resides outside (or “external”) of the aggregate function block itself

Other options to implement variants (not used in the CODESYS Building Automation library) include the following:

  • Implement all variants inside the aggregate function block and select by input configuration This approach leads to unwanted complexity and large amounts of unused code and resources.

  • Using the CODESYS Application Composer This approach requires the application developer to implement complex Application Composer “modules”.

CFC-specific considerations

Function blocks which implement an interface (for example, ValveThermo implementing IValveContinuous) provide an output itf* (example: itfValveContinuous). This is about to support usability of the function block in CFC.

Example

The CODESYS Building Automation library comes with extensive examples including a examples regarding aggregate variants. See the sample project BuildingLib_examples.project - function block and visualization Example_AggregateVariants_CFC and Example_AggregateVariants_ST - for a first example of how to deal with variants. You may want to look at ExampleFancoil3StageAggregate and ExampleRoomAutomation as well.