FB_BA_SequenceLinkBase

FB_BA_SequenceLinkBase 1:

This function block represents the higher-level connection of a sequence control.

Data exchange sequence control

The data exchange between the sequence controllers FB_BA_SeqCtrl and the FB_BA_SequenceLinkBase takes place via the structure stSeqLink.

FB_BA_SequenceLinkBase 2:

Start behavior of the sequence

A TRUE signal at input bEn activates the entire sequence control. The function block will initially activate the sequence controller that is known at nNumStartCtrl. All other sequence controller base their output value on the ranking of the active controller.

If the sequence controller specified at nNumStartCtrl is not ready for operation, the enum eNoStartCtrlFound defines the procedure to find a new start controller. This ensures that the sequence always starts.

Switching in the sequence

If a sequence controller reaches its maximum or minimum value, the system switches to the next controller in the sequence depending on the control direction, provided that the actual value falls below or exceeds the setpoint of the next controller.

4 cases are distinguished:

Switching to another sequence controller can be delayed by specifying the time nSwiOverTi.

Operational readiness of the sequence controllers

If a controller loses its operational readiness in the sequence (missing enable bEn), it is no longer available for the entire 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.

However, if it is the active sequence controller, the enumeration eNoEnableSeqCtrl defines the procedure to find a new, active sequence controller.

If a sequence controller obtains its operational readiness in the running process, the controller is added to the sequence. Depending on the control direction E_BA_Action and its own sequence number nMyNum it will be placed in the controller sequence and output its minimum or maximum value. The resulting temperature change is compensated by the controller sequence, if possible.

Error detection

The error messages listed below are detected by FB_BA_SequenceLinkBase.

The x in the text messages stands for a numerical specification of a sequence controller.

The error messages are output in the "Error list" window in the Tc3 development environment. This can be activated under the menu item View.

Output of the error texts via the property StateText.

The enumeration eState additionally displays the messages.

FB_BA_SequenceLinkBase 3:

Globaler Parameter Tc3_BA2.BA_Param.nMaxSeqCtrl < 1

This message is the only one that disables sequence control.

German

English

Der nächste Sequenzsollwert ist kleiner als sein Vorgänger: x

Next sequence setpoint is smaller than its predecessor: x

Globaler Parameter Tc3_BA2.BA_Param.nMaxSeqCtrl < 1

Global parameter Tc3_BA2.BA_Param.nMaxSeqCtrl < 1

Mehrfache Wirkrichtung "eActn" in der Sequenzsteuerung

Multiple direction of action "eActn" of the sequence controller

Startsequenzregler ist nicht freigegeben: nNumStartCtrl = x

Start sequence controller is not enabled: nNumStartCtrl = x

Kein Sequenzregler ist betriebsbereit

No sequence controller is operational

Sequenznummer mehrfach vergeben: x

Sequence number assigned multiple times: x

Illustration

FUNCTION_BLOCK FB_BA_SequenceLinkBase
VAR_INPUT
  bEn                                     : BOOL;
  nNumStartCtrl                           : UDINT;
  {attribute 'parameterUnit':= 's'}
  nSwiOverTi                              : UDINT(0..1800);
END_VAR
VAR_OUTPUT
  bSeqCtrlOperational                     : BOOL;
  nActvSeqCtrl                            : UDINT;
  fActvSeqCtrl_Y                          : REAL;
  fActvSeqCtrl_X                          : REAL;
  fActvSeqCtrl_W                          : REAL;
  bActvSeqCtrlIsMaxLimit                  : BOOL;
  bActvSeqCtrlIsMinLimit                  : BOOL;
  bErr                                    : BOOL;
  eState                                  : E_BA_StateSeqLink;
  {attribute 'parameterUnit':= 's'}
  nRemTiSwiOvrTi                          : UDINT;
END_VAR
VAR_IN_OUT
  stSeqLink                               : ST_BA_SeqLink;
END_VAR
VAR_INPUT CONSTANT
  fHys                                    : REAL := 0.2;
  eNoStartCtrlFound                       : E_BA_NoStartCtrlFound := E_BA_NoStartCtrlFound.eLastActionReverse;
  eNoEnableSeqCtrl                        : E_BA_NoEnableSeqCtrl := E_BA_NoEnableSeqCtrl.eNextAction;
END_VAR

FB_BA_SequenceLinkBase 4: Inputs

Name

Type

Description

bEn

BOOL

Sequence control is activated when the function block is enabled. However, the sequence controllers must first be enabled.

nNumStartCtrl

UDINT

Ordinal number of the sequence controller, which should be the start controller when the sequence is activated.

An internal limitation allows only values from 1 - BA_Param.nMaxSeqCtrl.

nSwiOverTi

UDINT

Switching to another sequence controller can be delayed by the time specification.

An internal limitation only allows values from 0 - 1800 seconds.

FB_BA_SequenceLinkBase 5: Outputs

Name

Type

Description

bSeqCtrlOperational

BOOL

The sequence control is ready to operate or is in operation.

nActvSeqCtrl

UDINT

The output variable shows the number of the active sequence controller.

fActvSeqCtrl_Y

REAL

Control value of the active sequence controller.

fActvSeqCtrl_X

REAL

Actual value of the active sequence controller.

fActvSeqCtrl_W

REAL

Setpoint of the active sequence controller.

bActvSeqCtrlIsMaxLimit

BOOL

The upper output limit of the active sequence controller has been reached.

If it has not yet been advanced to the next sequence controller, bActvSeqCtrlIsMaxLimit is not set to FALSE until fActvSeqCtrl_Y has fallen below (fActvSeqCtrl_Y - fHys).

bActvSeqCtrlIsMinLimit

BOOL

The lower output limit of the active sequence controller has been reached.

If it has not yet been advanced to the next sequence controller, bActvSeqCtrlIsMinLimit is not set to FALSE until fActvSeqCtrl_Y has risen above (fActvSeqCtrl_Y + fHys).

bErr

BOOL

Indicates that an error has been detected.

More detailed information is provided by the property StateText. In addition, the enum eState displays further information.

Further explanations on error analysis can be found at Error detection.

eState

E_BA_StateSeqLink

The enumeration shows the state of the FB_BA_SequenceLinkBase and the sequence control.

nRemTiSwiOvrTi

UDINT

Countdown of switching to the next sequence controller [s].

FB_BA_SequenceLinkBase 6: / FB_BA_SequenceLinkBase 7: Inputs Outputs

Name

Type

Description

stSeqLink

ST_BA_SeqLink

Data and command structure between the individual sequence controllers FB_BA_SeqCtrl and the function block FB_BA_SequenceLinkBase.

FB_BA_SequenceLinkBase 8: Inputs CONSTANT

Name

Type

Description

fHys

REAL

This hysteresis value sets a hysteresis around the upper and lower output limit bActvSeqCtrlIsMaxLimit / bActvSeqCtrlIsMinLimit of the active sequence controller.

An internal limitation only allows values from 0 - 2.

eNoStartCtrlFound

E_BA_NoStartCtrlFound

If during the running process the active sequence controller loses its operational readiness, then the enumeration defines the procedure to find a new, active sequence controller.

eNoEnableSeqCtrl

E_BA_NoEnableSeqCtrl

If the start controller at the input nNumStartCtrl is not available or enabled, the enumeration defines the procedure to find a new start controller.

FB_BA_SequenceLinkBase 9: Properties

Name

Type

Access

Description

FirstActvSeqCtrl

UDINT

Get

The property shows the number of the first sequence controller ready for operation.

FirstActvSeqCtrlWithActionDirect

UDINT

Get

The property shows the number of the first sequence controller ready for operation with the control direction E_BA_Action.eDirect.

LastActvSeqCtrl

UDINT

Get

The property shows the number of the last sequence controller ready for operation.

LastActvSeqCtrlWithActionReverse

UDINT

Get

The property shows the number of the last sequence controller ready for operation with the control direction E_BA_Action.eReverse.

NextActionActvSeqCtrl

UDINT

Get

Depending on the control direction of the active sequence controller nActvSeqCtrl the next sequence controller ready for operation is displayed here.

Cooling/Direct control direction: next sequence controller ready for operation with the Cooling/Direct control direction (after 5 would come 6 or higher). If none is found, then E_BA_NoEnableSeqCtrl.eLastSeqNum is implemented.

Heating/reverse control direction: previous operational sequence controller with heating/reverse control direction (after 5 would come 4 or lower). If none is found, then E_BA_NoEnableSeqCtrl.eFirstSeqNum is implemented.

NextActvSeqCtrl

UDINT

Get

The property shows the number of the next sequence controller ready for operation after the last active one (after 5 would come 6 or higher).

PreviousActvSeqCtrl

UDINT

Get

The property shows the number of the previous sequence controller ready for operation after the last active one (after 5 would come 4 or lower).

ActvSeqCtrl

UDINT

Get

The property shows the number of the active sequence controller, see nActvSeqCtrl.

ActvSeqCtrl_ControlValue

REAL

Get

The property shows the control value of the active sequence controller, see fActvSeqCtrl_Y.

ActvSeqCtrl_IsMaxLimit              

BOOL

Get

The property indicates that the upper output limit of the active sequence controller has been reached, see bActvSeqCtrlIsMaxLimit.

ActvSeqCtrl_IsMinLimit

BOOL

Get

The property indicates that the lower output limit of the active sequence controller has been reached, see bActvSeqCtrlIsMinLimit.

ErrorParamMaxSeqCtrl

T_MaxString

Get

The property displays the following text in case of error: "Global parameter Tc3_BA2.BA_Param.nMaxSeqCtrl < 1", see BA_Param.nMaxSeqCtrl.

The global parameter must be adjusted in any case, because due to the wrong parameterization the sequence stops.

ErrorStartSeqCtrlNotOperable

T_MaxString

Get

The property displays the following text in case of error: "Start sequence controller is not enabled: nNumStartCtrl = x".

A check of the start sequence controller, which was specified with the input variable nNumStartCtrl, is required.

MultiDirectionActionSeqCtrl

T_MaxString

Get

The property displays the following text in case of error: Multiple direction of action "eActn" of the sequence controller: x.

Multiple direction of action of the sequence controller. It always looks from the sequence controller with the smallest number to the next largest one. It is possible to change the direction of action.

NextSeqSpIsSmaller

T_MaxString

Get

The property displays the following text in case of error: "Next sequence setpoint is smaller than its predecessor: x".

A check of the setpoints of the sequence controllers according to ascending order is required.

NoSeqCtrlIsOperational

T_MaxString

Get

The property displays the following text in case of an error: "No sequence controller is operational".

A check of the operational readiness of the sequence controllers is required.

SeqNumMulti

T_MaxString

Get

The property displays the following text in case of error: "Sequence number assigned multiple times: x".

A check of the displayed sequence number is necessary because it has been assigned several times in the sequence.

Requirements

Development environment

Required PLC library

TwinCAT from v3.1.4024.22

Tc3_BA2 from v5.2.5.0