7.10 OperationStateMachineType Definition

The OperationStateMachineType provides an abstract state machine for operation. The state machine can be used for entities whose states can be represented by Idle, Ready or Executing and which can be started and stopped.

At the system and task control levels, concrete state machine types are derived from the OperationStateMachineType. The states of these state machines can be further enhanced with Substate machines.

The overview of the state machine with all transitions is shown in Figure 19.

Figure 19 – OperationStateMachine.
Figure 20 – The OperationStateMachineType

Figure 20 shows the OPC UA representation of the OperationStateMachineType, the transitions between the states have not been shown for the sake of simplicity. The OperationStateMachineType is formally defined in Table 65.

Table 27 – OperationStateMachineType Definition
Attribute Value
BrowseNameOperationStateMachineType
IsAbstractTrue
References Node Class BrowseName DataType TypeDefinition Other
Subtype of the FiniteStateMachineType defined in OPC 10000-5.
0:HasComponentVariable LastTransitionReason0:Int160:MultiStateValueDiscreteTypeM
0:HasComponentVariable PossibleStopModes0:EnumValueType[]0:BaseDataVariableTypeO
0:HasComponentVariable ConfiguredDefaultStopMode0:Int160:BaseDataVariableTypeO
0:HasComponentObjectIdle0:StateType
0:HasComponentObjectReady0:StateType
0:HasComponentObjectExecuting0:StateType
0:HasComponentObjectReadyToIdle0:TransitionType
0:HasComponentObjectIdleToReady0:TransitionType
0:HasComponentObjectExecutingToReady0:TransitionType
0:HasComponentObjectReadyToExecuting0:TransitionType
0:HasComponentObjectExecutingToIdle0:TransitionType
0:HasComponentObjectIdleToIdle0:TransitionType
0:HasComponentMethodStart O
0:HasComponentMethodStopO
Inherited from FiniteStateMachineType
0:HasComponentVariableLastTransition0:LocalizedText0:FiniteTransitionVariableTypeM
0:GeneratesEventObjectTypeTransitionEventTypeO

The states of the OperationStateMachineType are described in Table 28.

The component Variables of the OperationStateMachineType have additional Attributes defined in Table 30.

Table 28 – OperationStateMachineType State Descriptions
StateName Description
IdleEntity is not in a condition to start execution.
ReadyEntity is in a condition to start execution.
ExecutingEntity is in a condition of execution.

The Variable LastTransitionReason provides the reason for the LastTransition. The EnumValue and ValueAsText of this 0:MultiStateValueDiscreteType are described in Table 29. This specification does not define an explicit error state. The LastTransitionReason indicates if a state change was caused due to an error.

Table 29 – Values for LastTransitionReason
EnumValue ValueAsText Description
0UnknownCaused by an unknown reason
1External Caused by external operation
2DirectCaused by direct operation
3System Caused by system specific behaviour
4Error Caused by an error
5ApplicationCaused explicitly by end user program logic

The component Variables of the OperationStateMachineType have additional Attributes defined in Table 30.

Table 30 – OperationStateMachineType Attribute values for child nodes
BrowsePath Value Attribute Description Attribute

[

{"Value":0,"DisplayName":"Unknown","Description":"Caused by an unknown reason"},

{"Value":1,"DisplayName":"External","Description":"Caused by external operation"},

{"Value":2,"DisplayName":"Direct","Description":"Caused by direct operation"},

{"Value":3,"DisplayName":"System","Description":"Caused by system specific behavior"},

{"Value":4,"DisplayName":"Error", "Description": "Caused by an error"},

{"Value":5,"DisplayName":"Application","Description":"Caused explicitly by end user program logic"}

]

LastTransitionReason EnumValues 1 and 2 describe where an operation was initiated, which reasoned the last transition. External means that the operation was initiated by a control station, which is not part of the robot system, e.g a cell PLC. Direct means that the operation was initiated by a control station, which is part of the robot system, e.g. the teach pendant.

The Variable PossibleStopModes is an array of EnumValueType, which contains a list of supported stop modes (see Table 31).

Table 31 – PossibleStopMode Array Values
Nr. Stop Mode Description
1OnPathStop program execution in a controlled manner along the programmed path.
2EndOfCycleStop program execution when the current production cycle has been finished.
3ProcessStopApplication dependent stop instruction that stops program execution at a "favourable" point for the application, e.g. at the end of a paint stroke or sealing bead.
4QuickStopThis stop is performed by ramping down motion as fast as possible using optimum motor performance. The robot may not stay on the path.
5EndOfInstructionThis stop can be used to stop the program execution when the current instruction is completed.
>=1000Reserved for other OPC UA Companion Specifications
>=2000Used for vendor specific stop modes
Table 32 – OperationStateMachineType Attribute values for child nodes
BrowsePath Value Attribute Description Attribute
PossibleStopModes

[

{"Value": 1, "DisplayName": "OnPath", "Description": "Stop program execution in a controlled manner along the programmed path"},

{"Value": 2, "DisplayName": "EndOfCycle", "Description": "Stop program execution when the current production cycle has been finished"},

{"Value": 3, "DisplayName": "ProcessStop", "Description": "Application dependent stop instruction that stops program execution at a favourable point for the application, e.g. at the end of a paint stroke or sealing bead"},

{"Value": 4, "DisplayName": "QuickStop", "Description": "This stop is performed by ramping down motion as fast as possible using optimum motor performance. The robot may not stay on the path”},

{"Value": 5, "DisplayName": "EndOfInstruction", "Description": "This stop can be used to stop the program execution when the current instruction is completed"}

]

The Variable ConfiguredDefaultStopMode is an integer, which contains the value of the configured stop mode for this system. This shall be one of the values in the PossibleStopModes array.

The Variable LastTransition, inherited from the FiniteStateMachineType, is defined as mandatory in the OperationStateMachineType.

The transitions of the OperationStateMachineType are described in Table 33.

Table 33 – OperationStateMachineType Transition Descriptions
TransitionName Description
IdleToReadyChanges from Idle to Ready.
IdleToIdleChanges from Idle to Idle.
ReadyToIdleChanges from Ready to Idle.
ReadyToExecutingChanges from Ready to Executing.
ExecutingToReadyChanges from Executing to Ready.
ExecutingToIdleChanges from Executing to Idle.

The components of the OperationStateMachineType have additional references which are defined in Table 69.

Table 34 – OperationStateMachineType Additional References
SourceBrowsePath Reference Type Is Forward TargetBrowsePath
IdleToIdle0:FromStateTrueIdle
0:ToStateTrueIdle
0:HasEffectTrueTransitionEventType
IdleToReady0:FromStateTrueIdle
0:ToStateTrueReady
0:HasEffectTrueTransitionEventType
ReadyToIdle0:FromStateTrueReady
0:ToStateTrueIdle
0:HasEffectTrueTransitionEventType
ReadyToExecuting0:FromStateTrueReady
0:ToStateTrueExecuting
0:HasCauseTrueStart
0:HasEffectTrueTransitionEventType
ExecutingToReady0:FromStateTrueExecuting
0:ToStateTrueReady
0:HasCauseTrueStop
0:HasEffectTrueTransitionEventType
ExecutingToIdle0:FromStateTrueExecuting
0:ToStateTrueIdle
0:HasEffectTrueTransitionEventType

The component Variables of the OperationStateMachine have additional Attributes defined in the table below.

Table 35 – OperationStateMachineType Attribute values for child Nodes
BrowsePath Value Attribute
1
2
3
1
2
3
4
5
6

7.10.1 Start Method

The signature of this Method is specified below.

Signature

	Start (
	[out]	0:Int32	Status
	);

The Start Method is called by a Client to start execution of the entity which is represented by the state machine.

Table 36 – Start Method Arguments
Argument Description
Status

0 – OK

Values > 0 are reserved for errors defined by this and future standards.

Values < 0 shall be used for application-specific errors.

The possible Method result codes are formally defined in Table 37.

Table 37 – Method Result Codes (defined in Call Service)
Result Code Description
GoodThe operation succeeded
Bad_InternalErrorThe operation failed because of an internal error
Bad_ResourceUnavailableThe Method cannot be executed because a required resource is locked.
Bad_UserAccessDeniedThe caller is not allowed to execute this Method.

The Start Method representation in the AddressSpace is formally defined in table below.

Table 38 – Start Method AddressSpace definition.
Attribute Value
BrowseNameStart
References NodeClass BrowseName DataType TypeDefinition ModellingRule
0:HasPropertyVariable0:OutputArguments0:Argument[] 0:PropertyType0:Mandatory

7.10.2 Stop Method

The signature of this Method is specified below.

Signature

	Stop (
	[in]	0:Int64 	StopMode
	[out]	0:Int32	Status
	);

The Stop Method is called by a Client to stop execution of the entity which is represented by the state machine.

Table 39 – Stop Method Arguments
Argument Description
StopModeprovides a way to differentiate between different stop modes. This parameter should correspond to one of the values in the PossibleStopModes array.
Status

0 – OK

Values > 0 are reserved for errors defined by this and future standards.

Values < 0 shall be used for application-specific errors.

The possible Method result codes are formally defined in Table 40.

Table 40 – Method Result Codes (defined in Call Service)
Result Code Description
GoodThe operation succeeded
Bad_InternalErrorThe operation failed because of an internal error
Bad_ResourceUnavailableThe Method is locked by another Client/Clientgroup
Bad_UserAccessDeniedThe caller is not allowed to call this Method.

The Stop Method representation in the AddressSpace is formally defined in the table below.

Table 41 – Stop Method AddressSpace definition.
Attribute Value
BrowseNameStop
References NodeClass BrowseName DataType TypeDefinition Others
0:HasPropertyVariable0:InputArguments0:Argument[]0:PropertyTypeM
0:HasPropertyVariable0:OutputArguments0:Argument[]0:PropertyTypeM