C++ Based OPC UA Client/Server/PubSub SDK  1.7.6.537
PubSubDataSetCollectorCallback Class Referenceabstract

Callback class for the PubSub data collector. More...

#include <pubsubserverapplicationcallback.h>

Public Member Functions

virtual bool handleDataSetCollector (PubSubBase::DataSetWriter *pDataSetWriter)=0
 Callback informing the application about the start of the collector. More...
 
virtual UaStatus startMonitoring (PubSubBase::DataSetWriter *pDataSetWriter, DataMonitoredItemSpecArray &dataMonitoredItems)=0
 Callback informing the application about the start of the monitoring for a DataSetWriter. More...
 
virtual UaStatus stopMonitoring (PubSubBase::DataSetWriter *pDataSetWriter, const UaUInt32Array &monitoredItemIds)=0
 Callback informing the application about the stop of the monitoring for a DataSetWriter. More...
 

Detailed Description

Callback class for the PubSub data collector.

Member Function Documentation

virtual bool PubSubDataSetCollectorCallback::handleDataSetCollector ( PubSubBase::DataSetWriter pDataSetWriter)
pure virtual

Callback informing the application about the start of the collector.

Returns true if the data monitoring for this collector is processed by the application.

Returns false if the collector is not handled by the application

Parameters
[in]pDataSetWriterThe affected DataSetWriter
virtual UaStatus PubSubDataSetCollectorCallback::startMonitoring ( PubSubBase::DataSetWriter pDataSetWriter,
DataMonitoredItemSpecArray dataMonitoredItems 
)
pure virtual

Callback informing the application about the start of the monitoring for a DataSetWriter.

If the method returns Bad status for some of the variables, the method will be called again for the DataSetWriter and the failed variables until all variables succeeded or stopMonitoring is called.

The array of dataMonitoredItems specifies through DataMonitoredItemSpec the monitoring parameters and monitoring callback for each DataSet field as input and provides the create result and the monitoredItemId for each DataSet field as output

Each monitored item information contains the NodeId and AttributeId monitored in a OpcUa_ReadValueId. The NodeId is required to identify the Variable to monitor. The AttributeId is normally Value. The RequestedSamplingInterval is just the sampling hint from the PubSub configuration. The actual PublishingInterval is provided by the DataSetWriter.

Each monitored item information contains a callback interface IOVariableCallback for sending item specific data updates. A call to IOVariableCallback::dataChange updates the corresponding queue value in the dataset collector. The DataSetWriter is sending the queue values as DataSetMessages.

{
for (OpcUa_UInt32 i; i < dataMonitoredItems.length(); i++)
{
UaNodeId variableNodeId(dataMonitoredItems[i].m_itemToMonitor.NodeId);
IOVariableCallback* pDataCallback = dataMonitoredItems[i].m_pDataCallback;
// Register variable for monitoring, return the MonitoredItemId used to delete the monitoring
dataMonitoredItems[i].m_monitoredItemId = registerMonitoredItem(variableNodeId, pDataCallback);
if (dataMonitoredItems[i].m_monitoredItemId == 0)
{
dataMonitoredItems[i].m_createResult = OpcUa_BadNodeIdInvalid;
}
else
{
dataMonitoredItems[i].m_createResult = OpcUa_Good;
}
}
}
Parameters
[in]pDataSetWriterThe affected DataSetWriter
[in,out]dataMonitoredItemsArray of DataMonitoredItemSpec objects containing the information for the monitoring of variable values.
virtual UaStatus PubSubDataSetCollectorCallback::stopMonitoring ( PubSubBase::DataSetWriter pDataSetWriter,
const UaUInt32Array monitoredItemIds 
)
pure virtual

Callback informing the application about the stop of the monitoring for a DataSetWriter.

This method is not called, if startMonitoring returned OpcUa_Bad.

Parameters
[in]pDataSetWriterThe affected DataSetWriter
[in]monitoredItemIdsThe handles of the monitored items

The documentation for this class was generated from the following file: