Y_PK_PackML_State_Diagram
The PackML_State_Diagram function block handles the operation of the state machine, including mode and state transitions, as defined in the OMAC PackML specification. This function block, when first enabled, initializes the machine to be in mode 3 (Manual Mode) and in the Stopped state.
Parameters
| * | Parameter | Data Type | Description | Default |
|---|---|---|---|---|
| VAR_IN_OUT | ||||
| V | Cfg_ModeNames | Yt_StringArray32 | An array of strings containing the names of the different Unit modes of operation | |
| V | Cfg_ModeTransitions | Yt_DintArray32 | An array of acceptable mode transition states. Mode changes into the NEW MODE can only be performed at the chosen states. Each element in the array represents a mode, and each bit in the array element represents a state. (Ex. To allow Mode Transitions for Mode 1 at Aborted (bit 9), Stopped (bit 2), and Idle (bit 4) states 0000 0000 0000 0000 0000 0010 0001 0100 = 16#0000_0214 = DINT#532 = Cfg_ModeTransitions[1] ) | |
| V | Cfg_StateNames | Yt_StringArray18 | An array of strings containing the names of all the PackML states | |
| V | Cfg_DisableStates | Yt_DintArray32 | An array representing each mode and their states. Each mode can disable certain states.(Ex In Manual Mode (Mode 3) disable Holding(10), Held(11), UnHolding(12), Suspended(5), Suspending(13), UnSuspending(14),Completing(16), Complete(17) = 0000 0000 0000 0011 0111 1100 0010 0000 = 16#0003_7C20 = DINT#228384 = Cfg_DisableStates[3]) | |
| V | UnitMachine | Yt_PK_UNitmachine_STRUCT | Structure containing all the information about the machines current state of operation for all EMs and CMs | |
| VAR_INPUT | ||||
| B | EnableIn | BOOL | The function will continue to execute while the enable is held high. | FALSE |
| B | Cmd_Mode | DINT | The value of the new mode the machine will transition to if possible. If the input remains unchanged, the machine will stay in the same mode of operation | 0 |
| B | Cmd_Reset | BOOL | Setting this bit sends the ‘Reset’ command to all enabled and active EMs if it is a legal transition from the current machine state, otherwise the command will be ignored | FALSE |
| B | Cmd_Start | BOOL | Setting this bit sends the ‘Start’ command to all enabled and active EMs if it is a legal transition from the current machine state, otherwise the command will be ignored | FALSE |
| B | Cmd_Stop | BOOL | Setting this bit sends the ‘Stop’ command to all enabled and active EMs if it is a legal transition from the current machine state, otherwise the command will be ignored | FALSE |
| B | Cmd_Hold | BOOL | Setting this bit sends the ‘Hold’ command to all enabled and active EMs if it is a legal transition from the current machine state, otherwise the command will be ignored | FALSE |
| B | Cmd_UnHold | BOOL | Setting this bit sends the ‘UnHold’ command to all enabled and active EMs if it is a legal transition from the current machine state, otherwise the command will be ignored | FALSE |
| B | Cmd_Suspend | BOOL | Setting this bit sends the ‘Suspend’ command to all enabled and active EMs if it is a legal transition from the current machine state, otherwise the command will be ignored | FALSE |
| B | Cmd_UnSuspend | BOOL | Setting this bit sends the ‘UnSuspend’ command to all enabled and active EMs if it is a legal transition from the current machine state, otherwise the command will be ignored | FALSE |
| B | Cmd_Abort | BOOL | Setting this bit sends the ‘Abort’ command to all enabled and active EMs if it is a legal transition from the current machine state, otherwise the command will be ignored | FALSE |
| B | Cmd_Clear | BOOL | Setting this bit sends the ‘Clear’ command to all enabled and active EMs if it is a legal transition from the current machine state, otherwise the command will be ignored | FALSE |
| B | Cmd_Complete | BOOL | Setting this bit sends the ‘Complete’ command to all enabled and active EMs if it is a legal transition from the current machine state, otherwise the command will be ignored | FALSE |
| V | Cfg_RemoteModeCmd | DINT | The remotely requested mode number | 0 |
| B | Inp_RemoteModeCmd ChangeReq | BOOL | When this input is set, the machine will transition to the mode set by Cfg_RemoteModeCmd if it is a legal transition from the current state of the machine | FALSE |
| V | Inp_RemoteStateCmd | DINT | The remotely requested state number | 0 |
| B | Inp_RemoteStateCmd ChangeReq | BOOL | When this input is set, the machine will transition to the state set by Cfg_RemoteStateCmd if it is a legal transition from the current state of the machine | FALSE |
| VAR_OUTPUT | ||||
| B | EnableOut | BOOL | Indicates that the outputs of the function are valid | |
| B | Clearing | BOOL | When this bit is set, the machine is in the ‘Clearing’ state | |
| B | Stopped | BOOL | When this bit is set, the machine is in the ‘Stopped’ state | |
| B | Starting | BOOL | When this bit is set, the machine is in the ‘Starting’ state | |
| B | Idle | BOOL | When this bit is set, the machine is in the ‘Idle’ state | |
| B | Suspended | BOOL | When this bit is set, the machine is in the ‘Suspended’ state | |
| B | Execute | BOOL | When this bit is set, the machine is in the ‘Execute’ state | |
| B | Stopping | BOOL | When this bit is set, the machine is in the ‘Stopping’ state | |
| B | Aborting | BOOL | When this bit is set, the machine is in the ‘Aborting’ state | |
| B | Aborted | BOOL | When this bit is set, the machine is in the ‘Aborted’ state | |
| B | Holding | BOOL | When this bit is set, the machine is in the ‘Holding’ state | |
| B | Held | BOOL | When this bit is set, the machine is in the ‘Held’ state | |
| B | UnHolding | BOOL | When this bit is set, the machine is in the ‘UnHolding’ state | |
| B | Suspending | BOOL | When this bit is set, the machine is in the ‘Suspending’ state | |
| B | UnSuspending | BOOL | When this bit is set, the machine is in the ‘UnSuspending’ state | |
| B | Resetting | BOOL | When this bit is set, the machine is in the ‘Resetting’ state | |
| B | Completing | BOOL | When this bit is set, the machine is in the ‘Completing’ state | |
| B | Complete | BOOL | When this bit is set, the machine is in the ‘Complete’ state | |
| B | ModeChangeNotAllowed | BOOL | When this bit is set, the requested Mode change isn’t allowed and the machine will remain in the current mode and state. | |
| V | Sts_StateCurrent | DINT | Number in decimal corresponding to the current state of the machine | |
| V | Sts_StateCurrentName | STRING | The name of the current state of the machine | |
| V | Sts_StateCurrentBits | DWORD | DWORD indicating the current state the machine is in (Ex. If Sts_StateCurrentBits[x] = 1, then the machine is in State x) | |
| V | Sts_ModeCurrent | DINT | Number in decimal corresponding to the current mode of the machine | |
| V | Sts_ModeCurrentName | STRING | The name of the current mode of the machine | |
| V | Sts_ModeCurrentBits | DWORD | DWORD indicating the current mode of the machine (Ex. If Sts_ModeCurrentBits[x] = 1, then the machine is in Mode x) | |
Notes
- Should always be enabled when program is running to ensure proper operation of the state machine.
Error Description:
See the
Function Block ErrorID List.