OpModeSelect
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 modes)
Representation

Interfaces
Inputs
xIn
BOOL
FALSE
Status variable for xActive in automatic mode
Outputs
xActive
BOOL
FALSE
Output variable in automatic mode
xAutoM0
BOOL
FALSE
Display of operating mode Automatic
xManOffM1
BOOL
FALSE
Display of operating mode Manual-Off
xManM2
BOOL
FALSE
Display of operating mode Manual 1
xManM3
BOOL
FALSE
Display of operating mode Manual 2
xManM4
BOOL
FALSE
Display of operating mode Manual 3
xManM5
BOOL
FALSE
Display of operating mode Manual 4
sActMode
STRING
Name of the current operating mode (e.g. 'Automatic')
Setpoints / Parameters
tToggleTime
TIME
2s
Time delay until changing operating mode
eMaxMode
eOpMode
eOpMode.Mode5
Definition of the maximum number of manual operating modes
xOpModeToggle
BOOL
FALSE
Switching between operating modes
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 automatic operating mode
sTitleM1
STRING
‘Manual Off’
Description of manual-off operating mode
sTitleM2
STRING
‘Manual 1’
Description of manual 1 operating mode
sTitleM3
STRING
‘Manual 2’
Description of manual 2 operating mode
sTitleM4
STRING
‘Manual 3’
Description of manual 3 operating mode
sTitleM5
STRING
‘Manual 4’
Description of manual 4 operating mode
Functional description
General
The plant switch serves to switch between eMaxMode +1 different operating modes (automatic, manual-off and eMaxMode -1 manual operating modes). The switching process is triggered by a rising edge at the setpoint / parameter xOpModeToggle . The switching is endless, i.e. after the last manual operating mode, the next switching operation selects automatic mode. The operating mode can also be explicitly selected by choosing the setpoint / parameter eMode in the range eOpMode.Mode0 - eMaxMode . The current operating mode is represented numerically by the setpoint/parameter eMode in the range eOpMode.Mode0 - eMaxMode . It is additionally represented by the corresponding digital outputs xAutoM0, xManOffM1, xManM2, xManM3, etc.
Status variable xIn
In
xActive
Note
FALSE
FALSE
Only valid in automatic mode (eMode = eOpMode.Mode0)
TRUE
TRUE
Only valid in automatic mode (eMode = eOpMode.Mode0)
Output variable xActive
In automatic mode (eMode = eOpMode.Mode0) the output variable follows xActive the input variables xIn. In all other operating modes, the state FALSE is always active.
Reset to automatic mode
Each rising edge at the setpoint/parameter xResAuto activates automatic mode if the setpoint/parameter xEn is in the TRUE state.
Enable/disable switching
Switching of the operating mode can only occur if the setpoint/parameter xEn is in the TRUE state.
Switching delay tToggleTime
The time period between activation of the operating mode switch and the actual switching can be set via the setpoint / parameter tToggleTime . The time period starts only if the switching of the operating modes was done via the setpoint/parameter xOpModeToggle .
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
Operating mode Automatic
eOpMode.Mode0
sTitleM0
TRUE
TRUE
TRUE
FALSE
FALSE
FALSE
FALSE
FALSE
Operating mode Automatic
eOpMode.Mode1
sTitleM1
X
FALSE
FALSE
TRUE
FALSE
FALSE
FALSE
FALSE
Operating mode Manual-Off
eOpMode.Mode2
sTitleM2
X
FALSE
FALSE
FALSE
TRUE
FALSE
FALSE
FALSE
Operating mode Manual 1
eOpMode.Mode3
sTitleM3
X
FALSE
FALSE
FALSE
FALSE
TRUE
FALSE
FALSE
Operating mode Manual 2
eOpMode.Mode4
sTitleM4
X
FALSE
FALSE
FALSE
FALSE
FALSE
TRUE
FALSE
Operating mode Manual 3
eOpMode.Mode5
sTitleM5
X
FALSE
FALSE
FALSE
FALSE
FALSE
FALSE
TRUE
Operating mode Manual 4
Legend: X = Undefined
Visualization
Suitable visualization element from the HVACV Visu Library: OpModeSelect OpModeSelect_Button
Representation


Interface visualization element 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.
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

