Shade B
ShadeB (FB)
FUNCTION_BLOCK Shade B
Short description
Control of a blind actuator with up/down commands, pushbutton operation and central control.
Additional functions: slat adjustment by long button press, target position travel and end-position approach.
Comfort functions: start/stop toggle by short button press, direction-change lockout, overrun time and mutual interlocking.
Typical application: control of a standard blind actuator with local operation, central command and position specification.
Representation

Interfaces
Inputs
xButtonUp
BOOL
Request - blind opening via button
xButtonDown
BOOL
Request - blind closing via button
xCentralUp
BOOL
Request - blind opening via central control
xCentralDown
BOOL
Request - blind closing via central control
eAOOUp
HVACTYPES.eManBin
HVACTYPES.eManBin.Auto, HVACTYPES.eManBin.ManOff, HVACTYPES.eManBin.ManOn
HVACTYPES.eManBin.Auto
Manual override mode - hardware for blind opening
eAOODown
HVACTYPES.eManBin
HVACTYPES.eManBin.Auto, HVACTYPES.eManBin.ManOff, HVACTYPES.eManBin.ManOn
HVACTYPES.eManBin.Auto
Manual override mode - hardware for blind closing
rTargetPos
REAL
0.0 … 100.0 %
Target position of the blind; 0% = open / up, 100% = closed / down
Outputs
xUp
BOOL
Enable - blind opening
xDown
BOOL
Enable - blind closing
xAuto
BOOL
Collective automatic operation message
rPos
REAL
0.0 … 100.0 %
Calculated current position of the blind; 0% = open / up, 100% = closed / down
Setpoints / Parameters
rHysterese
REAL
3.0
Hysteresis for setpoint comparison and end-position range (%)
udiFullMovement
UDINT
Time for complete opening/closing movement of the blind (seconds)
udiAddFullMovement
UDINT
additional safety time for end position (seconds)
udiPulseNeigung
UDINT
Pulse time for slat adjustment (milliseconds)
udiButton
UDINT
Time to distinguish short press / long press (milliseconds)
udiWaitReverse
UDINT
Lockout time when changing direction (seconds)
eManModeUp
eMANBIN
eMANBIN.Auto, eMANBIN.ManOff, eMANBIN.ManOn
Manual override mode for UP
eManModeDown
eMANBIN
eMANBIN.Auto, eMANBIN.ManOff, eMANBIN.ManOn
Manual override mode for DOWN
Functional description
General
The function block ShadeB controls a blind via the outputs xUp (open) and xDown (close). Both outputs are mutually interlocked: if xUp is active (= TRUE), xDown is simultaneously deactivated (= FALSE) and vice versa. Simultaneous activation of both outputs is not possible.
The output commands can be manually overridden independently of the automatic function by the parameters eManModeUp and eManModeDown.
Operation is primarily via the local pushbutton inputs xButtonUp and xButtonDown. A higher-level central control is available via the inputs xCentralUp and xCentralDown. The duration of button actuation determines the function executed:
Duration < tButton → short press: complete opening / closing (Toggle Start/Stop)
Duration ≥ tButton → long press: slat adjustment in pulse mode
If one of the buttons xButtonUp or xButtonDown is pressed during an ongoing complete opening or closing, the travel movement is stopped immediately.
Central control
Each rising edge at input xCentralUp triggers a complete opening of the blind (xUp = TRUE, xDown = FALSE for the duration tFullMovement). An additional overrun time tAddFullMovement ensures that the mechanical end position is safely reached.
Each rising edge at input xCentralDown triggers a complete closing of the blind (xDown = TRUE, xUp = FALSE for the duration tFullMovement).
If xCentralUp or xCentralDown are permanently active (= TRUE), simultaneous local operation via xButtonUp / xButtonDown is not possible. Only after the central command is removed can the movement be interrupted or restarted by local button actuation. A central command during an active automatic movement stops it immediately and takes over control.
Complete opening / closing (short button press)
A short button press (actuation time < tButton) on xButtonUp or xButtonDown activates the start/stop toggle of the travel movement. The first press starts the movement, the second press stops it. A signal (= TRUE) is generated at the corresponding output for the duration tFullMovement. No signal is present at the respective other output (= FALSE).
Slat adjustment (long button press)
A long button press (actuation time ≥ tButton) on xButtonUp or xButtonDown activates pulse operation for stepwise slat adjustment. While the button is held, a symmetrical pulse signal is generated at the assigned output (pulse duration = pause duration = tPulse). Pulse operation is active only while the button is pressed and stops immediately when released.
Waiting time for direction change (tWaitReverse)
The switching from opening to closing and vice versa is delayed by the parameter tWaitReverse to protect the drive from damage caused by an immediate reversal of direction. The value 0.0 s allows immediate switching without delay.
Automatic travel (rTargetPos)
Via the input rTargetPos (REAL, 0–100%), the blind can be automatically moved to a target position. Automatic travel starts as soon as the setpoint differs from the current position by more than the configured hysteresis. Targets in the end-position range are automatically snapped to:
Setpoint ≤ hysteresis → target position is set to 0% (fully open)
Setpoint ≥ 100% − hysteresis → target position is set to 100% (fully closed)
Automatic travel is interrupted immediately by any local button press or central command. After reaching the target position, the automatic function stops by itself.
End-position handling
In the blind's end ranges (position 0–3% and 97–100%), a special stop logic applies: a button press during a running movement in the end position stops the movement immediately and locks the output. Another button press (any button, local or central) releases the lock and restores normal function. At program start (rPos = 0, no active travel command), this logic is not triggered.
Aggregate message automatic mode xAuto
The aggregate message automatic mode xAuto is activated (= TRUE) if the following conditions are all met at the same time:
Input eAOOUp = HVACTYPES.eManBin.Auto
Input eAOODown = HVACTYPES.eManBin.Auto
Setpoint / parameter eManModeUp = eMANBIN.Auto
Setpoint / parameter eManModeDown = eMANBIN.Auto
Codsys
InOut
Input
xButtonUp
BOOL
Input
xButtonDown
BOOL
Input
xCentralUp
BOOL
Input
xCentralDown
BOOL
Input
eAOOUp
eManBin
Input
eAOODown
eManBin
Input
rTargetPos
REAL
Input
xNewTarget
BOOL
Output
xUp
BOOL
Output
xDown
BOOL
Output
xAuto
BOOL
Output
rPos
REAL
Input Const
udiFullMovement
UDINT
30
Input Const
udiAddFullMovement
UDINT
5
Input Const
udiButton
UDINT
900
Input Const
udiPulseNeigung
UDINT
600
Input Const
udiWaitReverse
UDINT
2
Input Const
rHysterese
REAL
3
Input Const
eManModeUp
eMANBIN
eMANBIN.Auto
Input Const
eManModeDown
eMANBIN
eMANBIN.Auto
Last updated

