ExampleAirConditioning1 (FB)¶
FUNCTION_BLOCK ExampleAirConditioning1
Example air conditioning 1
This example function block implements a very simple air conditioning plant to demonstrate how to:
implement a plant / an aggregate in CFC using CODESYS Building Automation library function blocks
use SequenceControl
This example involves:
sequence control of heater coil / cooler coil
energy level
exhaust air damper / outdoor air damper control
extract air fan / supply air fan control
Watch out for comments in the implementation where those aspects are covered.
outdoor air damper
heater coil (water operated)
cooler coil (water operated)
supply air fan
extract air fan
extract air temperatur sensor
exhaust air damper
Air types¶
Air types - terms, abbreviations and colors oriented towards DIN EN 16798-3.
Sequence control heater coil / cooler coil¶
SequenceControl is used to control two sequences - heater coil and cooler coil.
Hints¶
Unused pins of function block instances are hidden, so refer to the function block documentation for more details. This example is evolved into ExampleAirConditioning2.
Caveats¶
To keep complexity as low as possible this example omits the following real world application aspects worth mentioning:
ignoring the subtle differences between indoor air control vs. extract air control (assuming extract air temp. = indoor air temp.)
no anti-freeze mechanism for heater coil
no indoor air / supply air cascade control (control quality)
no supply air minimum enforced (physiological problems caused by low supply air temperature)
configuration missing (configuration of m_energyLevelSetpoint, m_sequenceControl, m_hvacHeaterCoil and m_hvacCoolerCoil is not exposed on the ExampleAirConditioning1 VAR_INPUT section)
input consistency checks (implausible measurement values, …)
xError / eErrorID not computed from xError / eErrorID of all function block instances used, see ExampleAirConditioning2 how to do this
- InOut:
Scope
Name
Type
Initial
Comment
Input
xEnableBOOLTRUE
Enable
eLevelEnergyLevel.COMFORT
Energy level
rEtaTempREAL22.0
Extract air temperature
rSetptHeatComfortREAL21.0
Heat setpoint comfort level
rSetptCoolComfortREAL23.0
Cool setpoint comfort level
xResetBOOLFALSE
Reset to proportional control / reset detected input error
itfDateTimeProviderUtil.IDateTimeProviderGlobals.g_dtpDateTimeProvider
Source for the current date and time information in milliseconds since 1.1.1970 00:00:00.000
Output
eModeOutHeatCoolOperationMode.INACTIVE
Operation mode.
rHeatOutREALHeat valve signal (0..100%).
rCoolOutREALCool valve signal (0..100%).
rOdaDamperOutREALOutdoor air damper signal (0..100%).
rEhaDamperOutREALExhaust air damper signal (0..100%).
xFanBOOLExtract air / supply air fan
xErrorBOOLError indication
eErrorIDError ID