7.17 ReadySubstateMachineType

The ReadySubstateMachineType represents the condition of a program loaded into a task control (TaskControlStateMachine is in Ready State). The state machine has two states to distinguish whether the program pointer is at an initial program position (AtProgramStart) or anywhere else in the program (Suspended). It provides the information whether the program pointer is at the start or in the middle of the program. The method ResetToProgramStart can be used to set the program pointer to the start of the program. The state after entering this state machine depends on the program pointer position.

The TaskControlReadyMonitor ConformanceUnit defines monitoring of the ReadySubstateMachine. The TaskControlReadyReinitalize ConformanceUnit defines additionally the reinitialization of the program by a method.

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

Figure 31 – ReadySubstateMachine

7.17.1 Overview

Figure 32 – ReadySubstateMachineType Overview

The ReadySubstateMachineType is formally defined in Table 104.

Table 104 – ReadySubstateMachineType Definition

Attribute Value
BrowseNameReadySubstateMachineType
IsAbstractFalse
References Node Class BrowseName DataType TypeDefinition Other
Subtype of the FiniteStateMachineType defined in OPC 1000-5
0:HasComponentVariable LastTransitionReason0:Int160:MultiStateValueDiscreteTypeM
0:HasComponentObjectAtProgramStart0:StateType
0:HasComponentObjectSuspended0:StateType
0:HasComponentObjectProgramStartToSuspended0:TransitionType
0:HasComponentObjectSuspendedToProgramStart0:TransitionType
0:HasComponentMethodResetToProgramStartO
Inherited from FiniteStateMachineType
0:HasComponentVariableLastTransition0:LocalizedText0:FiniteTransitionVariableTypeM
0:GeneratesEventObjectTypeTransitionEventTypeO
ConformanceUnits
Rob Task Control ReadySubstate
Rob Task Control Ready Reset

The Variable LastTransitionReason provides the reason for the LastTransition. The EnumValue and ValueAsText of this 0:MultiStateValueDiscreteType are described in .

Table 105 – ReadySubstateMachineType 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"}

]

The states of the ReadySubstateMachineType are described in Table 106.

Table 106 – ReadySubstateMachineType State Descriptions

StateName Description
AtProgramStartThe program pointer of the program loaded in the task control is at the starting point.
SuspendedThe program pointer of the program loaded in the task control is anywhere in the program, but not at starting point.

The components of the ReadySubstateMachineType have additional references which are defined in Table 107.

Table 107 Table 107 – ReadySubstateMachineType Additional References
SourceBrowsePath Reference Type Is Forward TargetBrowsePath
ProgramStartToSuspended0:FromStateTrueAtProgramStart
0:ToStateTrueSuspended
0:HasEffectTrueTransitionEventType
SuspendedToProgramStart0:FromStateTrueSuspended
0:ToStateTrueAtProgramStart
0:HasEffectTrueTransitionEventType
0:HasCauseTrueResetToProgramStart

The transitions are described in Table 108 – ReadySubstateMachineType Transition Descriptions.

Table 108 – ReadySubstateMachineType Transition Descriptions

TransitionName Description
ProgramStartToSuspendedChanges from AtProgramStart to Suspended.
SuspendedToProgramStartChanges from Suspended to AtProgramStart because program was restarted. (Direct, External, System)

The component Variables of the ReadySubstateMachineType have additional Attributes defined in Table 109.

Table 109 Table 109 – ReadySubstateMachineType Attribute values for child Nodes
BrowsePath Value Attribute
1
2
1
2

7.17.2 ResetToProgramStart Method

The signature of this Method is specified below.

Signature

	
	ResetToProgramStart  (
		[out]	0:Int32	Status
	);

Table 92 specifies the Arguments.

Table 92 – ResetToProgramStart Method Arguments
Argument Description
Status

0 – OK – Everything is OK

1 – E_SystemState – The system is not in correct state for this operation

2 – E_UnexpectedError – Unexpected Error during the method call

3 – E_ActiveAlarm – An Active Alarm prevents the system start

4 – E_AcknowledgeRequired – Condition needs to be acknowledged

<0 – shall be used for vendor-specific errors.

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

The ResetToProgramStart Method is called by a Client to set the program pointer to the starting point of the program.

The possible Method result codes are formally defined in the table below.

Table 93 – 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 ResetToProgramStart Method representation in the AddressSpace is formally defined in Table 94.

Table 94 – ResetToProgramStart Method AddressSpace definition
Attribute Value
BrowseNameResetToProgramStart
References NodeClass BrowseName DataType TypeDefinition ModellingRule
0:HasPropertyVariable0:OutputArguments0:Argument[]0:PropertyTypeM
ConformanceUnits
Task Control Ready Reset