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.4 Incorporating state functions motion task, ...<br />
The user must incorporate the various functions (motion control, logic, …) of the individual states into<br />
the case structure of the OmacMain program.<br />
The user has various ways of doing this. Three possibilities will be now described in more detail.<br />
2.2.4.1 Using state functions<br />
The first way of incorporating motion control and logic functions is to use functions that are cyclically<br />
called in the case structure in the relevant branch (refer to the diagram).<br />
Fig. 4: Calling a state function<br />
The procedure is precisely the same as in the original OMAC version. In this case, the difference is<br />
that no state functions are entered in the form of empty ST functions. The advantage is that users are<br />
no longer tied down to a particular programming language (ST). All of the programming languages that<br />
<strong>Simotion</strong> supports can now be used (ST, MCC, LAD, FBD).<br />
It is also possible to mix programming languages. For instance, the MANUAL state can be<br />
programmed in MCC and the AUTOMATIC_STOPPED state in ST.<br />
If all of the state functions are used, then these should contain, as return value, the data type of the<br />
enum for the machine states (EnumStates).<br />
If a state change is not made within the function, then the actual state should be cyclically assigned to<br />
it as it loses its last value at each call.<br />
If a state change is made, then the function must be assigned the new state.<br />
Example: A state function is used for the AUTOMATIC_READY state that is cyclically called from the<br />
OmacMain program.<br />
If the state is not to be changed, then the function is cyclically assigned the current state �<br />
FCAutomaticReady := OM_AutomaticReady.<br />
If the state should change to AUTOMATIC_STANDBY, the function is assigned the new state �<br />
FCAutomaticReady := OM_AutomaticStandby.<br />
The actual state change itself is initiated after the state function is called by assigning the return value<br />
to the variable g_eNewState � g_eNewState := FCAutomaticReady.<br />
Version Date Page Document<br />
<strong>V3.0</strong> <strong>15.11.04</strong> 22 <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