Simotion Easy Basics (SEB) 15.11.04 V3.0 User ... - Home
Simotion Easy Basics (SEB) 15.11.04 V3.0 User ... - Home
Simotion Easy Basics (SEB) 15.11.04 V3.0 User ... - Home
Create successful ePaper yourself
Turn your PDF publications into a flip-book with our unique Google optimized e-Paper software.
<strong>Simotion</strong> <strong>Easy</strong> <strong>Basics</strong> reviewed<br />
2.2.3 Structure of the OMAC – mode manager<br />
The mode manager comprises a total of three units (OmacVar, OmacStUp and OmacMain), that<br />
contain the variable declarations and two programs. One program is used to initialize all of the<br />
relevant variables when the controller runs-up - the second program contains the actual mode<br />
manager and runs cyclically in the BackgroundTask.<br />
As far as the program is concerned, when implementing, a differentiation is not made between the<br />
various modes (manual, automatic, ...) and states (stopped, producing, ...). This is the reason that in<br />
the following text, only the term state is used.<br />
The change between the individual states is realized by setting a global variable.<br />
2.2.3.1 OmacVar unit<br />
The OmacVar unit includes the declaration of all of the type definitions and global variables of the<br />
mode manager.<br />
The EnumStates enum includes all of the states according to the OMAC definition.<br />
To display the actual machine states, there is on one hand, the g_eActualState variable, type<br />
EnumStates - and on the other hand, thirteen boolean variables that are precisely assigned to one<br />
state. If the machine is, for example, in the Manual state, then the g_eActualState variable has the<br />
value OM_Manual and the g_boOM_Manual variable is TRUE.<br />
Further, a diagnostics array is declared (g_asDiagnosticsArray) that logs a history of the state<br />
transitions with an associated time stamp. The DIAG_ARRAY_MAX_ELEMENT constant can be used<br />
to define the size of the diagnostics array.<br />
All of the variables that start with the "PML_" prefix belong to the operating data that are defined<br />
according to the OMAC Tag Naming Guidelines. Some of these variables are declared as retain<br />
variables - in order to ensure that values are retained even after the power supply has been powereddown.<br />
A detailed description of these operating data is provided in Chapter 2.2.5.<br />
2.2.3.2 OmacStUp unit<br />
The program in this unit is used to initialize all of the variables of the mode manager. It is assigned to<br />
the StartUp task and is executed at when the controller transitions from stop to run.<br />
In this program, the output state of the machine is pre-assigned the ESTOP state by setting the<br />
eLocalActState variables. This ensures that after being powered-up, the machine is in a safe, defined<br />
output state. Further, the elements of the diagnostics array g_asDiagnosticsArray are initialized with<br />
the values "OM_NoState" or "DT#0001-01-01-0:0:0.0".<br />
Operating data is also initialized according to OMAC, that is not declared as retain data.<br />
Version Date Page Document<br />
<strong>V3.0</strong> <strong>15.11.04</strong> 20 <strong>User</strong> documentation<br />
Copyright © Siemens AG 2003 All Rights Reserved For internal Use Only<br />
<strong>User</strong>_Manual_<strong>Simotion</strong>_<strong>Easy</strong>_<strong>Basics</strong>_V3_0.doc