FB_BA_SunBldTwiLgtAuto

This function block controls the blind when the outdoor brightness has fallen below a limit value.
The automatic twilight function operates with both a value hysteresis and a temporal hysteresis: If the outdoor brightness value rBrtns [lux] falls below the value rActvVal [lux] for the time udiActvDly_sec [s], the function block is active and will provide the blind positions rPosTwiLgt (height [%]) and rAnglTwiLgt (louvre angle [°]) specified for the input variables at the output in the positioning telegram ST_BA_Sunbld. If the outdoor brightness exceeds the value rActvVal [lux] for the time udiDctvDly_sec [s], automatic mode is no longer active. The active flag in the positioning telegram ST_BA_Sunbld is reset and the positions for height and angle are set to "0". A function with a lower priority can then take over control.
VAR_INPUT
bEn : BOOL;
rBrtns : REAL;
rActvVal : REAL;
rDctvVal : REAL;
udiActvDly_sec : UDINT;
udiDctvDly_sec : UDINT;
rPosTwiLgt : REAL;
rAnglTwiLgt : REAL;
bEn: The function block has no function if this input is FALSE. In the positioning telegram ST_BA_Sunbld 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.
rBrtns: Outdoor brightness [lx].
rActvVal: Activation limit value [lx]. The value rActvVal is internally limited to values from 0 to rDctvVal.
rDctvVal: Deactivation limit value [lx]. Internally limited to a minimum value of 0.
udiActvDly_sec: Activation delay [s]. Internally limited to a minimum value of 0.
udiDctvDly_sec: Deactivation delay [s]. Internally limited to a minimum value of 0.
rPosTwiLgt: Vertical position of the blind [%] if the automatic twilight function is active. Internally limited to values between 0 and 100.
rAnglTwiLgt: Louvre angle of the blind [°] if the automatic twilight function is active.
VAR_OUTPUT
stSunBld : ST_BA_SunBld;
bActv : BOOL;
udiRemTiActv_sec : UDINT;
udiRemTiDctv_sec : 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_sec: Shows the time remaining [s] after falling below the switching value rActvVal until automatic mode is activated. This output is 0 as long as no countdown of the time is taking place.
udiRemTiDctv_sec: Shows the time remaining [s] after exceeding of the switching value rDctvVal until automatic mode is disabled. This output is 0 as long as no countdown of the time is taking place.
![]() | If an error occurs, this automatic control is deactivated, and the 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 | Required PLC library |
---|---|
TwinCAT from v3.1.4024.7 | Tc3_BA from v1.1.6.0 |