FB_BA_RolBldActr
This function block is used for positioning of a blind via two outputs: up and down. The blind can be driven to any desired position with the positioning telegram stSunBld. In addition, the positioning telegram stSunBld also contains manual commands with which the blind can be moved individually to certain positions. These manual commands are controlled by the function block FB_BA_SunBldSwi.
The function block has an internal fixed toggle latch (output bUp to output bDwn) of 500 ms.
This function block must be called in every PLC cycle, since the PLC cycle time is included in the calculation of the positions. |
Functional description
Structure of the blind positioning telegram stSunBld.
TYPE ST_BA_SunBld:
STRUCT
lrPos : LREAL;
lrAngl : LREAL;
bManUp : BOOL;
bManDwn : BOOL;
bManMod : BOOL;
bActv : BOOL;
END_STRUCT
END_TYPE
The current height position and the slat angle are not read in by an additional encoder, but are determined internally by the runtime of the blind.
The two different runtime parameters udiTiUp (runtime blind up in [ms]) and udiTiDwn (runtime blind down in [ms]) take into account the different travel characteristics.
The function block fundamentally controls the blind via the information from the positioning telegram stSunBld. If automatic mode is active (bManMod=FALSE), the current position is always approached, and changes are immediately taken into account. In manual mode (bManMod=TRUE) the commands bManUp and bManDwn control the blind.
Referencing
Secure referencing is ensured if the blind is driven upward for longer than its complete drive-up time. The position is then always "0". Since blind positioning without an encoder is naturally always susceptible to error, it is important to automatically reference as often as possible: Whenever "0" is specified as the target position, the blind initially moves upwards normally, based on continuous position calculation. Once the calculated position value 0% is reached, the output bUp continues to be held for the complete blind up time + 5s.
For reasons of flexibility there are now two possibilities to interrupt the referencing procedure: Until the calculated 0% position is reached, a change in position continues to be assumed and executed. Once this 0% position is reached, the blind can still be moved with the manual "blind down" command. These two sensible limitations make it necessary for the user to ensure that the blind is securely referenced as often as possible.
After a system restart, the function block executes a reference run. Completion of the initial referencing is indicated through a TRUE signal at output bInitRefCmpl. The initial referencing can also be terminated through a manual "blind down" command.
Inputs/outputs
VAR_INPUT
bEn : BOOL;
stSunBld : ST_BA_Sunblind;
udiTiUp : UDINT;
udiTiDwn : UDINT;
bEn: enable input for the function block. As long as this input is TRUE, the actuator function block accepts and executes commands as described above. A FALSE signal on this input resets the control outputs bUp and bDwn and the function block remains in a state of rest.
stSunBld: positioning telegram, see ST_BA_SunBld
udiTiUp: complete time for driving up [ms]
udiTiDwn: complete time for driving down in ms
VAR_OUTPUT
bUp : BOOL;
bDwn : BOOL;
lrActlPos : LREAL;
udiRefTi : UDINT;
bInitRefCompl : BOOL;
bRef : BOOL;
bBusy : BOOL;
bErr : BOOL;
udiErrId : UDINT;
udiErrArg : UDINT;
bUp: control output blind up
bDwn: control output blind down
lrActlPos: current position in percent
udiRefTi: referencing countdown display [s]
bInitRefCompl: initial referencing process complete.
bRef: the blind is referencing, i.e. the output bUp is set for the complete travel-up time + 5 s. Only a manual "down" command can move the blind in the opposite direction and terminate this mode.
bBusy: a positioning or a referencing procedure is in progress.
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.
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 |