8 Software update model ToC Previous Next

8.4 ObjectTypes ToC Previous Next

8.4.8 PrepareForUpdateStateMachineType ToC Previous Next

8.4.8.1 Overview ToC Model

The PrepareForUpdateStateMachineType may be used if the device requires to be prepared before the update. Another option is to delay the resuming of normal operation until all update actions are executed. This supports to prepare for update option of 8.3.4.2.

If a Server implements this state machine, a Client shall use it except if the UpdateBehavior indicates that this is not necessary for the transferred software. If preparation is required, the installation is only allowed if the PrepareForUpdateStateMachine is in the PreparedForUpdate state.

The state machine is illustrated in Figure 47, Figure 48 and formally defined in Table 74. The transitions are formally defined in Table 76.

readme_files/image049.png Figure 47 – PrepareForUpdate state machine

readme_files/image050.png Figure 48 – PrepareForUpdateStateMachineType

Table 74 – PrepareForUpdateStateMachineType definition

Attribute Value        
BrowseName PrepareForUpdateStateMachineType        
IsAbstract False        
References Node Class BrowseName DataType TypeDefinition Modelling Rule
Subtype of the FiniteStateMachineType defined in OPC 10000-5.          
HasComponent Variable PercentComplete Byte BaseDataVariableType Optional
HasComponent Method Prepare     Mandatory
HasComponent Method Abort     Mandatory
HasComponent Method Resume     Optional
HasComponent Object Idle   InitialStateType  
HasComponent Object Preparing   StateType  
HasComponent Object PreparedForUpdate   StateType  
HasComponent Object Resuming   StateType  
HasComponent Object IdleToPreparing   TransitionType  
HasComponent Object PreparingToIdle   TransitionType  
HasComponent Object PreparingToPreparedForUpdate   TransitionType  
HasComponent Object PreparedForUpdateToResuming   TransitionType  
HasComponent Object ResumingToIdle   TransitionType  
Conformance Units          
DI SU PrepareForUpdate          

The component Variables of the PrepareForUpdateStateMachineType have additional Attributes defined in Table 75.

Table 75 – PrepareForUpdateStateMachineType Attribute values for child Nodes

BrowsePath Value Attribute
   Idle
   0:StateNumber
1
   Preparing
   0:StateNumber
2
   PreparedForUpdate
   0:StateNumber
3
   Resuming
   0:StateNumber
4
   IdleToPreparing
   0:TransitionNumber
12
   PreparingToIdle
   0:TransitionNumber
21
   PreparingToPreparedForUpdate
   0:TransitionNumber
23
   PreparedForUpdateToResuming
   0:TransitionNumber
34
   ResumingToIdle
   0:TransitionNumber
41

Table 76 – PrepareForUpdateStateMachineType Additional References

SourceBrowsePath Reference Type Is Forward TargetBrowsePath
       
Transitions      
IdleToPreparing FromState True Idle
  ToState True Preparing
  HasEffect True TransitionEventType
PreparingToIdle FromState True Preparing
  ToState True Idle
  HasEffect True TransitionEventType
PreparingToPreparedForUpdate FromState True Preparing
  ToState True PreparedForUpdate
  HasEffect True TransitionEventType
PreparedForUpdateToResuming FromState True PreparedForUpdate
  ToState True Resuming
  HasEffect True TransitionEventType
ResumingToIdle FromState True Resuming
  ToState True Idle
  HasEffect True TransitionEventType

8.4.8.2 PercentComplete ToC

This percentage is a number between 0 and 100 that informs about the progress in the Preparing or the Resuming States. It may be used whenever the activity takes longer and the user should be informed about the completion. If the state machine is in Idle or PreparedForUpdate State it shall have the value 0.

Note: This information is for the user only. It shall not be used to detect completion of the transition.

8.4.8.3 Prepare Method ToC

The Prepare Method may be called to prepare a device for an update. This call transitions the device into the state Preparing.

After the preparation is complete the state machine may perform an automatic transition to the state PreparedForUpdate.

If the preparation cannot complete and the device does not get prepared for update the state machine transitions back to Idle. In this case a message with the reason should be provided to the user via the UpdateStatus.

Signature

Prepare();

Method Result Codes (defined in Call Service)

Result Code Description
Bad_InvalidState If the PrepareForUpdateStateMachineType is not in Idle state.

8.4.8.4 Abort Method ToC

If the preparation takes too long or does not complete at all because the required internal conditions are not met the Abort Method may be called to abort the preparation. This call transitions the device back to the Idle state.

Note: If the transition from Preparing to Idle cannot complet instantly a Client needs to subscribe for the events or the state variable of the PrepareForUpdateStateMachine.

Signature

Abort();

Method Result Codes (defined in Call Service)

Result Code Description
Bad_InvalidState If the PrepareForUpdateStateMachineType is not in Preparing state.

8.4.8.5 Resume Method ToC

A call to the optional Resume Method transitions the device into the state Resuming. After the resuming is complete the state machine performs an automatic transition to the Idle state. If the method is not supported, the transitions to Resuming and back to Idle shall be done by the Server automatically. If the method is supported, there shall not be an automatic transition to Resuming. Supporting this method enables the Client to group several activities like backup, install, restore on a single device or group the update of multiple devices before the devices are allowed to Resume their operation again.

Signature

Resume();

Method Result Codes (defined in Call Service)

Result Code Description
Bad_InvalidState If the PrepareForUpdateStateMachineType is not in PreparedForUpdate state or if the InstallationStateMachine is still in the state Installing.

Previous Next