FB_BA_SeqLink
This function block represents the higher-level control unit, which specifies which sequence controller is currently active.
The data exchange between the control function block FB_BA_SeqLink and the sequence controllers FB_BA_SeqCtrl takes place via the structure variable stSeqLink.
Functional description
Start-up behavior
A TRUE signal at input bEn activates the entire sequence control. The function block will initially activate the sequence controller that is known at usiStartSeq. All other sequence controller base their output value on the ranking of the active controller, see FB_BA_SeqCtrl. The start controller will be set once to its value lrSyncVal at the start of the sequence.
In order to enable "sensible" adjustment of the entire control sequence, the start controller is maintained in active state as a minimum for the time udiIniSwiOvrDly. During this time, no switching takes place to another controller of this sequence.
Switching behaviour
Switching behaviour
When the sequence controller reaches its maximum or minimum value, the next controller in the sequence is activated, depending on the controller direction of action, if the actual value is below or above the setpoint of the next controller.
4 cases are distinguished:
- The still active controller has direct direction of action (cooling) and is at its maximum value: The next higher controller in the sequence is then selected, if the actual value exceeds the set value for this controller.
- The still active controller has direct direction of action (cooling) and is at its minimum value: The next lower controller in the sequence is then selected, if the actual value falls below the set value for this controller.
- The still active controller has indirect direction of action (heating) and is at its maximum value: The next lower controller in the sequence is then selected, if the actual value falls below the set value for this controller.
- The still active controller has indirect direction of action (heating) and is at its minimum value: The next higher controller in the sequence is then selected, if the actual value exceeds the set value for this controller.
Switch-off behavior
If the enable status is removed from a controller within the sequence or if it develops a fault, it is no longer available for the whole sequence.
If this is not the previously active controller, a temperature change may occur, depending on which control value this controller has output, which is compensated by the controller sequence, if possible.
If the enable status is removed from the active controller, a "meaningful" controller must be selected. The sequence link function block uses the following rules:
- The deactivated controller had direct control direction (cooling)
- An operational controller with higher ordinal number is available → switch to the next higher operational controller. Only an operational controller with lower ordinal number is available → switch to the next lower operational controller. No operational controller is available → fault message.
- The deactivated controller had indirect control direction (heating)
- An operational controller with lower ordinal number is available → switch to the next lower operational controller. Only an operational controller with higher ordinal number is available → switch to the next higher operational controller. No operational controller is available → fault message.
Sequence behavior
If a controller is added to the sequence, it is in any case initially inactive and will output its minimum or maximum value, depending on the direction of action and positioning within the sequence order. The resulting temperature change is compensated by the controller sequence, if possible.
Error detection
The following errors are detected by the sequence link function block:
- At least two controller with the same ordinal number exist, which are assigned to the sequence.
- Within the sequence, more than just a change from indirect to direct control direction (heating to cooling) was detected.
- The setpoints of the controllers in the controller sequence are not monotonically increasing.
- The controller, which was defined as start controller via the input usiStartSeq, does not exist or is not assigned to this sequence (in this case, the next valid controller is selected).
- A start controller with the ordinal number 0 or greater than the maximum permitted controller number was specified (in this case, the next valid controller is selected).
Only the first error causes the sequence link function block to go into error or blocks its processing (=FALSE). bSeqActv None of the associated controllers is then active and all controllers output the control value "0". The function block is not active:
although all other errors are indicated as bErr=TRUE, they have an error number (udiErrId), they only identify it as a warning.
Inputs/outputs
VAR_INPUT
bEn : BOOL;
usiStartCtrl : USINT;
udiIniSwiOvrDly : UDINT;
lrX : LREAL
bEn: activation of the sequence controller
usiStartSeq: ordinal number of the sequence controller to be used as start controller for the overall activation.
udiIniSwiOvrDly: as mentioned at the beginning, a sequence control needs some time at the beginning to settle with the start controller. The start controller remains active for at least the time udiIniSwiOvrDly [s] in the sequence until other criteria cause it to switch to another controller. See also "Start behavior" and "Switching behavior".
lrX: actual value of the control
VAR_IN_OUT
stSeqLink : ST_BA_SeqLink;
stSeqLink: data and command structure between the individual sequence controllers and the function block FB_BA_SeqLink. This structure is used by the sequence link function block to receive all relevant sequence controller data and at the same time to notify the controllers which is the active one.
If several sequence controllers have the same number (usiMyNum), this is detected and output as an error at the sequence controller and at the control function block. |
VAR_OUTPUT
usiCurCtrl : USINT;
bSeqActv : BOOL;
bNotRead : BOOL;
bNoneOp : BOOL;
udiRemTiIniSwiOvrDly : UDINT;
bErr : BOOL;
udiErrId : UDINT;
udiErrArg : UDINT;
usiCurCtrl: ordinal number of the currently active sequence controller. If no controller is active, 0 is output here.
bSeqActv: the sequence function block is enabled (bEn) and has no error resulting in switch-off, see error detection.
bNotRead: each sequence controller transfers data to the control function block via the structure stSeqLink. This output is TRUE, as long as no data were transmitted - this is the case when the PLC is switched on.
bNoneOp: this output is switched to TRUE, if none of the sequence controller is enabled (bEn=TRUE).
bErr: this output is switched to TRUE if the parameters entered are erroneous. This function block may not suspend its execution in the event of an error, see error detection.
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 |
See also: