EventAreas in the A&E COM Serverare represented in the A&E COM UA Wrapper as Objectswith a TypeDefinitionof BaseObjectType. The EventNotifier Attributefor these Objectsalways has the SubscribeToEvents flag set to True.
The root Area is represented by an Objectwith a BrowseNamethat depends on the UA Server. It is always the target of a HasNotifier Referencefrom the Server Node. The root Area allows multiple A&E COM Servers to be wrapped within a single UA Server.
The Area hierarchy is discovered with the BrowseOPCAreas and the GetQualifiedAreaName Methods. The Area name returned by BrowseOPCAreas is used as the BrowseNameand DisplayNamefor each Area Node. The QualifiedAreaName is used to construct the NodeId. The NamespaceURI qualifying the NodeIdand BrowseNameis a unique URI assigned to the combination of machine and COM Server.
Each Area is the target of HasNotifier Referencefrom its parent Area. It may be the source of one or more HasNotifier References to its child Areas. It may also be a source of a HasEventSource Referenceto any sources in the Area.
The A&E COM Servermay not support filtering by Areas. If this is the case then no Area Nodes are shown in the UA Serveraddress space. Some implementations could use the AREAS Attributeto provide filtering by Areas within the A&E COM UA Wrapper.
EventSources in the A&E COM Serverare represented in the A&E COM UA Wrapper as Objectswith a TypeDefinitionof BaseObjectType. If the A&E COM Serversupports source filtering then the SubscribeToEvents flag is True and the Source is a target of a HasNotifier Reference. If source filtering is not supported the SubscribeToEvents flag is False and the Source is a target of a HasEventSource Reference.
The Sources are discovered by calling BrowseOPCAreas and the GetQualifiedSourceName Methods. The Source name returned by BrowseOPCAreas is used as the BrowseName and DisplayName. The QualifiedSourceName is used to construct the NodeId. EventSource Nodes are always targets of a HasEventSource Referencefrom an Area.
EventCategories in the A&E COM Serverare represented in the UA Serveras ObjectTypeswhich are subtypes of BaseEventType. The BrowseNameand DisplayNameof the ObjectType Nodefor Simple and Tracking EventTypes are constructed by appending the text ‘EventType’ to the Description of the EventCategory. For Condition EventTypes the text ‘AlarmType’ is appended to the ConditionName.
These ObjectType Nodes have a super type which depends on the A&E EventType, the EventCategory Description and the ConditionName; however, the best mapping requires knowledge of the semantics associated with the EventCategories and ConditionNames. If an A&E COM UA Wrapper does not know these semantics then Simple EventTypes are subtypes of BaseEventType, Tracking EventTypes are subtypes of AuditEventTypeand Condition EventTypes are subtypes of the AlarmType. Table D.1defines mappings for a set of “well known” Category description and ConditionNames to a standard super type.
Table D.1– Mapping from standard Event categories to OPC UA Event types
COM A&E Event Type |
Category Description |
Condition Name |
OPC UA EventType |
Simple |
--- |
--- |
BaseEventType |
Simple |
Device Failure |
--- |
DeviceFailureEventType |
Simple |
System Message |
--- |
SystemEventType |
Tracking |
--- |
--- |
AuditEventType |
Condition |
--- |
--- |
AlarmType |
Condition |
Level |
--- |
LimitAlarmType |
Condition |
Level |
PVLEVEL |
ExclusiveLevelAlarmType |
Condition |
Level |
SPLEVEL |
ExclusiveLevelAlarmType |
Condition |
Level |
HI HI |
NonExclusiveLevelAlarmType |
Condition |
Level |
HI |
NonExclusiveLevelAlarmType |
Condition |
Level |
LO |
NonExclusiveLevelAlarmType |
Condition |
Level |
LO LO |
NonExclusiveLevelAlarmType |
Condition |
Deviation |
--- |
NonExclusiveDeviationAlarmType |
Condition |
Discrete |
--- |
DiscreteAlarmType |
Condition |
Discrete |
CFN |
OffNormalAlarmType |
Condition |
Discrete |
TRIP |
TripAlarmType |
There is no generic mapping defined for A&E COM sub-Conditions. If an EventCategory is mapped to a LimitAlarmTypethen the sub Conditionname in the Eventare be used to set the state of a suitable State Variable. For example, if the sub-Conditionname is “HI HI” then that means the HighHighstate for theLimitAlarmTypeis active
For Condition EventTypes the EventCategory is also used to define subtypes of BaseConditionClassType.
Figure D.1illustrates how ObjectType Nodescreated from the EventCategories and ConditionNames are placed in the standard OPC UA HasNotifierhierarchy.
Figure D.1– The type model of a wrapped COM AE server
Event Attributes in the A&E COM Serverare represented in the UA Serveras Variableswhich are targets of HasProperty References from the ObjectTypeswhich represent the EventCategories. The BrowseNameand DisplayNameare the description for the Event Attribute. The data type of the Event Attributeis used to set DataTypeand ValueRank. The NodeIdis constructed from the EventCategoryId, ConditionName and the AttributeId.
The A&E COM UA Wrapper creates a Subscriptionwith the COM AE Serverthe first time a MonitoredItemis created for the Server Objector one of the Nodes representing Areas. The Area filter is set based on the Nodebeing monitored. No other filters are specified.
If all MonitoredItemsfor an Area are disabled then the Subscriptionwill be deactivated.
The Subscriptionis deleted when the last MonitoredItemfor the Nodeis deleted.
When filtering by Area the A&E COM UA Wrapper needs to add two Area filters: one based on the QualifiedAreaName which forms the NodeIdand one with the text ‘/*’ appended to it. This ensures that Events from sub areas are correctly reported by the COM AE Server.
A simple A&E COM UA Wrapper will always request all Attributesfor all EventCategories when creating the Subscription. A more sophisticated wrapper may look at the EventFilterto determine which Attributesare actually used and only request those.
Table D.2lists how the fields in the ONEVENTSTRUCT that are used by the A&E COM UA Wrapper are mapped to UA BaseEventType Variables.
Table D.2– Mapping from ONEVENTSTRUCT fields to UA BaseEventType Variables
UA Event Variable |
ONEVENTSTRUCT Field |
Notes |
EventId |
szSource szConditionName ftTime ftActiveTime dwCookie |
A ByteString constructed by appending the fields together. |
EventType |
dwEventType dwEventCategory szConditionName |
The NodeId for the corresponding ObjectType Node. The szConditionName maybe omitted by some implementations. |
SourceNode |
szSource |
|
SourceName |
szSource |
- |
Time |
ftTime |
- |
ReceiveTime |
- |
Set when the Notificationis received by the wrapper. |
LocalTime |
- |
Set based on the clock of the machine running the wrapper. |
Message |
szMessage |
Locale is the default locale for the COM AE Server. |
Severity |
dwSeverity |
- |
Table D.3lists how the fields in the ONEVENTSTRUCT that are used by the A&E COM UA Wrapper are mapped to UA AuditEventType Variables.
Table D.3– Mapping from ONEVENTSTRUCT fields to UA AuditEventType Variables
UA Event Variable |
ONEVENTSTRUCT Field |
Notes |
ActionTimeStamp |
ftTime |
Only set for tracking Events. |
Status |
- |
Always set to True. |
ServerId |
- |
Set to the COM AE ServerNamespaceURI |
ClientAuditEntryId |
- |
Not set. |
ClientUserId |
szActorID |
- |
Table D.4lists how the fields in the ONEVENTSTRUCT that are used by the A&E COM UA Wrapper are mapped to UA AlarmType Variables.
Table D.4– Mapping from ONEVENTSTRUCT fields to UA AlarmType Variables
UA Event Variable |
ONEVENTSTRUCT Field |
Notes |
ConditionClassId |
dwEventType |
Set to the NodeIdof the ConditionClassTypefor the EventCategory of a Condition EventType. Set to the NodeIdof BaseConditionClassType Nodefor non-Condition EventTypes. |
ConditionClassName |
dwEventType |
Set to the BrowseNameof the ConditionClassTypefor the EventCategory of Condition EventType. To set “BaseConditionClass" non-Condition EventTypes. |
ConditionName |
szConditionName |
- |
BranchId |
- |
Always set to NULL. |
Retain |
wNewState |
Set to True if the OPC_CONDITION_ACKED bit is not set or OPC_CONDITION_ACTIVE bit is set. |
EnabledState |
wNewState |
Set to "Enabled" or "Disabled" |
EnabledState.Id |
wNewState |
Set to True if OPC_CONDITION_ENABLED is set |
EnabledState. EffectiveDisplayName |
wNewState |
A string constructed from the bits in the wNewState flag. The following rules are applied in order to select the string: "Disabled" if OPC_CONDITION_ENABLED is not set. "Unacknowledged" if OPC_CONDITION_ACKED is not set. "Active" if OPC_CONDITION_ACKED is set. "Enabled" if OPC_CONDITION_ENABLED is set. |
Quality |
wQuality |
The COM DA Quality converted to a UA StatusCode. |
Severity |
dwSeverity |
Set based on the last Eventreceived for the Conditioninstance. Set to the current value if the last Eventis not available. |
Comment |
- |
The value of the ACK_COMMENT Attribute |
ClientUserId |
szActorID |
- |
AckedState |
wNewState |
Set to "Acknowledged" or "Unacknowledged " |
AckedState.Id |
wNewState |
Set to True if OPC_CONDITION_ACKED is set |
ActiveState |
wNewState |
Set to "Active" or "Inactive " |
ActiveState.Id |
wNewState |
Set to True if OPC_CONDITION_ACTIVE is set |
ActiveState.TransitionTime |
ftActiveTime |
This time is set when the ActiveStatetransitions from False to True. Note: Additional logic applies to exclusive limit alarms, in that the LimitState.TransitionTime also needs to be set, but this is set each time a limit is crossed (multiple limits might exist). For the initial transition to True the ftActiveTime is used for both LimitState.TransitionTime and ActiveState.TransitionTime. For subsequent transition the ActiveState.Transition time does not change, but the LimitState.TransitionTime will be updated with the new ftActiveTime. For example, if an alarm has Hi and HiHi limits, when the Hi limit is crossed and the alarm goes active the FTActiveTime is used for both times, but when the HiHi limit is later crossed, the FtActiveTime is only be used for the LimitState.TransitionTime. Note: The ftActiveTime is part of the key for identifying the unique event in the A&E server and needs to be saved for processing any commands back to the A&E Server. |
|
|
|
The A&C ConditionModel defines other optional Variables which are not needed in the A&E COM UA Wrapper. Any additional fields associated with Event Attributesare also reported.
Conditioninstances do not appear in the UA Serveraddress space. Conditions can be acknowledged by passing the EventId to the Acknowledge Methoddefined on the AcknowledgeableConditionType.
Conditions cannot be enabled or disabled via the COM A&E Wrapper.
The COM A&E Wrapper does not store the state of Conditions. When ConditionRefreshis called the Refresh Methodis called on all COM AE Subscriptions associated with the ConditionRefreshcall. The wrapper needs to wait until it receives the call back with the bLastRefresh flag set to True in the OnEvent call before it can tell the UA Clientthat the Refreshhas completed.