C++ Based OPC UA Client/Server SDK  1.5.5.355
ConditionType
Reference NodeClass BrowseName DataType ValueRank TypeDefinition ModellingRule
HasSupertype ObjectType BaseEventType  
HasComponent Method AddComment Mandatory
HasProperty Variable BranchId NodeId Scalar PropertyType Mandatory
HasProperty Variable ClientUserId String Scalar PropertyType Mandatory
HasComponent Variable Comment LocalizedText Scalar ConditionVariableType Mandatory
HasProperty Variable ConditionClassId NodeId Scalar PropertyType Mandatory
HasProperty Variable ConditionClassName LocalizedText Scalar PropertyType Mandatory
HasProperty Variable ConditionName String Scalar PropertyType Mandatory
HasComponent Method ConditionRefresh None
HasComponent Method ConditionRefresh2 None
HasComponent Method Disable Mandatory
HasComponent Method Enable Mandatory
HasComponent Variable EnabledState LocalizedText Scalar TwoStateVariableType Mandatory
HasComponent Variable LastSeverity UInt16 Scalar ConditionVariableType Mandatory
HasComponent Variable Quality StatusCode Scalar ConditionVariableType Mandatory
HasProperty Variable Retain Boolean Scalar PropertyType Mandatory

The ConditionType defines all general characteristics of a Condition. All other ConditionTypes derive from it.

The FALSE state of the EnabledState shall not be extended with a substate machine. The ConditionType inherits all Properties of the BaseEventType.

SourceNode identifies the ConditionSource. If the ConditionSource is not a Node in the AddressSpace, the NodeId is set to null. The SourceNode is the Node which the condition is associated with, it may be the same as the InputNode for an alarm, but it may be a separate node. For example, a motor which is a variable with a value that is an RPM may be the ConditionSource for Conditions that are related to the motor, as well as a temperature sensor associated with the motor. In the former, the InputNode for the High RPM alarm is the value of the Motor RPM, while in the later the InputNode of the High Alarm would be the value of the temperature sensor that is associated with the motor.

Events are only generated for Conditions that have their Retain field set to true.

The NodeId of the Condition instance is used as ConditionId. It is not explicitly modelled as a component of the ConditionType. However, it can be requested with the following SimpleAttributeOperand in the SelectClause of the EventFilter:

Name Type Description
typeId NodeId NodeId of the ConditionType Node
browsePath[] QualifiedName empty
attributeId IntegerId Id of the NodeId Attribute

Variable Retain

Retain when TRUE describes a Condition (or ConditionBranch) as being in a state that is interesting for a Client wishing to synchronize its state with the Server’s state. The logic to determine how this flag is set is Server specific. Typically all Active Alarms would have the Retain flag set; however, it is also possible for inactive Alarms to have their Retain flag set to TRUE. In normal processing, when a Client receives an Event with the Retain flag set to FALSE, the Client should consider this as a ConditionBranch that is no longer of interest, in the case of a “current Alarm display” the ConditionBranch would be removed from the display.

Method ConditionRefresh

Allows a Client to request a Refresh of all Condition instances that currently are in an interesting state (they have the Retain flag set).

This includes previous states of a Condition instance for which the Server maintains Branches. A Client would typically invoke this method when it initially connects to a Server and following any situations, such as communication disruptions, in which it would require resynchronization with the Server. This method is only available on the ConditionType or its subtypes. To invoke this method, the call shall pass the well known MethodId of the method on the ConditionType and the ObjectId shall be the well known ObjectId of the ConditionType object

Method Result Codes

ResultCode Description
Bad_SubscriptionIdInvalid The subscription id is not valid.
Bad_RefreshInProgress A ConditionRefresh operation is already in progress.
Bad_UserAccessDenied User does not have permission to perform the requested operation. The method was not called in the context of the Session that owns the Subscription.

Input Arguments

Argument DataType ValueRank Description
SubscriptionId IntegerId Scalar A valid Subscription Id of the Subscription to be refreshed.
The Servers shall verify that the SubscriptionId provided is part of the Session that is invoking the method.

Variable ConditionName

Identifies the Condition instance that the Event originated from.

It can be used together with the SourceName in a user display to distinguish between different Condition instances. If a ConditionSource has only one instance of a ConditionType, and the Server has no instance name, the Server shall supply the ConditionType browse name.

Variable BranchId

BranchId is Null for all Event Notifications that relate to the current state of the Condition instance. If BranchId is not Null it identifies a previous state of this Condition instance that still needs attention by an Operator. If the current ConditionBranch is transformed into a previous ConditionBranch then the Server needs to assign a non-null BranchId. An initial Event for the branch will be generated with the values of the ConditionBranch and the new BranchId. The ConditionBranch can be updated many times before it is no longer needed. When the ConditionBranch no longer requires Operator input the final Event will have Retain set to FALSE. The retain bit on the current Event is TRUE, as long as any ConditionBranches require Operator input.The BranchId DataType is NodeId although the Server is not required to have ConditionBranches in the Address Space. The use of a NodeId allows the Server to use simple numeric identifiers, strings or arrays of bytes.

Variable EnabledState

EnabledState indicates whether the Condition is enabled.

EnabledState/Id is TRUE if enabled, FALSE otherwise. EnabledState/TransitionTime defines when the EnabledState last changed. Recommended state names for LocaleIds are listed in the following table.

LocaleId FALSE State Name TRUE State Name
en Disabled Enabled
de Ausgeschaltet Eingeschaltet
fr Hors Service En Service

A Condition’s EnabledState effects the generation of Event Notifications and as such results in the following specific behaviour:

  • When the Condition instance enters the Disabled state, the Retain Property of this Condition shall be set to FALSE by the Server to indicate to the Client that the Condition instance is currently not of interest to Clients.
  • When the Condition instance enters the enabled state, the Condition shall be evaluated and all of its Properties updated to reflect the current values. If this evaluation causes the Retain Property to transition to TRUE for any ConditionBranch, then an Event Notification shall be generated for that ConditionBranch.
  • The Server may choose to continue to test for a Condition instance while it is Disabled. However, no Event Notifications will be generated while the Condition instance is disabled.
  • For any Condition that exists in the AddressSpace the Attributes and the following Variables will continue to have valid values even in the Disabled state: EventId, Event Type, Source Node, Source Name, Time, and EnabledState. Other properties may no longer provide current valid values. All Variables that are no longer provided shall return a status of Bad_ConditionDisabled. The Event that reports the Disabled state should report the properties as NULL or with a status of Bad_ConditionDisabled.

When enabled, changes to the following components shall cause a ConditionType Event Notification:

  • Quality
  • Severity (inherited from BaseEventType)
  • Comment

This may not be the complete list. Subtypes may define additional Variables that trigger Event Notifications. In general changes to Variables of the types TwoStateVariableType or ConditionVariableType trigger Event Notifications.

Variable Quality

Reveals the status of process values or other resources that this Condition instance is based upon.

If, for example, a process value is “Uncertain”, the associated “LevelAlarm” Condition is also questionable. Values for the Quality can be any of the OPC StatusCodes defined in Part 8 of the OPC UA Specification as well as Good, Uncertain and Bad as defined in Part 4 of the OPC UA Specification. These StatusCodes are similar to but slightly more generic than the description of data quality in the various field bus Specifications. It is the responsibility of the Server to map internal status information to these codes. A Server which supports no quality information shall return Good. This quality can also reflect the communication status associated with the system that this value or resource is based on and from which this Alarm was received. For communication errors to the underlying system, especially those that result in some unavailable Event fields, the quality shall be Bad_NoCommunication error.

Variable LastSeverity

Provides the previous severity of the ConditionBranch.

Initially this Variable contains a zero value; it will return a value only after a severity change. The new severity is supplied via the Severity Property which is inherited from the BaseEventType.

Variable Comment

Contains the last comment provided for a certain state (ConditionBranch).

It may have been provided by an AddComment method, some other method or in some other manner. The initial value of this Variable is null, unless it is provided in some other manner. If a method provides as an option the ability to set a Comment, then the value of this Variable is reset to null if an optional comment is not provided.

Variable ClientUserId

Is related to the Comment field and contains the identity of the user who inserted the most recent Comment.

The logic to obtain the ClientUserId is defined in Part 5 of the OPC UA Specification.

Method Enable

Changes a Condition instance to the enabled state.

Normally, the NodeId of the object instance as the ObjectId is passed to the Call Service. However, some Servers do not expose Condition instances in the AddressSpace. Therefore all Servers shall allow Clients to call the Enable method by specifying ConditionId as the ObjectId. The method cannot be called with an ObjectId of the ConditionType Node. If the condition instance is not exposed, it may be difficult for a Client to determine the ConditionId for a disabled condition.

Method Result Codes

ResultCode Description
Bad_ConditionAlreadyEnabled The addressed Condition is already enabled.

Method Disable

Changes a Condition instance to the Disabled state.

Normally, the NodeId of the object instance as the ObjectId is passed to the Call Service. However, some Servers do not expose Condition instances in the AddressSpace. Therefore all Servers shall allow Clients to call the Disable method by specifying ConditionId as the ObjectId. The method cannot be called with an ObjectId of the ConditionType node.

Method Result Codes

ResultCode Description
Bad_ConditionAlreadyDisabled The addressed Condition is already disabled.

Method AddComment

Applies a comment to a specific state of a Condition instance.

Normally, the NodeId of the object instance as the ObjectId is passed to the Call Service. However, some Servers do not expose Condition instances in the AddressSpace. Therefore all Servers shall also allow Clients to call the AddComment method by specifying ConditionId as the ObjectId. The method cannot be called with an ObjectId of the ConditionType Node.

Method Result Codes

ResultCode Description
Bad_MethodInvalid The method id does not refer to a method for the specified object. The MethodId provided does not correspond to the ObjectId provided.
Bad_EventIdUnknown The specified EventId is not known to the Server.
Bad_NodeIdUnknown The node id refers to a node that does not exist in the server address space. Used to indicate that the specified Object is not valid or that the method was called on the ConditionType Node.

Input Arguments

Argument DataType ValueRank Description
EventId ByteString Scalar The identifier for the event to comment.
Comment LocalizedText Scalar The comment to add to the condition.

Variable ConditionClassId

Specifies in which domain this Condition is used.

It is the NodeId of the corresponding ConditionClassType. When using this Property for filtering, Clients have to specify all individual ConditionClassType NodeIds. The OfType operator cannot be applied. BaseConditionClassType is used as class whenever a Condition cannot be assigned to a more concrete class.

Variable ConditionClassName

ConditionClassName provides the display name of the ConditionClassType.

Method ConditionRefresh2

Allows a Client to request a refresh of all Condition instances that currently are in an interesting state (they have the Retain flag set) that are associated with the given Monitored item.

In all other respects it functions as ConditionRefresh. A Client would typically invoke this method when it initially connects to a Server and following any situations, such as communication disruptions where only a single monitored item is to be resynchronization with the Server. This method is only available on the ConditionType or its subtypes. To invoke this method, the call shall pass the well known MethodId of the method on the ConditionType and the ObjectId shall be the well known ObjectId of the ConditionType object.

This method is optional and as such Clients must be prepared to handle Servers which do not provide the method. If the method returns Bad_MethodInvalid, the client shall revert to ConditionRefresh.

Method Result Codes

ResultCode Description
Bad_SubscriptionIdInvalid The subscription id is not valid.
Bad_MonitoredItemIdInvalid The monitoring item id does not refer to a valid monitored item.
Bad_RefreshInProgress A ConditionRefresh operation is already in progress.
Bad_UserAccessDenied The method was not called in the context of the Session that owns the Subscription. User does not have permission to perform the requested operation.
Bad_MethodInvalid The method id does not refer to a method for the specified object.

Input Arguments

Argument DataType ValueRank Description
SubscriptionId IntegerId Scalar The identifier of the Subscription containing the MonitoredItem to be refreshed.
The Server shall verify that the SubscriptionId provided is part of the Session that is invoking the method.
MonitoredItemId IntegerId Scalar The identifier of the MonitoredItem to be refreshed.
The MonitoredItemId shall be in the provided Subscription.