6 stater machine: query examples, Stater machine: query examples – Lenze ApplicationTemplate PackML (PLC Designer R3-x) User Manual
Page 73

Lenze · ApplicationTemplate PackML · 1.0 EN - 05/2014
73
Architecture: The ApplicationTemplate PackML in detail
Stater machine: Query examples
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
• As long as a state of a slave module has xStateBusy= TRUE , the changeover of the state machine
is prevented. An exception is the triggering of the commands "Abort" or "Stop".
By default, the module is set to the respective state with the command in the first cycle of state
.
If all tasks are done in this state, xStateBusy can be reset again to enable the changeover to
another state.
The following program line enquires the state:
"xAllOrSlaves:=TRUE" also enquires the own module, "xAllOrSlaves:=FALSE only the slaves of the
module.
9.6
Stater machine: Query examples
This section shows (by the use of program examples) how...
• ...to access the state machine.
• ...to query the states.
Command_StateBusy(xStateBusy:= TRUE)
Status_StateBusy(xAllOrSlaves:=TRUE)
Objective/call
Example
Querying the current state
• IF condition
• Subordinated module status
enquiry by method
(example: Slave, address = 1)
IF Status_UnitStateCurrent (MM_Address:= 1)=
L_EATP_States_PackML.Execute THEN
// Do something if Statemachine is in state EXECUTE
END_IF