FB_BARDelayedHysteresis

FB_BARDelayedHysteresis 1:

This function block represents a threshold switch for brightness. The switch-on and switch-off behavior can additionally be delayed.

VAR_INPUT

eDataSecurityType  : E_HVACDataSecurityType;
uiBrightness       : UINT;

eDataSecurityType: If eDataSecurityType:= eHVACDataSecurityType_Persistent, the persistent VAR_IN_OUT variables of the function block are stored in the flash of the computer if a value changes. For this to work, the function block FB_HVACPersistentDataHandling must be instanced once in the main program, which is called cyclically. Otherwise the instanced FB is not released internally.

A change of value can be initiated by the building management system, a local operating device or via a write access from TwinCAT. When the computer is restarted the saved data are automatically read back from the flash into the RAM.

Application example: example_persistent.zip

If eDataSecurityType:= eHVACDataSecurityType_Idle the persistently declared variables are not saved in a fail-safe manner.

Notice

A cyclically changing variable must never be linked with the IN_OUT variable of a function block, if eDataSecurityType:= eHVACDataSecurityType_Persistent. It would lead to early wear of the flash memory.

uiBrightness: External brightness in lux.

VAR_OUTPUT

bOut       : BOOL;
bError     : BOOL;
udiErrorId : UDINT;

bOut: binary delayed output of the threshold switch

bError: this output is switched to TRUE if the parameters entered are erroneous.

udiErrorId: contains the error code if the values entered should be erroneous. See Error codes.

VAR_IN_OUT

uiOnValue  : UINT;
uiOffValue : UINT;
uiOnDelay  : UINT;
uiOnDelay  : UINT;

In order for the registered parameters to be retained beyond a controller failure, it is necessary to declare them as In-Out variables. A reference variable is then assigned to them in the program. Each change of the value of these reference variables is persistently stored in the function block and written back to the reference variable following a controller failure and restart. If the parameters were only to be defined as input variables, they would not be able to write a reference variable.
Application example: example_persistent.zip.

uiOnValue: Switch-on threshold value in lux. This must be larger than the switch-off threshold value uiOffValue.

uiOffValue: Switch-off threshold value in lux. This must be smaller than the switch-on threshold value uiOnValue.

uiOnDelay: Switch-on delay in seconds.

uiOffDelay: Switch-off delay in seconds.

Requirements

Development environment

required library

required function

TwinCAT 3.1 build 4022.16 or higher

Tc2_HVAC V3.3.1.0

TF8000 | TC3 HVAC V1.0.0.0