ANSI C Based OPC UA Client/Server SDK  1.9.0.430
UaClientSubscription

Data Structures

struct  UaClient_Subscription
 The UaSubscription structure manges a UA Client created subscription. More...
 
struct  UaClient_Subscription_Callback
 UaClient_Subscription_Callback defines the callback interface for the UaClient_Subscription structure. More...
 

Typedefs

typedef OpcUa_Void(* UaClient_Subscription_StatusChanged_CB )(UaClient_Subscription *a_pSubscription, OpcUa_StatusCode a_status)
 Send subscription state change. More...
 
typedef OpcUa_Void(* UaClient_Subscription_KeepAlive_CB )(UaClient_Subscription *a_pSubscription)
 Send subscription keep alive. More...
 
typedef OpcUa_Void(* UaClient_Subscription_NotificationsMissing_CB )(UaClient_Subscription *a_pSubscription, OpcUa_UInt32 a_previousSequenceNumber, OpcUa_UInt32 a_newSequenceNumber)
 Informs the client about missing notification messages. More...
 
typedef OpcUa_Void(* UaClient_Subscription_DataChange_CB )(UaClient_Subscription *a_pSubscription, OpcUa_Int32 a_noOfMonitoredItems, OpcUa_MonitoredItemNotification *a_pMonitoredItems, OpcUa_Int32 a_noOfDiagnosticInfos, OpcUa_DiagnosticInfo *a_pDiagnosticInfos)
 Send changed data. More...
 
typedef OpcUa_Void(* UaClient_Subscription_NewEvents_CB )(UaClient_Subscription *a_pSubscription, OpcUa_Int32 a_noOfEvents, OpcUa_EventFieldList *a_pEvents)
 Send new events. More...
 
typedef OpcUa_Void(* UaClient_Subscription_CreateSubscription_CB )(UaClient_Subscription *a_pSubscription, OpcUa_StatusCode a_status, OpcUa_ResponseHeader *a_pResponseHeader, OpcUa_Void *a_pUserData)
 Asynchronous callback function for calls to UaClient_Subscription_BeginCreateSubscription. More...
 
typedef OpcUa_Void(* UaClient_Subscription_ModifySubscription_CB )(UaClient_Subscription *a_pSubscription, OpcUa_StatusCode a_status, OpcUa_ResponseHeader *a_pResponseHeader, OpcUa_Void *a_pUserData)
 Asynchronous callback function for calls to UaClient_Subscription_BeginModifySubscription. More...
 
typedef OpcUa_Void(* UaClient_Subscription_DeleteSubscription_CB )(UaClient_Subscription *a_pSubscription, OpcUa_StatusCode a_status, OpcUa_ResponseHeader *a_pResponseHeader, OpcUa_Void *a_pUserData)
 Asynchronous callback function for calls to UaClient_Subscription_BeginDeleteSubscription. More...
 
typedef OpcUa_Void(* UaClient_Subscription_CreateMonitoredItems_CB )(const UaClient_Subscription *a_pSubscription, OpcUa_ResponseHeader *a_pResponseHeader, OpcUa_Int32 a_NoOfResults, OpcUa_MonitoredItemCreateResult *a_pResults, OpcUa_Int32 a_NoOfDiagnosticInfos, OpcUa_DiagnosticInfo *a_pDiagnosticInfos, OpcUa_Void *a_pUserData)
 Asynchronous callback function for calls to UaClient_Subscription_BeginCreateMonitoredItems. More...
 
typedef OpcUa_Void(* UaClient_Subscription_ModifyMonitoredItems_CB )(const UaClient_Subscription *a_pSubscription, OpcUa_ResponseHeader *a_pResponseHeader, OpcUa_Int32 a_NoOfResults, OpcUa_MonitoredItemModifyResult *a_pResults, OpcUa_Int32 a_NoOfDiagnosticInfos, OpcUa_DiagnosticInfo *a_pDiagnosticInfos, OpcUa_Void *a_pUserData)
 Asynchronous callback function for calls to UaClient_Subscription_BeginModifyMonitoredItems. More...
 
typedef OpcUa_Void(* UaClient_Subscription_SetMonitoringMode_CB )(const UaClient_Subscription *a_pSubscription, OpcUa_ResponseHeader *a_pResponseHeader, OpcUa_Int32 a_NoOfResults, OpcUa_StatusCode *a_pResults, OpcUa_Int32 a_NoOfDiagnosticInfos, OpcUa_DiagnosticInfo *a_pDiagnosticInfos, OpcUa_Void *a_pUserData)
 Asynchronous callback function for calls to UaClient_Subscription_BeginSetMonitoringMode. More...
 
typedef OpcUa_Void(* UaClient_Subscription_SetTriggering_CB )(const UaClient_Subscription *a_pSubscription, OpcUa_ResponseHeader *a_pResponseHeader, OpcUa_Int32 a_NoOfAddResults, OpcUa_StatusCode *a_pAddResults, OpcUa_Int32 a_NoOfAddDiagnosticInfos, OpcUa_DiagnosticInfo *a_pAddDiagnosticInfos, OpcUa_Int32 a_NoOfRemoveResults, OpcUa_StatusCode *a_pRemoveResults, OpcUa_Int32 a_NoOfRemoveDiagnosticInfos, OpcUa_DiagnosticInfo *a_pRemoveDiagnosticInfos, OpcUa_Void *a_pUserData)
 Asynchronous callback function for calls to UaClient_Subscription_BeginSetTriggering. More...
 
typedef OpcUa_Void(* UaClient_Subscription_DeleteMonitoredItems_CB )(const UaClient_Subscription *a_pSubscription, OpcUa_ResponseHeader *a_pResponseHeader, OpcUa_Int32 a_NoOfResults, OpcUa_StatusCode *a_pResults, OpcUa_Int32 a_NoOfDiagnosticInfos, OpcUa_DiagnosticInfo *a_pDiagnosticInfos, OpcUa_Void *a_pUserData)
 Asynchronous callback function for calls to UaClient_Subscription_BeginDeleteMonitoredItems. More...
 
typedef OpcUa_Void(* UaClient_Subscription_SetPublishingMode_CB )(const UaClient_Subscription *a_pSubscription, OpcUa_ResponseHeader *a_pResponseHeader, OpcUa_Int32 a_NoOfResults, OpcUa_StatusCode *a_pResults, OpcUa_Int32 a_NoOfDiagnosticInfos, OpcUa_DiagnosticInfo *a_pDiagnosticInfos, OpcUa_Void *a_pUserData)
 Asynchronous callback function for calls to UaClient_Subscription_BeginSetPublishingMode. More...
 
typedef OpcUa_Void(* UaClient_Subscription_Republish_CB )(const UaClient_Subscription *a_pSubscription, OpcUa_ResponseHeader *a_pResponseHeader, OpcUa_NotificationMessage *a_pNotificationMessage, OpcUa_Void *a_pUserData)
 Asynchronous callback function for calls to UaClient_Subscription_BeginRepublish. More...
 

Functions

OpcUa_StatusCode UaClient_Subscription_Create (UaClient_Session *a_pSession, const UaClient_Subscription_Callback *a_pCallback, UaClient_Subscription **a_ppSubscription)
 Create a subscription and initialize it with default values. More...
 
OpcUa_StatusCode UaClient_Subscription_Delete (UaClient_Subscription **a_ppSubscription)
 Delete a subscription. More...
 
OpcUa_StatusCode UaClient_Subscription_BeginCreateSubscription (UaClient_Subscription *a_pSubscription, UaClient_ServiceSettings *a_pServiceSettings, UaClient_Subscription_CreateSubscription_CB a_pfCallback, OpcUa_Void *a_pUserData)
 Asynchronous call to create a Subscription. More...
 
OpcUa_StatusCode UaClient_Subscription_BeginModifySubscription (UaClient_Subscription *a_pSubscription, UaClient_ServiceSettings *a_pServiceSettings, UaClient_Subscription_ModifySubscription_CB a_pfCallback, OpcUa_Void *a_pUserData)
 Asynchronous call to modify a Subscription. More...
 
OpcUa_StatusCode UaClient_Subscription_BeginDeleteSubscription (UaClient_Subscription *a_pSubscription, UaClient_ServiceSettings *a_pServiceSettings, UaClient_Subscription_DeleteSubscription_CB a_pfCallback, OpcUa_Void *a_pUserData)
 Asynchronous call to delete one or more Subscriptions that belong to the Client's Session. More...
 
OpcUa_StatusCode UaClient_Subscription_BeginCreateMonitoredItems (UaClient_Subscription *a_pSubscription, UaClient_ServiceSettings *a_pServiceSettings, OpcUa_TimestampsToReturn a_TimestampsToReturn, OpcUa_Int32 a_NoOfItemsToCreate, const OpcUa_MonitoredItemCreateRequest *a_pItemsToCreate, UaClient_Subscription_CreateMonitoredItems_CB a_pfCallback, OpcUa_Void *a_pUserData)
 Asynchronous call to create a list of monitored items in the subscription. More...
 
OpcUa_StatusCode UaClient_Subscription_BeginModifyMonitoredItems (UaClient_Subscription *a_pSubscription, UaClient_ServiceSettings *a_pServiceSettings, OpcUa_TimestampsToReturn a_TimestampsToReturn, OpcUa_Int32 a_NoOfItemsToModify, const OpcUa_MonitoredItemModifyRequest *a_pItemsToModify, UaClient_Subscription_ModifyMonitoredItems_CB a_pfCallback, OpcUa_Void *a_pUserData)
 Asynchronous call to modify monitored items. More...
 
OpcUa_StatusCode UaClient_Subscription_BeginSetMonitoringMode (UaClient_Subscription *a_pSubscription, UaClient_ServiceSettings *a_pServiceSettings, OpcUa_MonitoringMode a_MonitoringMode, OpcUa_Int32 a_NoOfMonitoredItemIds, const OpcUa_UInt32 *a_pMonitoredItemIds, UaClient_Subscription_SetMonitoringMode_CB a_pfCallback, OpcUa_Void *a_pUserData)
 Asynchronous call to set the monitoring mode for a list of monitored items. More...
 
OpcUa_StatusCode UaClient_Subscription_BeginSetTriggering (UaClient_Subscription *a_pSubscription, UaClient_ServiceSettings *a_pServiceSettings, OpcUa_UInt32 a_TriggeringItemId, OpcUa_Int32 a_NoOfLinksToAdd, const OpcUa_UInt32 *a_pLinksToAdd, OpcUa_Int32 a_NoOfLinksToRemove, const OpcUa_UInt32 *a_pLinksToRemove, UaClient_Subscription_SetTriggering_CB a_pfCallback, OpcUa_Void *a_pUserData)
 Asynchronously changes the triggering for a monitored item. More...
 
OpcUa_StatusCode UaClient_Subscription_BeginDeleteMonitoredItems (UaClient_Subscription *a_pSubscription, UaClient_ServiceSettings *a_pServiceSettings, OpcUa_Int32 a_NoOfMonitoredItemIds, const OpcUa_UInt32 *a_pMonitoredItemIds, UaClient_Subscription_DeleteMonitoredItems_CB a_pfCallback, OpcUa_Void *a_pUserData)
 Asynchronous call to delete monitored items. More...
 
OpcUa_StatusCode UaClient_Subscription_BeginSetPublishingMode (UaClient_Subscription *a_pSubscription, UaClient_ServiceSettings *a_pServiceSettings, OpcUa_Boolean a_PublishingEnabled, OpcUa_Int32 a_NoOfSubscriptionIds, const OpcUa_UInt32 *a_pSubscriptionIds, UaClient_Subscription_SetPublishingMode_CB a_pfCallback, OpcUa_Void *a_pUserData)
 Asynchronous call to enable sending of Notifications on one or more Subscriptions. More...
 
OpcUa_StatusCode UaClient_Subscription_BeginRepublish (UaClient_Subscription *a_pSubscription, UaClient_ServiceSettings *a_pServiceSettings, OpcUa_UInt32 a_RetransmitSequenceNumber, UaClient_Subscription_Republish_CB a_pfCallback, OpcUa_Void *a_pUserData)
 Asynchronous republish call to get lost notifications. More...
 

Detailed Description

Typedef Documentation

typedef OpcUa_Void(* UaClient_Subscription_CreateMonitoredItems_CB)(const UaClient_Subscription *a_pSubscription, OpcUa_ResponseHeader *a_pResponseHeader, OpcUa_Int32 a_NoOfResults, OpcUa_MonitoredItemCreateResult *a_pResults, OpcUa_Int32 a_NoOfDiagnosticInfos, OpcUa_DiagnosticInfo *a_pDiagnosticInfos, OpcUa_Void *a_pUserData)

Asynchronous callback function for calls to UaClient_Subscription_BeginCreateMonitoredItems.

Parameters
a_pSubscriptionThe subscription that was used for the service invocation.
a_pResponseHeaderGeneral information about the response like ServiceResult and diagnostics.
a_NoOfResultsNumber of elements in a_pResults.
a_pResultsList of results for the MonitoredItems to create.
The size and order of the list matches the size and order of the OpcUa_CreateMonitoredItemsRequest::ItemsToCreate request parameter.
a_NoOfDiagnosticInfosNumber of elements in a_pDiagnosticInfos.
a_pDiagnosticInfosList of diagnostic information for the MonitoredItems to create.
The size and order of the list matches the size and order of the OpcUa_CreateMonitoredItemsRequest::ItemsToCreate request parameter. This list is empty if diagnostics information was not requested in the request header or if no diagnostic information was encountered in processing of the request.
a_pUserDataThe user data that was passed to UaClient_Subscription_BeginCreateMonitoredItems.
typedef OpcUa_Void(* UaClient_Subscription_CreateSubscription_CB)(UaClient_Subscription *a_pSubscription, OpcUa_StatusCode a_status, OpcUa_ResponseHeader *a_pResponseHeader, OpcUa_Void *a_pUserData)

Asynchronous callback function for calls to UaClient_Subscription_BeginCreateSubscription.

Parameters
a_pSubscriptionThe subscription that was created.
a_statusOpcUa_Good if creating the subscription succeeded.
a_pResponseHeaderGeneral information about the response like ServiceResult and diagnostics.
a_pUserDataThe user data that was passed to UaClient_Subscription_BeginCreateSubscription.
typedef OpcUa_Void(* UaClient_Subscription_DataChange_CB)(UaClient_Subscription *a_pSubscription, OpcUa_Int32 a_noOfMonitoredItems, OpcUa_MonitoredItemNotification *a_pMonitoredItems, OpcUa_Int32 a_noOfDiagnosticInfos, OpcUa_DiagnosticInfo *a_pDiagnosticInfos)

Send changed data.

This callback function provides data notifications of a subscription.

Data changes may arrive for monitored items before the creation of the monitored item is completed and the CreateMonitoredItems call returns. The client application must be prepared for that and ClientHandles passed in to CreateMonitoredItems must be valid and usable before CreateMonitoredItems returns.

Data changes may also arrive after monitored items are deleted, sampling is turned off, or after the publishing is disabled.

This callback is normally not called faster than configured in UaClient_Subscription::PublishingInterval but this is controlled by the OPC UA Server and not by the client SDK. If the number of notifications in one publishing interval exceeds the setting UaClient_Subscription::MaxNotificationsPerPublish, the OPC UA Server will send more than one Publish response and this callback may be called more than one time in the publishing interval.

If no new data is available in a publishing interval, the UaClient_Subscription_DataChange_CB is not called and the UaClient_Subscription_KeepAlive_CB callback may be called depending on the settings in UaClient_Subscription::MaxKeepAliveCount.

typedef OpcUa_Void(* UaClient_Subscription_DeleteMonitoredItems_CB)(const UaClient_Subscription *a_pSubscription, OpcUa_ResponseHeader *a_pResponseHeader, OpcUa_Int32 a_NoOfResults, OpcUa_StatusCode *a_pResults, OpcUa_Int32 a_NoOfDiagnosticInfos, OpcUa_DiagnosticInfo *a_pDiagnosticInfos, OpcUa_Void *a_pUserData)

Asynchronous callback function for calls to UaClient_Subscription_BeginDeleteMonitoredItems.

Parameters
a_pSubscriptionThe subscription that was used for the service invocation.
a_pResponseHeaderGeneral information about the response like ServiceResult and diagnostics.
a_NoOfResultsNumber of elements in a_pResults.
a_pResultsList of StatusCodes for the MonitoredItems to delete.
The size and order of the list matches the size and order of the monitoredItemIds request parameter.
a_NoOfDiagnosticInfosNumber of elements in a_pDiagnosticInfos.
a_pDiagnosticInfosList of diagnostic information for the MonitoredItems to delete.
The size and order of the list matches the size and order of the monitoredItemIds request parameter. This list is empty if diagnostics information was not requested in the request header or if no diagnostic information was encountered in processing of the request.
a_pUserDataThe user data that was passed to UaClient_Subscription_BeginDeleteMonitoredItems.
typedef OpcUa_Void(* UaClient_Subscription_DeleteSubscription_CB)(UaClient_Subscription *a_pSubscription, OpcUa_StatusCode a_status, OpcUa_ResponseHeader *a_pResponseHeader, OpcUa_Void *a_pUserData)

Asynchronous callback function for calls to UaClient_Subscription_BeginDeleteSubscription.

Parameters
a_pSubscriptionThe subscription that was deleted.
a_statusOpcUa_Good if deleting the subscription succeeded.
a_pResponseHeaderGeneral information about the response like ServiceResult and diagnostics.
a_pUserDataThe user data that was passed to UaClient_Subscription_BeginDeleteSubscriptions.
typedef OpcUa_Void(* UaClient_Subscription_KeepAlive_CB)(UaClient_Subscription *a_pSubscription)

Send subscription keep alive.

This callback function provides the keep alive messages sent by the server if no changed data or events are available.

The frequency of calls to this callback function depends on the settings in UaClient_Subscription::MaxKeepAliveCount and the availability of data and events.

typedef OpcUa_Void(* UaClient_Subscription_ModifyMonitoredItems_CB)(const UaClient_Subscription *a_pSubscription, OpcUa_ResponseHeader *a_pResponseHeader, OpcUa_Int32 a_NoOfResults, OpcUa_MonitoredItemModifyResult *a_pResults, OpcUa_Int32 a_NoOfDiagnosticInfos, OpcUa_DiagnosticInfo *a_pDiagnosticInfos, OpcUa_Void *a_pUserData)

Asynchronous callback function for calls to UaClient_Subscription_BeginModifyMonitoredItems.

Parameters
a_pSubscriptionThe subscription that was used for the service invocation.
a_pResponseHeaderGeneral information about the response like ServiceResult and diagnostics.
a_NoOfResultsNumber of elements in a_pResults.
a_pResultsList of results for the MonitoredItems to modify.
The size and order of the list matches the size and order of the OpcUa_ModifyMonitoredItemsRequest::ItemsToModify request parameter.
a_NoOfDiagnosticInfosNumber of elements in a_pDiagnosticInfos.
a_pDiagnosticInfosList of diagnostic information for the MonitoredItems to modify.
The size and order of the list matches the size and order of the OpcUa_ModifyMonitoredItemsRequest::ItemsToModify request parameter. This list is empty if diagnostics information was not requested in the request header or if no diagnostic information was encountered in processing of the request.
a_pUserDataThe user data that was passed to UaClient_Subscription_BeginModifyMonitoredItems.
typedef OpcUa_Void(* UaClient_Subscription_ModifySubscription_CB)(UaClient_Subscription *a_pSubscription, OpcUa_StatusCode a_status, OpcUa_ResponseHeader *a_pResponseHeader, OpcUa_Void *a_pUserData)

Asynchronous callback function for calls to UaClient_Subscription_BeginModifySubscription.

Parameters
a_pSubscriptionThe subscription that was modified.
a_statusOpcUa_Good if modifying the subscription succeeded.
a_pResponseHeaderGeneral information about the response like ServiceResult and diagnostics.
a_pUserDataThe user data that was passed to UaClient_Subscription_BeginModifySubscription.
typedef OpcUa_Void(* UaClient_Subscription_NewEvents_CB)(UaClient_Subscription *a_pSubscription, OpcUa_Int32 a_noOfEvents, OpcUa_EventFieldList *a_pEvents)

Send new events.

This callback function provides event notifications of a subscription.

New events may arrive for monitored items before the creation of the monitored item is completed and the CreateMonitoredItems call returns. The client application must be prepared for that and ClientHandles passed in to CreateMonitoredItems must be valid and usable before CreateMonitoredItems returns.

New events may also arrive after monitored items are deleted, sampling is turned off, or after the publishing is disabled.

This callback is normally not called faster than configured in UaClient_Subscription::PublishingInterval but this is controlled by the OPC UA Server and not by the client SDK. If the number of notifications in one publishing interval exceeds the setting UaClient_Subscription::MaxNotificationsPerPublish, the OPC UA Server will send more than one Publish response and this callback may be called more than one time in the publishing interval.

If no new events are available in a publishing interval, UaClient_Subscription_NewEvents_CB is not called and the UaClient_Subscription_KeepAlive_CB callback may be called depending on the settings in UaClient_Subscription::MaxKeepAliveCount.

typedef OpcUa_Void(* UaClient_Subscription_NotificationsMissing_CB)(UaClient_Subscription *a_pSubscription, OpcUa_UInt32 a_previousSequenceNumber, OpcUa_UInt32 a_newSequenceNumber)

Informs the client about missing notification messages.

The client SDK monitors the sequence numbers of the received data and event notifications and reports gaps in the sequence numbers using this callback method. The client can use the Republish service to request the missing notifications.

typedef OpcUa_Void(* UaClient_Subscription_Republish_CB)(const UaClient_Subscription *a_pSubscription, OpcUa_ResponseHeader *a_pResponseHeader, OpcUa_NotificationMessage *a_pNotificationMessage, OpcUa_Void *a_pUserData)

Asynchronous callback function for calls to UaClient_Subscription_BeginRepublish.

Parameters
a_pSubscriptionThe subscription that was used for the service invocation.
a_pResponseHeaderGeneral information about the response like ServiceResult and diagnostics.
a_pNotificationMessageThe requested NotificationMessage.
a_pUserDataThe user data that was passed to UaClient_Subscription_BeginRepublish.
typedef OpcUa_Void(* UaClient_Subscription_SetMonitoringMode_CB)(const UaClient_Subscription *a_pSubscription, OpcUa_ResponseHeader *a_pResponseHeader, OpcUa_Int32 a_NoOfResults, OpcUa_StatusCode *a_pResults, OpcUa_Int32 a_NoOfDiagnosticInfos, OpcUa_DiagnosticInfo *a_pDiagnosticInfos, OpcUa_Void *a_pUserData)

Asynchronous callback function for calls to UaClient_Subscription_BeginSetMonitoringMode.

Parameters
a_pSubscriptionThe subscription that was used for the service invocation.
a_pResponseHeaderGeneral information about the response like ServiceResult and diagnostics.
a_NoOfResultsNumber of elements in a_pResults.
a_pResultsList of StatusCodes for the MonitoredItems to enable/disable.
The size and order of the list matches the size and order of the OpcUa_SetMonitoringModeRequest::MonitoredItemIds request parameter.
a_NoOfDiagnosticInfosNumber of elements in a_pDiagnosticInfos.
a_pDiagnosticInfosList of diagnostic information for the MonitoredItems to enable/disable.
The size and order of the list matches the size and order of the OpcUa_SetMonitoringModeRequest::MonitoredItemIds request parameter. This list is empty if diagnostics information was not requested in the request header or if no diagnostic information was encountered in processing of the request.
a_pUserDataThe user data that was passed to UaClient_Subscription_BeginSetMonitoringMode.
typedef OpcUa_Void(* UaClient_Subscription_SetPublishingMode_CB)(const UaClient_Subscription *a_pSubscription, OpcUa_ResponseHeader *a_pResponseHeader, OpcUa_Int32 a_NoOfResults, OpcUa_StatusCode *a_pResults, OpcUa_Int32 a_NoOfDiagnosticInfos, OpcUa_DiagnosticInfo *a_pDiagnosticInfos, OpcUa_Void *a_pUserData)

Asynchronous callback function for calls to UaClient_Subscription_BeginSetPublishingMode.

Parameters
a_pSubscriptionThe subscription that was used for the service invocation.
a_pResponseHeaderGeneral information about the response like ServiceResult and diagnostics.
a_NoOfResultsNumber of elements in a_pResults.
a_pResultsList of StatusCodes for the Subscriptions to enable/disable.
The size and order of the list matches the size and order of the subscriptionIds request parameter.
a_NoOfDiagnosticInfosNumber of elements in a_pDiagnosticInfos.
a_pDiagnosticInfos
a_pUserDataThe user data that was passed to UaClient_Subscription_BeginSetPublishingMode.
typedef OpcUa_Void(* UaClient_Subscription_SetTriggering_CB)(const UaClient_Subscription *a_pSubscription, OpcUa_ResponseHeader *a_pResponseHeader, OpcUa_Int32 a_NoOfAddResults, OpcUa_StatusCode *a_pAddResults, OpcUa_Int32 a_NoOfAddDiagnosticInfos, OpcUa_DiagnosticInfo *a_pAddDiagnosticInfos, OpcUa_Int32 a_NoOfRemoveResults, OpcUa_StatusCode *a_pRemoveResults, OpcUa_Int32 a_NoOfRemoveDiagnosticInfos, OpcUa_DiagnosticInfo *a_pRemoveDiagnosticInfos, OpcUa_Void *a_pUserData)

Asynchronous callback function for calls to UaClient_Subscription_BeginSetTriggering.

Parameters
a_pSubscriptionThe subscription that was used for the service invocation.
a_pResponseHeaderGeneral information about the response like ServiceResult and diagnostics.
a_NoOfAddResultsNumber of elements in a_pAddResults.
a_pAddResultsList of StatusCodes for the items to add.
The size and order of the list matches the size and order of the OpcUa_SetTriggeringRequest::LinksToAdd parameter specified in the request.
a_NoOfAddDiagnosticInfosNumber of elements in a_pAddDiagnosticInfos.
a_pAddDiagnosticInfosList of diagnostic information for the links to add.
The size and order of the list matches the size and order of the request parameter. This list is empty if diagnostics information was not requested in the request header or if no diagnostic information was encountered in processing of the request.
a_NoOfRemoveResultsNumber of elements in a_pRemoveResults.
a_pRemoveResultsList of StatusCodes for the items to delete.
The size and order of the list matches the size and order of the parameter specified in the request.
a_NoOfRemoveDiagnosticInfosNumber of elements in a_pRemoveDiagnosticInfos.
a_pRemoveDiagnosticInfosList of diagnostic information for the links to delete.
The size and order of the list matches the size and order of the request parameter. This list is empty if diagnostics information was not requested in the request header or if no diagnostic information was encountered in processing of the request.
a_pUserDataThe user data that was passed to UaClient_Subscription_BeginSetTriggering.
typedef OpcUa_Void(* UaClient_Subscription_StatusChanged_CB)(UaClient_Subscription *a_pSubscription, OpcUa_StatusCode a_status)

Send subscription state change.

This callback function informs the client if the status of a subscription changes. This can happen after a connection error that lasted longer than the lifetime of the subscription. The lifetime is calculated from UaClient_Subscription::PublishingInterval x UaClient_Subscription::MaxKeepAliveCount x UaClient_Subscription::LifetimeCount. A client must create a new subscription to continue data or event monitoring if this callback indicates a bad status for the subscription. UaClient_Subscription_Delete should be called even if the subscription is no longer valid in the server to clear the client side subscription object.

Function Documentation

OpcUa_StatusCode UaClient_Subscription_BeginCreateMonitoredItems ( UaClient_Subscription a_pSubscription,
UaClient_ServiceSettings a_pServiceSettings,
OpcUa_TimestampsToReturn  a_TimestampsToReturn,
OpcUa_Int32  a_NoOfItemsToCreate,
const OpcUa_MonitoredItemCreateRequest a_pItemsToCreate,
UaClient_Subscription_CreateMonitoredItems_CB  a_pfCallback,
OpcUa_Void *  a_pUserData 
)

Asynchronous call to create a list of monitored items in the subscription.

This service is used to create and add one or more MonitoredItems to a Subscription. A MonitoredItem is deleted automatically by the Server when the Subscription is deleted. Deleting a MonitoredItem causes its entire set of triggered item links to be deleted, but has no effect on the MonitoredItems referenced by the triggered items.

Calling the CreateMonitoredItems service repetitively to add a small number of MonitoredItems each time may adversely affect the performance of the Server. Instead, Clients should add a complete set of MonitoredItems to a Subscription whenever possible.

When a user adds a monitored item that the user is denied read access to, the add operation for the item shall succeed and the bad status Bad_NotReadable or Bad_UserAccessDenied shall be returned in the Publish response. This is the same behaviour for the case where the access rights are changed after the call to CreateMonitoredItems. If the access rights change to read rights, the Server shall start sending data for the MonitoredItem. The same procedure shall be applied for an IndexRange that does not deliver data for the current value but could deliver data in the future.

Monitored Nodes can be removed from the AddressSpace after the creation of a MonitoredItem. This does not affect the validity of the MonitoredItem but a Bad_NodeIdUnknown shall be returned in the Publish response.

The return diagnostic info setting in the request header of the CreateMonitoredItems or the last ModifyMonitoredItems Service is applied to the Monitored Items and is used as the diagnostic information settings when sending notifications in the Publish response.

Illegal request values for parameters that can be revised do not generate errors. Instead, the server will choose default values and indicate them in the corresponding revised parameter.

Parameters
a_pSubscriptionThe subscription to use for the service invocation.
a_pServiceSettingsThe general service settings like timeout. See UaClient_ServiceSettings for details. The Server-assigned identifier for the Subscription that will report Notifications for this MonitoredItem.
a_TimestampsToReturnAn enumeration that specifies the timestamp Attributes to be transmitted for each MonitoredItem.
When monitoring Events, this applies only to Event fields that are of type DataValue.
a_NoOfItemsToCreateNumber of elements in a_pItemsToCreate.
a_pItemsToCreateA list of MonitoredItems to be created and assigned to the specified Subscription.
a_pfCallbackThe callback function to use when the async call completes.
a_pUserDataThe user data that is passed to the callback function.
Returns
OpcUa_Good if the invocation succeeded, an appropriate error code otherwise.
OpcUa_StatusCode UaClient_Subscription_BeginCreateSubscription ( UaClient_Subscription a_pSubscription,
UaClient_ServiceSettings a_pServiceSettings,
UaClient_Subscription_CreateSubscription_CB  a_pfCallback,
OpcUa_Void *  a_pUserData 
)

Asynchronous call to create a Subscription.

Subscriptions monitor a set of MonitoredItems for notifications and return them to the Client in response to Publish requests.

Parameters
a_pSubscriptionThe subscription to create.
a_pServiceSettingsThe general service settings like timeout. See UaClient_ServiceSettings for details.
a_pfCallbackThe callback function to use when the async call completes.
a_pUserDataThe user data that is passed to the callback function.
Returns
OpcUa_Good if the invocation succeeded, an appropriate error code otherwise.
OpcUa_StatusCode UaClient_Subscription_BeginDeleteMonitoredItems ( UaClient_Subscription a_pSubscription,
UaClient_ServiceSettings a_pServiceSettings,
OpcUa_Int32  a_NoOfMonitoredItemIds,
const OpcUa_UInt32 *  a_pMonitoredItemIds,
UaClient_Subscription_DeleteMonitoredItems_CB  a_pfCallback,
OpcUa_Void *  a_pUserData 
)

Asynchronous call to delete monitored items.

This Service is used to remove one or more MonitoredItems of a Subscription. When a MonitoredItem is deleted, its triggered item links are also deleted.

Successful removal of a MonitoredItem, however, might not remove notifications for the MonitoredItem that are in the process of being sent by the Subscription. Therefore, Clients may receive notifications for the MonitoredItem after they have received a positive response that the MonitoredItem has been deleted.

Parameters
a_pSubscriptionThe subscription to use for the service invocation.
a_pServiceSettingsThe general service settings like timeout. See UaClient_ServiceSettings for details. The Server-assigned identifier for the Subscription that contains the MonitoredItems to be deleted
a_NoOfMonitoredItemIdsNumber of elements in a_pMonitoredItemIds.
a_pMonitoredItemIdsList of Server-assigned ids for the MonitoredItems to be deleted.
a_pfCallbackThe callback function to use when the async call completes.
a_pUserDataThe user data that is passed to the callback function.
Returns
OpcUa_Good if the invocation succeeded, an appropriate error code otherwise.
OpcUa_StatusCode UaClient_Subscription_BeginDeleteSubscription ( UaClient_Subscription a_pSubscription,
UaClient_ServiceSettings a_pServiceSettings,
UaClient_Subscription_DeleteSubscription_CB  a_pfCallback,
OpcUa_Void *  a_pUserData 
)

Asynchronous call to delete one or more Subscriptions that belong to the Client's Session.

Successful completion of this Service causes all MonitoredItems that use the Subscription to be deleted. If this is the last Subscription for the Session, then all Publish requests still queued for that Session are dequeued and shall be returned with Bad_NoSubscription.

Subscriptions that were transferred to another Session must be deleted by the Client that owns the Session.

Parameters
a_pSubscriptionThe subscription to delete.
a_pServiceSettingsThe general service settings like timeout. See UaClient_ServiceSettings for details.
a_pfCallbackThe callback function to use when the async call completes.
a_pUserDataThe user data that is passed to the callback function.
Returns
OpcUa_Good if the invocation succeeded, an appropriate error code otherwise.
OpcUa_StatusCode UaClient_Subscription_BeginModifyMonitoredItems ( UaClient_Subscription a_pSubscription,
UaClient_ServiceSettings a_pServiceSettings,
OpcUa_TimestampsToReturn  a_TimestampsToReturn,
OpcUa_Int32  a_NoOfItemsToModify,
const OpcUa_MonitoredItemModifyRequest a_pItemsToModify,
UaClient_Subscription_ModifyMonitoredItems_CB  a_pfCallback,
OpcUa_Void *  a_pUserData 
)

Asynchronous call to modify monitored items.

This service is used to modify MonitoredItems of a Subscription. Changes to the MonitoredItem settings shall be applied immediately by the Server. They take effect as soon as practical, but not later than twice the new revisedSamplingInterval.

The return diagnostic info setting in the request header of the CreateMonitoredItems or the last ModifyMonitoredItems Service is applied to the Monitored Items and is used as the diagnostic information settings when sending notifications in the Publish response.

Illegal request values for parameters that can be revised do not generate errors. Instead the server will choose default values and indicate them in the corresponding revised parameter.

Parameters
a_pSubscriptionThe subscription to use for the service invocation.
a_pServiceSettingsThe general service settings like timeout. See UaClient_ServiceSettings for details. The Server-assigned identifier for the Subscription used to qualify the monitoredItemId
a_TimestampsToReturnAn enumeration that specifies the timestamp Attributes to be transmitted for each MonitoredItem to be modified.
When monitoring Events, this applies only to Event fields that are of type DataValue.
a_NoOfItemsToModifyNumber of elements in a_pItemsToModify.
a_pItemsToModifyThe list of MonitoredItems to modify.
a_pfCallbackThe callback function to use when the async call completes.
a_pUserDataThe user data that is passed to the callback function.
Returns
OpcUa_Good if the invocation succeeded, an appropriate error code otherwise.
OpcUa_StatusCode UaClient_Subscription_BeginModifySubscription ( UaClient_Subscription a_pSubscription,
UaClient_ServiceSettings a_pServiceSettings,
UaClient_Subscription_ModifySubscription_CB  a_pfCallback,
OpcUa_Void *  a_pUserData 
)

Asynchronous call to modify a Subscription.

Illegal request values for parameters that can be revised do not generate errors. Instead the server will choose default values and indicate them in the corresponding revised parameter.

Changes to the Subscription settings shall be applied immediately by the Server. They take effect as soon as practical but not later than twice the new RevisedPublishingInterval.

Parameters
a_pSubscriptionThe subscription to modify.
a_pServiceSettingsThe general service settings like timeout. See UaClient_ServiceSettings for details. The Server-assigned identifier for the Subscription.
a_pfCallbackThe callback function to use when the async call completes.
a_pUserDataThe user data that is passed to the callback function.
Returns
OpcUa_Good if the invocation succeeded, an appropriate error code otherwise.
OpcUa_StatusCode UaClient_Subscription_BeginRepublish ( UaClient_Subscription a_pSubscription,
UaClient_ServiceSettings a_pServiceSettings,
OpcUa_UInt32  a_RetransmitSequenceNumber,
UaClient_Subscription_Republish_CB  a_pfCallback,
OpcUa_Void *  a_pUserData 
)

Asynchronous republish call to get lost notifications.

This Service requests the Subscription to republish a NotificationMessage from its retransmission queue. If the Server does not have the requested message in its retransmission queue, it returns an error response.

Parameters
a_pSubscriptionThe subscription to use for the service invocation.
a_pServiceSettingsThe general service settings like timeout. See UaClient_ServiceSettings for details. The Server assigned identifier for the Subscription to be republished.
a_RetransmitSequenceNumberThe sequence number of a specific NotificationMessage to be republished.
a_pfCallbackThe callback function to use when the async call completes.
a_pUserDataThe user data that is passed to the callback function.
Returns
OpcUa_Good if the invocation succeeded, an appropriate error code otherwise.
OpcUa_StatusCode UaClient_Subscription_BeginSetMonitoringMode ( UaClient_Subscription a_pSubscription,
UaClient_ServiceSettings a_pServiceSettings,
OpcUa_MonitoringMode  a_MonitoringMode,
OpcUa_Int32  a_NoOfMonitoredItemIds,
const OpcUa_UInt32 *  a_pMonitoredItemIds,
UaClient_Subscription_SetMonitoringMode_CB  a_pfCallback,
OpcUa_Void *  a_pUserData 
)

Asynchronous call to set the monitoring mode for a list of monitored items.

This Service is used to set the monitoring mode for one or more MonitoredItems of a Subscription. Setting the mode to DISABLED causes all queued notifications to be deleted.

Parameters
a_pSubscriptionThe subscription to use for the service invocation.
a_pServiceSettingsThe general service settings like timeout. See UaClient_ServiceSettings for details. The Server-assigned identifier for the Subscription used to qualify the monitoredItemIds.
a_MonitoringModeThe monitoring mode to be set for the MonitoredItems.
a_NoOfMonitoredItemIdsNumber of elements in a_pMonitoredItemIds.
a_pMonitoredItemIdsList of Server-assigned IDs for the MonitoredItems.
a_pfCallbackThe callback function to use when the async call completes.
a_pUserDataThe user data that is passed to the callback function.
Returns
OpcUa_Good if the invocation succeeded, an appropriate error code otherwise.
OpcUa_StatusCode UaClient_Subscription_BeginSetPublishingMode ( UaClient_Subscription a_pSubscription,
UaClient_ServiceSettings a_pServiceSettings,
OpcUa_Boolean  a_PublishingEnabled,
OpcUa_Int32  a_NoOfSubscriptionIds,
const OpcUa_UInt32 *  a_pSubscriptionIds,
UaClient_Subscription_SetPublishingMode_CB  a_pfCallback,
OpcUa_Void *  a_pUserData 
)

Asynchronous call to enable sending of Notifications on one or more Subscriptions.

Parameters
a_pSubscriptionThe subscription to use for the service invocation.
a_pServiceSettingsThe general service settings like timeout. See UaClient_ServiceSettings for details.
a_PublishingEnabledA Boolean parameter indicating whether publishing is enabled.
It has the following values:
TRUE
publishing of NotificationMessages is enabled for the Subscription.
FALSE
publishing of NotificationMessages is disabled for the Subscription.

The value of this parameter does not affect the value of the monitoring mode Attribute of MonitoredItems. Setting this value to FALSE does not discontinue the sending of keep-alive Messages.
a_NoOfSubscriptionIdsNumber of elements in a_pSubscriptionIds.
a_pSubscriptionIdsList of Server-assigned identifiers for the Subscriptions to enable or disable.
a_pfCallbackThe callback function to use when the async call completes.
a_pUserDataThe user data that is passed to the callback function.
Returns
OpcUa_Good if the invocation succeeded, an appropriate error code otherwise.
OpcUa_StatusCode UaClient_Subscription_BeginSetTriggering ( UaClient_Subscription a_pSubscription,
UaClient_ServiceSettings a_pServiceSettings,
OpcUa_UInt32  a_TriggeringItemId,
OpcUa_Int32  a_NoOfLinksToAdd,
const OpcUa_UInt32 *  a_pLinksToAdd,
OpcUa_Int32  a_NoOfLinksToRemove,
const OpcUa_UInt32 *  a_pLinksToRemove,
UaClient_Subscription_SetTriggering_CB  a_pfCallback,
OpcUa_Void *  a_pUserData 
)

Asynchronously changes the triggering for a monitored item.

This service is used to create and delete triggering links for a triggering item. The triggering item and the items to report shall belong to the same subscription.

Each triggering link links a triggering item to an item to report. Each link is represented by the MonitoredItem id for the item to report. An error code is returned if this id is invalid.

Parameters
a_pSubscriptionThe subscription to use for the service invocation.
a_pServiceSettingsThe general service settings like timeout. See UaClient_ServiceSettings for details. The Server-assigned identifier for the subscription that contains the triggering item and the items to report.
a_TriggeringItemIdServer-assigned ID for the MonitoredItem used as the triggering item.
a_NoOfLinksToAddNumber of elements in a_pLinksToAdd.
a_pLinksToAddThe list of Server-assigned IDs of the items to report that are to be added as triggering links.
The list of linksToRemove is processed before the linksToAdd.
a_NoOfLinksToRemoveNumber of elements in a_pLinksToRemove.
a_pLinksToRemoveThe list of Server-assigned IDs of the items to report for the triggering links to be deleted.
The list of linksToRemove is processed before the linksToAdd.
a_pfCallbackThe callback function to use when the async call completes.
a_pUserDataThe user data that is passed to the callback function.
Returns
OpcUa_Good if the invocation succeeded, an appropriate error code otherwise.
OpcUa_StatusCode UaClient_Subscription_Create ( UaClient_Session a_pSession,
const UaClient_Subscription_Callback a_pCallback,
UaClient_Subscription **  a_ppSubscription 
)

Create a subscription and initialize it with default values.

OpcUa_StatusCode UaClient_Subscription_Delete ( UaClient_Subscription **  a_ppSubscription)

Delete a subscription.