5 Model ToC Previous Next

5.2 ProgramStateMachineType ToC Previous Next

5.2.3 ProgramStateMachineType components ToC Previous Next

5.2.3.1 Overview ToC

The ProgramStateMachineType components consist of a set of References to the Object instances of StateTypes, TransitionTypes, EventTypes and the Methods that collectively define the Program FiniteStateMachine.

readme_files/image008.png

Figure 5 – Program FSM References

Figure 5 illustrates the component References that define the associations between two of the ProgramStateMachineType’s states, Ready and Running. The complementary ReferenceTypes have been omitted to simplify the illustration.

5.2.3.2 ProgramStateMachineType states ToC

Table 6 specifies the ProgramStateMachineType’s state Objects. These Objects are instances of the StateType defined in OPC 10000-5, Annex B. Each state is assigned a unique StateNumber value. Subtypes of the ProgramStateMachineType can add references from any state to a subordinate or nested StateMachine Object to extend the FiniteStateMachine.

Table 6 – Program states

BrowseName References Target BrowseName Value Target TypeDefinition NOTES
States          
Halted HasProperty StateNumber 11 PropertyType  
  ToTransition HaltedToReady   TransitionType  
  FromTransition RunningToHalted   TransitionType  
  FromTransition SuspendedToHalted   TransitionType  
  FromTransition ReadyToHalted   TransitionType  
           
Ready HasProperty StateNumber 12 PropertyType  
  FromTransition HaltedToReady   TransitionType  
  ToTransition ReadyToRunning   TransitionType  
  FromTransition RunningToReady   TransitionType  
  ToTransition ReadyToHalted   TransitionType  
           
Running HasProperty StateNumber 13 PropertyType  
  ToTransition RunningToHalted   TransitionType  
  ToTransition RunningToReady   TransitionType  
  ToTransition RunningToSuspended   TransitionType  
  FromTransition ReadyToRunning   TransitionType  
  FromTransition SuspendedToRunning   TransitionType  
           
Suspended HasProperty StateNumber 14 PropertyType  
  ToTransition SuspendedToRunning   TransitionType  
  ToTransition SuspendedToHalted   TransitionType  
  ToTransition SuspendedToReady   TransitionType  
  FromTransition RunningToSuspended   TransitionType  

The Halted state is the idle state for a Program. It can be an initial state or a terminal state. As an initial state, the Program Invocation cannot begin execution due to conditions at the Server. As a terminal state, Halted can indicate either a failed or completed Program. A subordinate state or result can be used to distinguish the nature of the termination. The Halted state references four Transition Objects, which identify the allowed state transitions to the Ready state and from the Ready, Running, and Suspended states.

The Ready state indicates that the Program is prepared to begin execution. Programs that are ready to begin upon their creation may transition immediately to the Ready state. The Ready state references four Transition Objects, which identify the allowed state transitions to the Running and Halted states and from the Halted and Ready states.

The Running state indicates that the Program is actively performing its Function. The Running state references five Transition Objects, which identify the allowed state transitions to the Halted, Ready, and Suspended states and from the Ready and Suspended states.

The Suspended state indicates that the Program has stopped performing its Function, but retains the ability to resume the Function at the point at which it was executing when suspended. The Suspended state references four Transition Objects, which identify the allowed state transitions to the Ready, Running, and Halted state and from the Ready state.

5.2.3.3 ProgramStateMachineType transitions ToC

ProgramStateMachineType Transitions are instances of the TransitionType defined in OPC 10000-5 which also includes the definitions of the ToState, FromState, HasCause, and HasEffect references used. Table 7 specifies the transitions defined for the ProgramStateMachineType. Each transition is assigned a unique TransitionNumber. The Notes column indicates when a cause is referencing Methods and when effects are optional.

Table 7 – Program transitions

BrowseName References Target BrowseName Value Target TypeDefinition Notes
Transitions          
HaltedToReady HasProperty TransitionNumber 1 PropertyType  
  ToState Ready   StateType  
  FromState Halted   StateType  
  HasCause Reset     Method
  HasEffect ProgramTransitionEventType      
  HasEffect AuditProgramTransitionEventType      
           
ReadyToRunning HasProperty TransitionNumber 2 PropertyType  
  ToState Running   StateType  
  FromState Ready   StateType  
  HasCause Start     Method
  HasEffect ProgramTransitionEventType      
  HasEffect AuditProgramTransitionEventType      
           
RunningToHalted HasProperty TransitionNumber 3 PropertyType  
  ToState Halted   StateType  
  FromState Running   StateType  
  HasCause Halt     Method
  HasEffect ProgramTransitionEventType      
  HasEffect AuditProgramTransitionEventType      
           
RunningToReady HasProperty TransitionNumber 4 PropertyType  
  ToState Ready   StateType  
  FromState Runnning   StateType  
  HasEffect ProgramTransitionEventType      
  HasEffect AuditProgramTransitionEventType      
           
RunningToSuspended HasProperty TransitionNumber 5 PropertyType  
  ToState Running   StateType  
  FromState Suspended   StateType  
  HasCause Suspend     Method
  HasEffect ProgramTransitionEventType      
  HasEffect AuditProgramTransitionEventType      
           
SuspendedToRunning HasProperty TransitionNumber 6 PropertyType  
  ToState Running   StateType  
  FromState Suspended   StateType  
  HasCause Resume     Method
  HasEffect ProgramTransitionEventType      
  HasEffect AuditProgramTransitionEventType      
           
SuspendedToHalted HasProperty TransitionNumber 7 PropertyType  
  ToState Halted   StateType  
  FromState Suspended   StateType  
  HasCause Halt     Method
  HasEffect ProgramTransitionEventType      
  HasEffect AuditProgramTransitionEventType      
           
SuspendedToReady HasProperty TransitionNumber 8 PropertyType  
  ToState Ready   StateType  
  FromState Suspended   StateType  
  HasCause Reset     Method
  HasEffect ProgramTransitionEventType      
  HasEffect AuditProgramTransitionEventType      
           
ReadyToHalted HasProperty TransitionNumber 9 PropertyType  
  ToState Halted   StateType  
  FromState Ready   StateType  
  HasCause Halt     Method
  HasEffect ProgramTransitionEventType      
  HasEffect AuditProgramTransitionEventType      

The HaltedToReady transition specifies the transition from the Halted to Ready states. It may be caused by the Reset Method.

The ReadyToRunning transition specifies the transition from the Ready to Running states. It is caused by the Start Method.

The RunningToHalted transition specifies the transition from the Running to Halted states. It is caused by the Halt Method.

The RunningToReady transition specifies the transition from the Running to Ready states. The RunningToSuspended transition specifies the Transition from the Running to Suspended states. It is caused by the Suspend Method.

The SuspendedToRunning transition specifies the transition from the Suspended to Running states. It is caused by the Resume Method.

The SuspendedToHalted transition specifies the transition from the Suspended to Halted states. It is caused by the Halt Method.

The SuspendedToReady transition specifies the transition from the Suspended to Ready states. It is caused internally.

The ReadyToHalted transition specifies the transition from the Ready to Halted states. It is caused by the Halt Method.

Two HasEffect references are specified for each Program transition. These effects are Events of ProgramTransitionEventType and AuditProgramTransitionEventType defined in 5.2.5. The ProgramTransitionEventType notifies Clients of the Program transition and conveys result data. The AuditProgramTransitionEventType is used to audit transitions that result from Program Control Methods. The “Audit Server FacetProfile defined in OPC 10000-7 requires support of the AuditProgramTransitionEventType.

readme_files/image009.png

Figure 6 – ProgramStateMachineType causes and effects

Previous Next