8.4.8 PrepareForUpdateStateMachineType

8.4.8.1 Overview

The PrepareForUpdateStateMachineType can 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 48, Figure 49 and formally defined in Table 91. The transitions are formally defined in Table 93.

Figure 48 – PrepareForUpdate state machine
Figure 49 – PrepareForUpdateStateMachineType
Table 91 – PrepareForUpdateStateMachineType definition
Attribute Value
BrowseName1:PrepareForUpdateStateMachineType
IsAbstractFalse
References Node
Class
BrowseName DataType TypeDefinition Other
Subtype of the 0:FiniteStateMachineType defined in OPC 10000-5.
0:HasComponentVariable1:PercentComplete0:Byte0:BaseDataVariableTypeO
0:HasComponentMethod1:PrepareM
0:HasComponentMethod1:AbortM
0:HasComponentMethod1:ResumeO
0:HasComponentObject1:Idle0:InitialStateType
0:HasComponentObject1:Preparing0:StateType
0:HasComponentObject1:PreparedForUpdate0:StateType
0:HasComponentObject1:Resuming0:StateType
0:HasComponentObject1:IdleToPreparing0:TransitionType
0:HasComponentObject1:PreparingToIdle0:TransitionType
0:HasComponentObject1:PreparingToPreparedForUpdate0:TransitionType
0:HasComponentObject1:PreparedForUpdateToResuming0:TransitionType
0:HasComponentObject1:ResumingToIdle0:TransitionType
Conformance Units
DI SU PrepareForUpdate

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

Table 92 – 1:PrepareForUpdateStateMachineType Attribute values for child Nodes
BrowsePath Value Attribute
1
2
3
4
12
21
23
34
41
Table 93 – 1:PrepareForUpdateStateMachineType Additional References
SourceBrowsePathReference TypeIs ForwardTargetBrowsePath
Transitions
1:IdleToPreparing0:FromStateTrue1:Idle
0:ToStateTrue1:Preparing
0:HasCauseTrue1:Prepare
0:HasEffectTrue0:TransitionEventType
1:PreparingToIdle0:FromStateTrue1:Preparing
0:ToStateTrue1:Idle
0:HasCauseTrue1:Abort
0:HasEffectTrue0:TransitionEventType
1:PreparingToPreparedForUpdate0:FromStateTrue1:Preparing
0:ToStateTrue1:PreparedForUpdate
0:HasEffectTrue0:TransitionEventType
1:PreparedForUpdateToResuming0:FromStateTrue1:PreparedForUpdate
0:ToStateTrue1:Resuming
0:HasCauseTrue1:Resume
0:HasEffectTrue0:TransitionEventType
1:ResumingToIdle0:FromStateTrue1:Resuming
0:ToStateTrue1:Idle
0:HasCauseTrue1:Abort
0:HasEffectTrue0:TransitionEventType
8.4.8.2 PercentComplete

This percentage is a number between 0 and 100 that informs about the progress in the Preparing or the Resuming States. It can 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.

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

8.4.8.3 Prepare Method

The Prepare Method can 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 can 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_InvalidStateIf the PrepareForUpdateStateMachineType is not in Idle state.
8.4.8.4 Abort Method

An update client can use the Abort Method to bring the state machine from Resuming or Preparing back to the Idle state. This can be necessary, if the preparation takes too long or does not complete at all because the required internal conditions are not met. This call transitions the device back to the Idle state.

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

Signature

	Abort();

Method Result Codes (defined in Call Service)

Result Code Description
Bad_InvalidStateIf the PrepareForUpdateStateMachineType is not in Preparing state.
8.4.8.5 Resume Method

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_InvalidStateIf the PrepareForUpdateStateMachineType is not in PreparedForUpdate state or if the InstallationStateMachine is still in the state Installing.