FB_BA_SunBldTwiLgtAuto
This function block controls the blind if the outdoor brightness has fallen below a limit value.
Functional description
The automatic twilight function operates with both a value hysteresis and a temporal hysteresis: If the outdoor brightness value lrBrtns [lux] falls below the value lrActvVal [lux] for the time udiActvDly [s], the function block is active and will provide the blind positions lrPosTwiLgt (height [%]) and lrAnglTwiLgt (louvre angle [°]) at the output in the positioning telegram stSunBld, as specified in the IN variables. Conversely, if the outdoor brightness exceeds the value lrDctvVal [lux] for the time udiDctvDly [s], then the automatic function is no longer active. The active flag in the positioning telegram stSunBld is reset and the positions for height and angle are set to "0". A function with a lower priority can then take over control.
Inputs/outputs
VAR_INPUT
bEn : BOOL;
lrBrtns : LREAL;
lrActvVal : LREAL;
lrDctvVal : LREAL;
udiActvDly : UDINT;
udiDctvDly : UDINT;
lrPosTwiLgt : LREAL;
lrAnglTwiLgt : LREAL;
bEn: the function block has no function if this input is FALSE. In the positioning telegram stSunBld, 0 is output for the position and the angle, and bActv is FALSE. This means that another function takes over control of the blind via the priority controller.
lrBrtns: outdoor brightness [lx]
lrActvVal: activation limit value [lx]
lrDctvVal: deactivation limit value [lx]
udiActvDly: activation delay [s]
udiDctvDly: deactivation delay [s]
lrPosTwiLgt: vertical position of the blind [%] if the twilight automatic is active
lrAnglTwiLgt: slat angle of the blind [°] if the twilight automatic is active
VAR_OUTPUT
stSunBld : ST_BA_SunBld;
bActv : BOOL;
udiRemTiActv : UINT;
udiRemTiDctv : UINT;
bErr : BOOL;
udiErrId : UDINT;
udiErrArg : UDINT;
stSunBld: output structure of the blind positions, see ST_BA_SunBld
bActv : corresponds to the boolean value bActv in the blind telegram ST_BA_SunBld and is solely used to indicate whether the function block sends an active telegram.
udiRemTiActv: shows the time remaining [s] after falling below the switch value lrActvVal until automatic mode is activated. This output is 0 as long as no countdown of the time is taking place.
udiRemTiDctv: shows the time remaining [s] after exceeding the switch value lrDctvVal until automatic mode is disabled. This output is 0 as long as no countdown of the time is taking place.
bErr: this output is switched to TRUE if the parameters entered are erroneous.
udiErrId / udiErrArg: contains the error number and the error argument. See error codes.
![]() | If an error should occur, then this automatic function is deactivated and position and angle are set to 0. This means that if a priority controller is in use, another function with a lower priority (see Overview) automatically takes over control of the blind. In the case of a direct connection, conversely, the blind will drive to position/angle 0. |
Requirements
Development environment | Target system | required library | required supplement |
---|---|---|---|
TwinCAT 2.11 R3/x64 | PC/CX | TcBA library from V1.0.0 | TS8040 | TwinCAT Building Automation from V1.0.0 |