OpModeSelect (FB)

FUNCTION_BLOCK OpModeSelect EXTENDS MANASBase IMPLEMENTS IMan

Short Description

Operating mode selector for switching between a maximum of 6 operating modes (automatic and 5 manual operating modes)


Portrayal

../_images/OpModeSelect_FB.png

Interfaces

Inputs

Name

Datatype

Range

Init-Value

Function

xIn BOOL   FALSE

State variable for xActive in automatic mode

Outputs

Name

Datatype

Range

Init-Value

Function

xActive BOOL   FALSE

Output variable in automatic mode

xAutoM0 BOOL   FALSE

Operating mode display in automatic mode

xManOffM1 BOOL   FALSE

Operating mode display in manual off mode

xManM2 BOOL   FALSE

Operating mode display in manual mode 1

xManM3 BOOL   FALSE

Operating mode display in manual mode 2

xManM4 BOOL   FALSE

Operating mode display in manual mode 3

xManM5 BOOL   FALSE

Operating mode display in manual mode 4

xActMode STRING    

Name of the current operating mode (e.g. ‘Automatic’)

Setpoints / Parameters

Name

Datatype

Range

Init-Value

Function

tToggleTime TIME   2s

Time delay for switching the operating mode

eMaxMode eOpMode   eOpMode.Mode5

Maximum number of manual operating modes

xOpModeToggle BOOL   FALSE

Switch operating mode

xResAuto BOOL   FALSE

Reset to automatic mode

xEn BOOL   TRUE

Enable

sTitle STRING   ‘Betriebsmodus ‘

Name of the operating mode (OP) selector

sTitle2 STRING   ‘Beschreibung ‘

Description of the OP selector

eMode eOpMode   eOpMode.Mode0

Current state of the OP mode selector

sTitleM0 STRING   ‘Automatik’

Description of the automatic mode

sTitleM1 STRING   ‘Hand Aus’

Description of the manual off mode

sTitleM2 STRING   ‘Hand 1’

Description of the manual mode 1

sTitleM3 STRING   ‘Hand 2’

Description of the manual mode 2

sTitleM4 STRING   ‘Hand 3’

Description of the manual mode 3

sTitleM5 STRING   ‘Hand 4’

Description of the manual mode 4

Functional Description

General

The operating mode selector is used to switch between eMaxMode +1 different operating modes (automatic, manual off and eMaxMode-1 manual-operating modes).
A rising edge at the variable xOpModeToggle triggers the switching process (Requirement: xEn =TRUE).
The switchover is continuous, i.e. after the last manual operating mode, the automatic mode is selected with the next switching operation.
.
Die Betriebsart kann explizit auch durch die Auswahl des Sollwerts / Parameter eMode im Bereich eOpMode.Mode0 - eMaxMode erfolgen.
Die aktuelle Betriebsart wird numerisch durch den Sollwert/Parameter eMode im Bereich eOpMode.Mode0 - eMaxMode dargestellt.
It is additionally represented by the corresponding digital outputs xAutoM0, xManOffM1, xManM2, xManM3, etc.

Variable xIn.

In xActive

Note

FALSE FALSE Nur im Automatikbetrieb ( eMode = eOpMode.Mode0 ) gültig
TRUE TRUE Nur im Automatikbetrieb ( eMode = eOpMode.Mode0 ) gültig

Output variable xActive

Im Automatikbetrieb ( eMode = eOpMode.Mode0 ) folgt die Ausgangsvariable xActive der Eingangsveriablen xIn.
With all other operating modes, the status FALSE is always active.

Reset to automatic mode

Each rising edge at setpoint/parameter xResAuto activates the automatic mode, if the
Setpoint/parameter xEn is TRUE.

Enabling/disabling switching

The operating mode can only be changed if the setpoint/parameter xEn is
TRUE.

Switching delay tToggleTime

The length of time between activation of mode switching and actual switching
can be set via the setpoint/parameter tToggleTime. The length of time only starts after the
the operating modes have been switched over 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




Information

Element

Authors

Date

Version

Note

Function

Adam Bartod 11.2016 1.0

Initial Version

Programming

Adam Bartod 02.2017 1.0

Initial Version

Test Jochen Reu 02.2017 1.0

Initial Version

Documentation

Jochen Reu 10.2017 1.0

Initial Version

Codesys

InOut:
Scope Name Type Initial Comment
Input xIn BOOL 0

State variable for xActive in automatic mode

tToggleTime TIME TIME#2s0ms

Time delay for switching the operating mode

eMaxMode eOpMode eOpMode.Mode5

Maximum number of manual operating modes

xOpModeToggle BOOL FALSE

Switch operating mode

xResAuto BOOL FALSE

Reset to automatic mode

xEn BOOL TRUE

Enable

sTitle STRING ‘Betriebsmodus’

Name of the operating mode (OP) selector

sTitle2 STRING ‘Beschreibung’

Description of the OP selector

eMode eOpMode eOpMode.Mode0

Current state of the OP mode selector

sTitleM0 STRING ‘Automatik’

Description of the automatic mode

sTitleM1 STRING ‘Hand Aus’

Description of the manual off mode

sTitleM2 STRING ‘Hand 1’

Description of the manual mode 1

sTitleM3 STRING ‘Hand 2’

Description of the manual mode 2

sTitleM4 STRING ‘Hand 3’

Description of the manual mode 3

sTitleM5 STRING ‘Hand 4’

Description of the manual mode 4

Output xActive BOOL  

Output variable in automatic mode

xAutoM0 BOOL  

Operating mode display in automatic mode

xManOffM1 BOOL  

Operating mode display in manual off mode

xManM2 BOOL  

Operating mode display in manual mode 1

xManM3 BOOL  

Operating mode display in manual mode 2

xManM4 BOOL  

Operating mode display in manual mode 3

xManM5 BOOL  

Operating mode display in manual mode 4

xActMode STRING  

Name of the current operating mode (e.g. ‘Automatic’)