OpModeSelect
OpModeSelect (FB)
OpModeSelect (FB)FUNCTION_BLOCK OpModeSelect EXTENDS MANASBase IMPLEMENTS IMan
Short description
Plant switch for switching between up to 6 operating modes (automatic and 5 manual operating modes)
Representation

Interfaces
Inputs
xIn
BOOL
FALSE
State variable for xActive in automatic mode
Outputs
xActive
BOOL
FALSE
Output variable in automatic mode
xAutoM0
BOOL
FALSE
Indicator for automatic operating mode
xManOffM1
BOOL
FALSE
Indicator for manual-off operating mode
xManM2
BOOL
FALSE
Indicator for manual 1 operating mode
xManM3
BOOL
FALSE
Indicator for manual 2 operating mode
xManM4
BOOL
FALSE
Indicator for manual 3 operating mode
xManM5
BOOL
FALSE
Indicator for manual 4 operating mode
sActMode
STRING
Name of the current operating mode (e.g. 'Automatic')
Setpoints / parameters
tToggleTime
TIME
2s
Time delay until operating mode change
eMaxMode
eOpMode
eOpMode.Mode5
Definition of the maximum number of manual operating modes
xOpModeToggle
BOOL
FALSE
Operating mode toggle
xResAuto
BOOL
FALSE
Reset to automatic mode
xEn
BOOL
TRUE
Enable
sTitle
STRING
'Operating mode '
Name of the plant switch
sTitle2
STRING
'Description '
Description of the plant switch
eMode
eOpMode
eOpMode.Mode0
Current operating state of the plant switch
sTitleM0
STRING
'Automatic'
Description of the automatic operating mode
sTitleM1
STRING
'Manual Off'
Description of the manual-off operating mode
sTitleM2
STRING
'Manual 1'
Description of the manual 1 operating mode
sTitleM3
STRING
'Manual 2'
Description of the manual 2 operating mode
sTitleM4
STRING
'Manual 3'
Description of the manual 3 operating mode
sTitleM5
STRING
'Manual 4'
Description of the manual 4 operating mode
Function description
General
The plant switch is used to switch between eMaxMode +1 different operating modes (automatic, manual-off and eMaxMode -1 manual operating modes). The switching operation is triggered by a rising edge on the setpoint / parameter xOpModeToggle triggered. The switching is cyclic, i.e. after the last manual operating mode the next switching operation selects the automatic operating mode. The operating mode can also be explicitly selected by choosing the setpoint / parameter eMode in the range eOpMode.Mode0 - eMaxMode take place. The current operating mode is represented numerically by the setpoint/parameter eMode in the range eOpMode.Mode0 - eMaxMode represented. It is additionally indicated by the corresponding digital outputs xAutoM0, xManOffM1, xManM2, xManM3, etc. represented.
State variable xIn
In
xActive
Note
FALSE
FALSE
Valid only in automatic mode (eMode = eOpMode.Mode0)
TRUE
TRUE
Valid only in automatic mode (eMode = eOpMode.Mode0)
Output variable xActive
In automatic mode (eMode = eOpMode.Mode0) the output variable follows xActive the input variable xIn. In all other operating modes the state FALSE is always active.
Reset to automatic mode
Any rising edge on the setpoint/parameter xResAuto activates automatic mode if the setpoint/parameter xEn is in the TRUE state.
Enable/disable of the switching
The operating mode can only be changed if the setpoint/parameter xEn is in the TRUE state.
Switching delay tToggleTime
The time interval between activation of the operating mode toggle and the actual switch can be set via the setpoint / parameter tToggleTime be set. The time interval only starts if the operating mode change was initiated via the setpoint/parameter xOpModeToggle was made.
Operating modes
eMode
Name of the operating mode
xIn
xActive
xAutoM0
xManOffM1
xManM2
xManM3
xManM4
xManM5
Note
eOpMode.Mode0
sTitleM0
FALSE
FALSE
TRUE
FALSE
FALSE
FALSE
FALSE
FALSE
Automatic operating mode
eOpMode.Mode0
sTitleM0
TRUE
TRUE
TRUE
FALSE
FALSE
FALSE
FALSE
FALSE
Automatic operating mode
eOpMode.Mode1
sTitleM1
X
FALSE
FALSE
TRUE
FALSE
FALSE
FALSE
FALSE
Manual-off operating mode
eOpMode.Mode2
sTitleM2
X
FALSE
FALSE
FALSE
TRUE
FALSE
FALSE
FALSE
Manual 1 operating mode
eOpMode.Mode3
sTitleM3
X
FALSE
FALSE
FALSE
FALSE
TRUE
FALSE
FALSE
Manual 2 operating mode
eOpMode.Mode4
sTitleM4
X
FALSE
FALSE
FALSE
FALSE
FALSE
TRUE
FALSE
Manual 3 operating mode
eOpMode.Mode5
sTitleM5
X
FALSE
FALSE
FALSE
FALSE
FALSE
FALSE
TRUE
Manual 4 operating mode
Legend: X = Indeterminate
Visualization
Matching visualization element from the HVACV Visu Library: OpModeSelect OpModeSelect_Button
Representation


Visualization element interface OpModeSelect_Button
FB_OpModeSelect_0
HVAC.OpModeSelect
VAR_IN_OUT
Enter FB instance OpModeSelect here e.g. PRG.OpModeSelect
It is sufficient to place the visualization element OpModeSelect_Button. Clicking it opens the OpModeSelect dialog in the visualization. The number of operating modes is defined in the FB HVAC.OpModeSelect (eMaxMode) as well as the titles (sTitleM0 to M5) and the dialog title (sTitle and sTitle2). The visualization element automatically adapts to the size of the maximum operating modes.
Note: VAR_IN_OUT interfaces must be assigned, VAR_INPUT are optional.
CODESYS
InOut:
Input
xIn
BOOL
0
Input Const
tToggleTime
TIME
TIME#2s0ms
Input Const
eMaxMode
eOpMode
eOpMode.Mode5
Input Const
xOpModeToggle
BOOL
FALSE
Input Const
xResAuto
BOOL
FALSE
Input Const
xEn
BOOL
TRUE
Input Const
sTitle
STRING
'Operating mode'
Input Const
sTitle2
STRING
'Description'
Input Const
eMode
eOpMode
eOpMode.Mode0
Input Const
sTitleM0
STRING
'Automatic'
Input Const
sTitleM1
STRING
'Manual Off'
Input Const
sTitleM2
STRING
'Manual 1'
Input Const
sTitleM3
STRING
'Manual 2'
Input Const
sTitleM4
STRING
'Manual 3'
Input Const
sTitleM5
STRING
'Manual 4'
Output
xActive
BOOL
Output
xAutoM0
BOOL
Output
xManOffM1
BOOL
Output
xManM2
BOOL
Output
xManM3
BOOL
Output
xManM4
BOOL
Output
xManM5
BOOL
Output
sActMode
STRING
Last updated

