OPC UA Specification - Amendment

OPC 10001-2

 

OPC Unified Architecture

Amendment 2: ChoiceStates and Guards

 

 

Release 1.04

2018-11-06

 

 

 

 

 

 

 


 

Specification Type:

Industry Standard Specification

Comments:

Report or view errata: http://www.opcfoundation.org/errata

 

 

 

 

Document
Number

OPC 10001-2

 

 

Title:

OPC Unified Architecture

Amendment 2
Choice States and Guards

Date:

2018-11-06

 

 

 

 

Version:

Release 1.04

Software:

MS-Word

 

 

Source:

OPC 10001-2 - UA Specification 1.04 Amendment 2 - ChoiceStates and Guards.docx

 

 

 

 

Author:

OPC Foundation

Status:

Release

 

 

 

 


 

OPC Foundation

____________

 

UNIFIED ARCHITECTURE –

FOREWORD

This specification is the specification for developers of OPC UA applications. The specification is a result of an analysis and design process to develop a standard interface to facilitate the development of applications by multiple vendors that shall inter-operate seamlessly together.

Copyright © 2006-2019, OPC Foundation, Inc.

AGREEMENT OF USE

COPYRIGHT RESTRICTIONS

Any unauthorized use of this specification may violate copyright laws, trademark laws, and communications regulations and statutes. This document contains information which is protected by copyright. All Rights Reserved. No part of this work covered by copyright herein may be reproduced or used in any form or by any means--graphic, electronic, or mechanical, including photocopying, recording, taping, or information storage and retrieval systems--without permission of the copyright owner.

OPC Foundation members and non-members are prohibited from copying and redistributing this specification. All copies must be obtained on an individual basis, directly from the OPC Foundation Web site
HTUhttp://www.opcfoundation.orgUTH.

PATENTS

The attention of adopters is directed to the possibility that compliance with or adoption of OPC specifications may require use of an invention covered by patent rights. OPC shall not be responsible for identifying patents for which a license may be required by any OPC specification, or for conducting legal inquiries into the legal validity or scope of those patents that are brought to its attention. OPC specifications are prospective and advisory only. Prospective users are responsible for protecting themselves against liability for infringement of patents.

WARRANTY AND LIABILITY DISCLAIMERS

WHILE THIS PUBLICATION IS BELIEVED TO BE ACCURATE, IT IS PROVIDED "AS IS" AND MAY CONTAIN ERRORS OR MISPRINTS. THE OPC FOUDATION MAKES NO WARRANTY OF ANY KIND, EXPRESSED OR IMPLIED, WITH REGARD TO THIS PUBLICATION, INCLUDING BUT NOT LIMITED TO ANY WARRANTY OF TITLE OR OWNERSHIP, IMPLIED WARRANTY OF MERCHANTABILITY OR WARRANTY OF FITNESS FOR A PARTICULAR PURPOSE OR USE. IN NO EVENT SHALL THE OPC FOUNDATION BE LIABLE FOR ERRORS CONTAINED HEREIN OR FOR DIRECT, INDIRECT, INCIDENTAL, SPECIAL, CONSEQUENTIAL, RELIANCE OR COVER DAMAGES, INCLUDING LOSS OF PROFITS, REVENUE, DATA OR USE, INCURRED BY ANY USER OR ANY THIRD PARTY IN CONNECTION WITH THE FURNISHING, PERFORMANCE, OR USE OF THIS MATERIAL, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGES.

The entire risk as to the quality and performance of software developed using this specification is borne by you.

RESTRICTED RIGHTS LEGEND

This Specification is provided with Restricted Rights. Use, duplication or disclosure by the U.S. government is subject to restrictions as set forth in (a) this Agreement pursuant to DFARs 227.7202-3(a); (b) subparagraph (c)(1)(i) of the Rights in Technical Data and Computer Software clause at DFARs 252.227-7013; or (c) the Commercial Computer Software Restricted Rights clause at FAR 52.227-19 subdivision (c)(1) and (2), as applicable. Contractor / manufacturer are the OPC Foundation,. 16101 N. 82nd Street, Suite 3B, Scottsdale, AZ, 85260-1830

COMPLIANCE

The OPC Foundation shall at all times be the sole entity that may authorize developers, suppliers and sellers of hardware and software to use certification marks, trademarks or other special designations to indicate compliance with these materials. Products developed using this specification may claim compliance or conformance with this specification if and only if the software satisfactorily meets the certification requirements set by the OPC Foundation. Products that do not meet these requirements may claim only that the product was based on this specification and must not claim compliance or conformance with this specification.

Trademarks

Most computer and software brand names have trademarks or registered trademarks. The individual trademarks have not been listed here.

GENERAL PROVISIONS

Should any provision of this Agreement be held to be void, invalid, unenforceable or illegal by a court, the validity and enforceability of the other provisions shall not be affected thereby.

This Agreement shall be governed by and construed under the laws of the State of Minnesota, excluding its choice or law rules.

This Agreement embodies the entire understanding between the parties with respect to, and supersedes any prior understanding or agreement (oral or written) relating to, this specification.

ISSUE REPORTING

The OPC Foundation strives to maintain the highest quality standards for its published specifications, hence they undergo constant review and refinement. Readers are encouraged to report any issues and view any existing errata here: HTUhttp://www.opcfoundation.org/errataUTH

 


Revision 1.04 Amendment 2 Highlights

The following table includes the Mantis issues resolved with this revision.

Mantis ID

Summary

Resolution

4277

Extend StateMachine model with choice states and guards

Choice states and guards are added as possible extensions to state machines.

 

 


OPC Unified Architecture Specification

 

Amendment 2: ChoiceStates and Guards

 

 

OPC 10000-5, OPC Unified Architecture - Part 5: Information Model

Replace Table B.7 in clause B.4.8 with the following (add ChoiceStateType as new subtype)

Table B.7 – StateType Definition

Attribute

Value

BrowseName

StateType

IsAbstract

False

References

NodeClass

BrowseName

DataType

TypeDefinition

ModellingRule

Subtype of the BaseObjectType defined in OPC 10000-5. Note that a Reference to this subtype is not shown in the definition of the BaseObjectType.

HasProperty

Variable

StateNumber

UInt32

PropertyType

Mandatory

HasSubtype

ObjectType

InitialStateType

Defined in B.4.9

HasSubtype

ObjectType

ChoiceStateType

Defined in B.6.2

 

 

Add section B.6

B.6      StateMachine Extensions for ChoiceStates and Guards

B.6.1      Overview

This section describes extensions to the StateMachine model allowing choices and guards on StateMachines.

B.6.2      ChoiceStateType

The ChoiceStateType is a subtype of the StateType and is formally defined in Table B.18. An Object of the ChoiceStateType represents a pseudo state that is directly exited when it is entered. The Guards defined on the Transitions from the ChoiceState determine which Transition is used. The Guards shall be defined in a way that at least one Guard is true and a Transition can be determined. If this is not the case, the StateMachine is non-well formed. To avoid this, the specific ElseGuardVariableType can be used, which is only “true” if all other Guards on a ChoiceState are “false”. If several Guards are “true”, only one of those Transitions is used. The algorithm to determine the Transition is server-specific.

A sample StateMachine using a ChoiceState is given in Figure B.12. It provides a simplified representation of a robot. When the StateMachine is in the S1_Initial state, calling the Load() Method loads a program to the robot and triggers the Transition into the ChoiceState (CS). In the ChoiceState the guards are validated and in case the robot is on the correct position for the loaded program (validated by the guard OnPath = True) the State S3_Ready is entered. In case the robot is not in the correct position (Else) the S2_Loaded State is entered. In that State, the Prepare() Method puts the robot in the correct position, and triggers the Transition to S3_Ready. If the robot is ready, it can be started. While it is running, it can be stopped. If the program is finished, the robot goes back to either the loaded or ready state, depending on its position, using the ChoiceState, again.

Figure B.12 – Example of a ChoiceState

As the ChoiceState is directly exited after it is entered there shall be no trigger (using the HasTrigger ReferenceType or a subtype) defined on any leaving Transition (Transitions referencing the ChoiceState with the FromState Reference or a subtype).

Table B.18 – ChoiceStateType Definition

Attribute

Value

BrowseName

ChoiceStateType

IsAbstract

False

References

NodeClass

BrowseName

DataType

TypeDefinition

ModellingRule

Subtype of the StateType defined in OPC 10000-5, Clause B.4.8.

 

B.6.3      HasGuard

The HasGuard ReferenceType is a concrete ReferenceType and can be used directly. It is a subtype of HasComponent.

The semantic of this ReferenceType is to point from a Transition to a Guard. The Guard indicates if the Transition can be used or not (see GuardVariableType). A Transition can only be used, if the Guard is “True”. A Transition can point to several Guards. In that case, all Guards need to be “True” before the Transition can be used. If there is no Guard, the Transition can always be used (considered as if all Guards are “True”).

The SourceNode of this ReferenceType shall be an Object of the ObjectType TransitionType or one of its subtypes. The TargetNode shall be a Variable of the VariableType GuardVariableType or one of its subtypes.

The representation of the HasGuard ReferenceType in the AddressSpace is specified in Table B.19.

Table B.19 – HasGuard ReferenceType

Attributes

Value

BrowseName

HasGuard

InverseName

GuardOf

Symmetric

False

IsAbstract

False

References

NodeClass

BrowseName

Comment

Subtype of the HasComponent ReferenceType defined in OPC 10000-5. Note that a Reference to this subtype is not shown in the definition of HasComponent.

 

 

 

 

 

B.6.4      GuardVariableType

The GuardVariableType provides the information of a Guard of a Transition in a StateMachine. A Guard indicates, if the Transition can be used or not. The Guard defines a semantic that can be evaluated to “True” or “False”. Only if the semantic is “True”, the Transition connected via a HasGuard Reference can be used. The value of the GuardVariableType provides the semantic of the Guard in a human-readable way, that can be used to display the StateMachine.

This base GuardVariableType does not define a machine-readable semantic of the Guard. The calculation, if the Guard is “True” or “False” is server-specific. Subtypes of this VariableType do define concrete machine-readable semantics.

The GuardVariableType is formally defined in Table B.20.

Table B.20 – GuardVariableType Definition

Attribute

Value

BrowseName

GuardVariableType

DataType

LocalizedText

ValueRank

1 (1 = Scalar)

IsAbstract

False

References

Node
Class

BrowseName

DataType

TypeDefinition

Modelling
Rule

Subtype of the BaseDataVariableType defined in OPC 10000-5.

Note that a Reference to this subtype is not shown in the definition of the BaseDataVariableType.

HasSubtype

VariableType

ElseGuardVariableType

Defined in B.6.6

HasSubtype

VariableType

ExpressionGuardVariableType

Defined in B.6.5

 

B.6.5      ExpressionGuardVariableType

The ExpressionGuardVariableType provides, in addition to the human-readable semantic from its GuardVariableType, a machine interpretable representation on the semantic.

The GuardVariableType is formally defined in Table B.21.

Table B.21 – ExpressionGuardVariableType Definition

Attribute

Value

BrowseName

ExpressionGuardVariableType

DataType

LocalizedText

ValueRank

1 (1 = Scalar)

IsAbstract

False

References

Node
Class

BrowseName

DataType

TypeDefinition

Modelling
Rule

Subtype of the GuardVariableType defined in B.6.4.

HasProperty

Variable

Expression

ContentFilter

PropertyType

Mandatory

 

The mandatory Property Expression provides a ContentFilter, that shall be evaluated on the Object the StateMachine belongs to. This is a machine-readable semantic of the Guard. If the ContentFilter evaluates to “True”, the Guard is “True”, otherwise the Guard is “False”.

The ContentFilter for ExpressionGuardVariableType is restricted to basic operators (see OPC OPC 10000-4 for details).

The ContentFilter can reference any Variables defined on the StateMachineType and are validated on the instance of the StateMachine. If the definition of the Variable is not owned directly by the StateMachine but for example some other type, the StateMachine instance shall reference that Variable.

B.6.6      ElseGuardVariableType

The ElseGuardVariableType is a specialization of the GuardVariableType defining a concrete semantic for the Guard. The value of the Guard should always be {“en”, “Else”} or a translation of this. The ElseGuardVariableType shall only be used on pseudo states like the ChoiceStateType. That means, that it shall only be referenced from Transitions having such a StateType as SourceNode. The ElseGuardVariableType shall only be used once for each State. That means, that each State shall at most have one Transition (referenced as SourceNode) referencing an ElseGuardVariableType. The ElseGuardVariableType shall be the only Guard of a Transition. That means, if a Transition references an instance of an ElseGuardVariableType, it shall not reference any other Guards.

The semantic of the ElseGuardVariableType is, that if a pseudo state is reached and no other Transition exists on the State where all its Guards are validated to “True”, this Guards validates to “True” and thus its Transition is used.

The ElseGuardVariableType is formally defined in Table B.22.

Table B.22 – ElseGuardVariableType Definition

Attribute

Value

BrowseName

ElseGuardVariableType

DataType

LocalizedText

ValueRank

1 (1 = Scalar)

IsAbstract

False

References

Node
Class

BrowseName

DataType

TypeDefinition

Modelling
Rule

Subtype of the GuardVariableType defined in B.6.4.

 

B.6.7      ContentFilter

This structured DataType is defined in OPC 10000-4.

Its representation in the AddressSpace is defined in Table B.23.

Table B.23 – ContentFilter Definition

Attributes

Value

BrowseName

ContentFilter

Add section B.7

B.7      Example of a StateMachine using a ChoiceState and Guards

Taking the sample StateMachine of Figure B.12 its representation in the OPC UA AddessSpace is shown in Figure B.13 as RobotStateMachineType. The Transition T2 between the ChoiceState and S2_Loaded has the Guard “Else” of ElseGuardVariableType and the Transition T3 between the ChoiceState and S3_Ready has the Guard “OnPathTrue” having an “Expression” Property (not shown in the figure). The ContentFilter of the Expression references to the ProgramLoaded Variable of the RobotStateMachineType. When the ChoiceState is entered on an instance of the RobotStateMachineType like MyStateMachine in Figure B.13, the concrete Variable of the instance is used to evaluate the ContentFilter. The value of the Expression is in the sample an array with one entry, using the FilterOperator Equal_0 and the filterOperands are the SimpleOperand OnPath and the Literal value “True”.

Figure B.13 – Example of a StateMachine using ChoiceState and Guards

 

OPC 10000-7, OPC Unified Architecture - Part 7: Profiles

Add the following ConformanceUnits to section 5.4, Table 13 “Base Information”:

Category

Title

Description

Server

Base Info Choice States

Support Guard Variables and optionally Choice States on StateMachine instances.

Client

Base Info Client Choice States

Use Guard Variables and Choice States on StateMachine instances.

 

Add the following ConformanceUnits to the section 6.6.44 State Machine Server Facet:

Group

Conformance Unit / Profile Title

Optional

Base Information

Base Info Choice States

True

 

Add the following ConformanceUnits to the section 6.6.114 State Machine Client Facet:

Group

Conformance Unit / Profile Title

Optional

Base Information

Base Info Client Choice States

True

 

 

 

__________________