Many OPC Alarm/Event servers are associated with OPC Data Access servers.
Since these servers may provide a Data Access interface to some or all of the
attributes associated with events, applications need the ability to determine the
specific ItemID for one or more specific attribute ID codes given an associated
source ID in order to be able to access the attribute via the Data Access interface.
TranslateToItemIDs performs the required translation. This function will be useful
for the case where the client wishes to use the OPC Data Access interface to subscribe
to real-time data associated with a given event or alarm.
Given an event source, and an array of associated attribute ID codes, return an
array of the item ID strings corresponding to each attribute ID. The event source,
along with the associated attribute IDs are returned as part of the IOPCEventSink::OnEvent
callback mechanism. Attribute ID codes and descriptions for a given event category can
also be queried via the IOPCEventServer::QueryEventAttributes function.
The server must return a NULL string for those attribute IDs that do not have a
corresponding item ID.
Syntax
Parameters
- Source
- An event source for which to return the item IDs corresponding to each of an array of attribute IDs if they exist.
(From OnEvent or from IOPCEventAreaBrowser)
- EventCategory
- A DWORD event category code indicating the category of events for which item IDs are to be returned.
(From OnEvent or from QueryEventCategories)
- ConditionName
- The name of a condition within the event category for which item IDs are to be returned.
(From OnEvent or from QueryConditionNames)
- SubconditionName
- The name of a sub-condition within a multi-state condition (From OnEvent or from QuerySubconditionNames).
This should be a NULL string for a single state condition.
- AssocAttrIDs
- Array of DWORD IDs of vendor-specific event attributes associated with the generator ID and available
from the server for which to return ItemIDs. Note: these attribute IDs are returned by the IOPCEventSink::OnEvent callback,
and are selected via the SelectReturnedAttributes method.
- AttrItemIDs
- Array of item ID strings corresponding to each event attribute ID associated with the generator ID.
This array is the same length as the AssocAttrIDs array passed into the function. A Null string is returned if no item ID is
available for this attribute.
- NodeNames
- Array of network node names of the associated OPC Data Access Servers.
A Null string is returned if the OPC Data Access Server is running on the local node.
- CLSIDs
- Array of class IDs for the associated OPC Data Access Servers.
Return Value
HRESULTS error/success code.
Requirements
Target Platforms: Windows 7/8/10, Windows Server 2003/2008/2012/2016, .NET 4.x
See Also