As illustrated in the figure below, the A&E COM UA Proxy is a COM Server combined with a UA Client. It maps the Alarms and Conditions address space of UA A & C Server into the appropriate COM Alarms and Event Objects.
Subclauses D.3.2 through D.3.9 identify the design guidelines and constraints used to develop the A&E COM UA Proxy provided by the OPC Foundation. In order to maintain a high degree of consistency and interoperability, it is strongly recommended that vendors, who choose to implement their own version of the A&E COM UA Proxy, follow these same guidelines and constraints.
The A&E COM Client simply needs to address how to connect to the UA A & C Server. Connectivity approaches include the one where A&E COM Clients connect to a UA A & C Server with a CLSID just as if the target Server were an A&E COM Server. However, the CLSID can be considered virtual since it is defined to connect to intermediary components that ultimately connect to the UA A & C Server. Using this approach, the A&E COM Client calls co-create instance with a virtual CLSID as described above. This connects to the A&E COM UA Proxy components. The A&E COM UA Proxy then establishes a secure channel and session with the UA A & C Server. As a result, the A&E COM Client gets a COM Event Server interface pointer.
The A&E COM UA Proxy reads the UA A & C Server status from the Server Object Variable Node. Status enumeration values that are returned in ServerStatusDataType structure can be mapped 1 for 1 to the A&E COM Server status values with the exception of UA A & C Server status values Unknown and Communication Fault. These both map to the A&E COM Server status value of Failed.
The VendorInfo string of the A&E COM Server status is mapped from ManufacturerName.
Since all Alarms and Conditions Events belong to a subtype of BaseEventType, the A&E COM UA Proxy maps the subtype as received from the UA A & C Server to one of the three A&E Event types: Simple, Tracking and Condition. Figure D.2 shows the mapping as follows:
- Those A & C Events which are of subtype AuditEventType are marked as A&E Event type Tracking.
- Those A & C Events which are ConditionType are marked as A&E Event type Condition.
- Those A & C Events which are of any subtype except AuditEventType or ConditionType are marked as A&E Event type Simple.
Figure D.2 – Mapping UA Event Types to COM A&E Event Types
Note that the Event type mapping described above also applies to the children of each subtype.
Each A&E Event type (e.g. Simple, Tracking, Condition) has an associated set of Event categories which are intended to define groupings of A&E Events. For example, Level and Deviation are possible Event categories of the Condition Event type for an A&E COM Server. However, since A & C does not explicitly support Event categories, the A&E COM UA Proxy uses A & C Event types to return A&E Event categories to the A&E COM Client. The A&E COM UA Proxy builds the collection of supported categories by traversing the type definitions in the address space of the UA A & C Server. Figure D.3 shows the mapping as follows:
- A&E Tracking categories consist of the set of all Event types defined in the hierarchy of subtypes of AuditEventType and TransitionEventType, including AuditEventType itself and TransitionEventType itself.
- A&E Condition categories consist of the set of all Event types defined in the hierarchy of subtypes of ConditionType, including ConditionType itself.
- A&E Simple categories consist of the set of Event types defined in the hierarchy of subtypes of BaseEventType excluding AuditEventType and ConditionType and their respective subtypes.
Figure D.3 – Example mapping of UA Event Types to COM A&E categories
Category name is derived from the display name Attribute of the Node type as discovered in the type hierarchy of the UA A & C Server.
Category description is derived from the description Attribute of the Node type as discovered in the type hierarchy of the UA A & C Server.
The A&E COM UA Proxy assigns Category IDs.
The collection of Attributes associated with any given A&E Event is encapsulated within the ONEVENTSTRUCT. Therefore, the A&E COM UA Proxy populates the Attribute fields within the ONEVENTSTRUCT using corresponding values from UA Event Notifications either directly (e.g., Source, Time, Severity) or indirectly (e.g., OPC COM Event category determined by way of the UA Event type). Table D.5 lists the Attributes currently defined in the ONEVENTSTRUCT in the leftmost column. The rightmost column of Table D.5 indicates how the A&E COM UA proxy defines that Attribute.
Table D.5 – Event category attribute mapping table
A&E ONEVENTSTRUCT “attribute” |
A&E COM UA Proxy Mapping |
The following items are present for all A&E event types |
|
szSource |
UA BaseEventType Property: SourceName |
ftTime |
UA BaseEventType Property: Time |
szMessage |
UA BaseEventType Property: Message |
dwEventType |
See Clause D.3.3 |
dwEventCategory |
See Clause D.3.4 |
dwSeverity |
UA BaseEventType Property: Severity |
dwNumEventAttrs |
Calculated within A&E COM UA Proxy |
pEventAttributes |
Constructed within A&E COM UA Proxy |
The following items are present only for A&E Condition-Related Events |
|
szConditionName |
UA ConditionType Property: ConditionName |
szSubConditionName |
UA ActiveState Property: EffectiveDisplayName |
wChangeMask |
Calculated within Alarms and Events COM UA proxy |
wNewState: OPC_CONDITION_ACTIVE |
A & C AlarmConditionType Property: ActiveState Note that events mapped as non-Condition Events and those that do not derive from AlarmConditionType are set to ACTIVE by default. |
wNewState: OPC_CONDITION_ENABLED |
A & C ConditionType Property: EnabledState Note, Events mapped as non-Condition Events are set to ENABLED (state bit mask = 0x1) by default. |
wNewState: OPC_CONDITION_ACKED |
A & C AcknowledgeableConditionType Property: AckedState Note that A & C Events mapped as non-Condition Events or which do not derive from AcknowledgeableConditionType are set to UNACKNOWLEDGED and AckRequired = False by default. |
wQuality |
A & C ConditionType Property: Quality Note that Events mapped as non-Condition Events are set to OPC_QUALITY_GOOD by default.
In general, the Severity field of the StatusCode is used to map COM status codes OPC_QUALITY_BAD, OPC_QUALITY_GOOD and OPC_QUALITY_UNCERTAIN. When possible, specific status' are mapped directly. These include (UA => COM):
Bad status codes Bad_ConfigurationError => OPC_QUALITY_CONFIG_ERROR Bad_NotConnected => OPC_QUALITY_NOT_CONNECTED Bad_DeviceFailure => OPC_QUALITY_DEVICE_FAILURE Bad_SensorFailure => OPC_QUALITY_SENSOR_FAILURE Bad_NoCommunication => OPC_QUALITY_COMM_FAILURE Bad_OutOfService => OPC_QUALITY_OUT_OF_SERVICE
Uncertain status codes Uncertain_NoCommunicationLastUsableValue => OPC_QUALITY_LAST_USABLE Uncertain_LastUsableValue => OPC_QUALITY_LAST_USABLE Uncertain_SensorNotAccurate => OPC_QUALITY_SENSOR_CAL Uncertain_EngineeringUnitsExceeded => OPC_QUALITY_EGU_EXCEEDED Uncertain_SubNormal => OPC_QUALITY_SUB_NORMAL
Good status codes Good_LocalOverride => OPC_QUALITY_LOCAL_OVERRIDE |
bAckRequired |
If the ACKNOWLEDGED bit (OPC_CONDITION_ACKED) is set then the Ack Required Boolean is set to False, otherwise the Ack Required Boolean is set to True. If the Event is not of type AcknowledgeableConditionType or subtype then the AckRequired Boolean is set to False. |
ftActiveTime |
If the Event is of type AlarmConditionType or subtype and a transition from ActiveState of False to ActiveState to True is being processed then the TransitionTime Property of ActiveState is used. If the Event is not of type AlarmConditionType or subtype then this field is set to current time. Note: Additional logic applies to exclusive limit alarms, This value should be mapped to the LimitState.TransitionTime. |
dwCookie |
Generated by the A&E COM UA Proxy. These unique Condition Event cookies are not associated with any related identifier from the address space of the UA A & C Server. |
The following is used only for A&E tracking events and for A&E condition-relate events which are acknowledgement notifications |
|
szActorID |
|
Vendor specific Attributes – ALL |
|
ACK Comment |
|
AREAS |
All A&E Events are assumed to support the "Areas" Attribute. However, no Attribute or Property of an A & C Event is available which provides this value. Therefore, the A&E COM UA Proxy initializes the value of the Areas Attribute based on the MonitoredItem producing the Event. If the A&E COM Client has applied no area filtering to a Subscription, the corresponding A & C Subscription will contain just one MonitoredItem – that of the UA A & C Server Object. Events forwarded to the A&E COM Client on behalf of this Subscription will carry an Areas Attribute value of empty string. If the A&E COM Client has applied an area filter to a Subscription then the related UA A & C Subscription will contain one or more MonitoredItems for each notifier Node identified by the area string(s). Events forwarded to the A&E COM Client on behalf of such a Subscription will carry an areas Attribute whose value is the relative path to the notifier which produced the Event (i.e., the fully qualified area name). |
Vendor specific Attributes – based on category |
|
SubtypeProperty1 |
All the UA A & C subtype Properties that are not part of the standard set exposed by BaseEventType or ConditionType |
SubtypePropertyn |