#include <iomanageruanode.h>

Inheritance diagram for IOManagerUaNode:
Collaboration diagram for IOManagerUaNode:

List of all members.

Public Member Functions

 IOManagerUaNode ()
virtual ~IOManagerUaNode ()
virtual UaStatus startUpIO (ServerManager *pServerManager)
virtual UaStatus shutDownIO ()
virtual UaStatus readValues (const UaVariableArray &arrUaVariables, UaDataValueArray &arrDataValues)
virtual UaStatus writeValues (const UaVariableArray &arrUaVariables, const PDataValueArray &arrpDataValues, UaStatusCodeArray &arrStatusCodes)
virtual OpcUa_Boolean beforeSetAttributeValue (Session *pSession, UaNode *pNode, OpcUa_Int32 attributeId, const UaDataValue &dataValue, OpcUa_Boolean &checkWriteMask)
virtual void afterSetAttributeValue (Session *pSession, UaNode *pNode, OpcUa_Int32 attributeId, const UaDataValue &dataValue)
virtual void afterGetAttributeValue (Session *pSession, UaNode *pNode, OpcUa_Int32 attributeId, UaDataValue &dataValue)
virtual UaStatus beforeMonitorAttributeValue (Session *pSession, UaNode *pNode, OpcUa_Int32 attributeId, OpcUa_Boolean &returnErrorInCreate)
virtual void variableCacheMonitoringChanged (UaVariableCache *pVariable, TransactionType transactionType)
UaStatus beginTransaction (IOManagerCallback *, const ServiceContext &, OpcUa_UInt32, OpcUa_UInt32, OpcUa_Double, OpcUa_TimestampsToReturn, TransactionType, OpcUa_Handle &)
UaStatus beginStartMonitoring (OpcUa_Handle, OpcUa_UInt32, IOVariableCallback *, VariableHandle *, MonitoringContext &)
UaStatus beginModifyMonitoring (OpcUa_Handle, OpcUa_UInt32, OpcUa_UInt32, MonitoringContext &)
UaStatus beginStopMonitoring (OpcUa_Handle, OpcUa_UInt32, OpcUa_UInt32)
UaStatus beginRead (OpcUa_Handle, OpcUa_UInt32, VariableHandle *, OpcUa_ReadValueId *)
UaStatus beginWrite (OpcUa_Handle, OpcUa_UInt32, VariableHandle *, OpcUa_WriteValue *)
UaStatus finishTransaction (OpcUa_Handle)

Detailed Description

Implementation of the interface IOManager operating on a generic address space node model.


Constructor & Destructor Documentation

IOManagerUaNode::IOManagerUaNode (  )

construction

IOManagerUaNode::~IOManagerUaNode (  ) [virtual]

destruction


Member Function Documentation

void IOManagerUaNode::afterGetAttributeValue ( Session pSession,
UaNode pNode,
OpcUa_Int32  attributeId,
UaDataValue dataValue 
) [virtual]

Event that is called after the value of an attribute of a Node was read from the node. This method needs to be overwritten by a derived class to change the value returned to the client. This can be used to return different localized text values or to check if the client is allowed to read the value.

Parameters:
pSession[in] Interface to the Session context for the attribute read.
pNode[in] Interface of the UaNode to read.
attributeId[in] Id of the attribute to read.
dataValue[in/out] Value for the attribute.
void IOManagerUaNode::afterSetAttributeValue ( Session pSession,
UaNode pNode,
OpcUa_Int32  attributeId,
const UaDataValue dataValue 
) [virtual]

Event that is called after the value of an attribute of a Node was updated. This method needs to be overwritten by a derived class to get informed about an attribute change.

Parameters:
pSession[in] Interface to the Session context for the attribute write.
pNode[in] Interface of the updated UaNode.
attributeId[in] Id of the updated attribute.
dataValue[in] New value for the attribute.
UaStatus IOManagerUaNode::beforeMonitorAttributeValue ( Session pSession,
UaNode pNode,
OpcUa_Int32  attributeId,
OpcUa_Boolean &  returnErrorInCreate 
) [virtual]

Event that is called before a data monitored item is created. This method needs to be overwritten by a derived class to influence the creation of monitored items based on the user rights. This can be used to reject the creation of a monitored item based on the user rights. The OPC UA recommended behaviour is to create the monitored item but to send a bad status in the intial data callback. This behaviour can be controlled with the flag returnErrorInCreate.

Parameters:
pSession[in] Interface to the Session context for the attribute read.
pNode[in] Interface of the UaNode to read.
attributeId[in] Id of the attribute to read.
returnErrorInCreate[out] Indicates in the erorr case if the error should be returned in CreateMonitoredItems or in the first data change notification. The recommended option is to return the error in the first data change notification.
Returns:
OpcUa_Good if the monitored item should be created. Any bad status code like OpcUa_BadUserAccessDenied if the user is not allowed to subsribe for the attribute.
OpcUa_Boolean IOManagerUaNode::beforeSetAttributeValue ( Session pSession,
UaNode pNode,
OpcUa_Int32  attributeId,
const UaDataValue dataValue,
OpcUa_Boolean &  checkWriteMask 
) [virtual]

Event that is called before the value of an attribute of a Node is set. Allows to reject the writing of the attribute. This method needs to be overwritten by a derived class to influence the handling of the writing of the attribute

Parameters:
pSession[in] Interface of the Session context for the attribute write.
pNode[in] Interface of the UaNode to update.
attributeId[in] Attribute id indicating the attribute to set.
dataValue[in] New value for the attribute.
checkWriteMask[out] Flag indicating if the write mask of the node attribute or the access level for the value attribute should be checked in UaNode::setAttributeValue.
Returns:
OpcUa_True if UaNode::setAttributeValue should be called, OpcUa_False if not.
UaStatus IOManagerUaNode::beginModifyMonitoring ( OpcUa_Handle  hIOManagerContext,
OpcUa_UInt32  callbackHandle,
OpcUa_UInt32  hIOVariable,
MonitoringContext monitoringContext 
) [virtual]

Begin modify monitoring of an item. Is called by the SDK for each node in a UA ModifyMonitoredItems service call. It is expected that this method does not block for external communication with the underlying system. See also beginRead description for more details. The corresponding callback method is the finishModifyMonitoring method.

Parameters:
hIOManagerContextIOManager handle for the transaction context. This handle is used to identify the transaction in the IOManager.
callbackHandleHandle for the node in the callback.
hIOVariableThe handle of the variable in the IOManager created with beginStartMonitoring. The handle was passed to the SDK in the callback finishStartMonitoring.
monitoringContextObject containing the requested settings for the monitored item like sampling interval or deadband.
Returns:
Error code

Implements IOManager.

UaStatus IOManagerUaNode::beginRead ( OpcUa_Handle  hIOManagerContext,
OpcUa_UInt32  callbackHandle,
VariableHandle pVariableHandle,
OpcUa_ReadValueId *  pReadValueId 
) [virtual]

Begin reading an attribute value of a node. Is called by the SDK for each node in a UA Read service call. It is expected that this method does not block for external communication with the underlying system. If the read can be done inside the local process memory, the read can be executed and the finishRead method can be called inside this method call. If the underlying system is able to queue the read for the node without blocking for external communication, the beginRead can queue the node in the underlying system. If the communication with the underlying system can block, the node must be stored in the context of the transaction and the communication with the underlying system must be started asynchronous in the finishTransaction method. The corresponding callback method is the finishRead method. The in parameters are valid until the last finishRead method is called for the transaction.

Parameters:
hIOManagerContextIOManager handle for the transaction context. This handle is used to identify the transaction in the IOManager.
callbackHandleHandle for the node in the callback.
pVariableHandleVariable handle provided by the NodeManager::getVariableHandle. This object contains the information needed by the IOManager to identify the node to read in its context.
pReadValueIdContext for the node to read. The context contains the IndexRange and the DataEncoding requested by the client. The other parameters of this context are already handled by the VariableHandle.
Returns:
Error code

Implements IOManager.

UaStatus IOManagerUaNode::beginStartMonitoring ( OpcUa_Handle  hIOManagerContext,
OpcUa_UInt32  callbackHandle,
IOVariableCallback pIOVariableCallback,
VariableHandle pVariableHandle,
MonitoringContext monitoringContext 
) [virtual]

Begin start monitoring of an item. Is called by the SDK for each node in a UA CreateMonitoredItems service call if sampling is enabled or for service calls enabling the sampling for a monitored item. It is expected that this method does not block for external communication with the underlying system. See also beginRead description for more details. The corresponding callback method is the finishStartMonitoring method.

Parameters:
hIOManagerContextIOManager handle for the transaction context. This handle is used to identify the transaction in the IOManager.
callbackHandleHandle for the node in the callback.
pIOVariableCallbackCallback interface used for data change callbacks to the MonitoredItem managed by the SDK.
pVariableHandleVariable handle provided by the NodeManager::getVariableHandle. This object contains the information needed by the IOManager to identify the node to read in its context.
monitoringContextObject containing the requested settings for the monitored item like sampling interval or deadband.
Returns:
Error code

Implements IOManager.

UaStatus IOManagerUaNode::beginStopMonitoring ( OpcUa_Handle  hIOManagerContext,
OpcUa_UInt32  callbackHandle,
OpcUa_UInt32  hIOVariable 
) [virtual]

Begin stop monitoring of an item. Is called by the SDK for each node in a UA DeleteMonitoredItems service call if sampling is enabled for the monitored item to delete or for service calls disabling the sampling for a monitored item. It is expected that this method does not block for external communication with the underlying system. See also beginRead description for more details. The corresponding callback method is the finishStopMonitoring method.

Parameters:
hIOManagerContextIOManager handle for the transaction context. This handle is used to identify the transaction in the IOManager.
callbackHandleHandle for the node in the callback.
hIOVariableThe handle of the variable in the IOManager created with beginStartMonitoring. The handle was passed to the SDK in the callback finishStartMonitoring.
Returns:
Error code

Implements IOManager.

UaStatus IOManagerUaNode::beginTransaction ( IOManagerCallback pCallback,
const ServiceContext serviceContext,
OpcUa_UInt32  hTransaction,
OpcUa_UInt32  totalItemCountHint,
OpcUa_Double  maxAge,
OpcUa_TimestampsToReturn  timestampsToReturn,
TransactionType  transactionType,
OpcUa_Handle &  hIOManagerContext 
) [virtual]

Begin a IOManager transaction. Is called by the SDK before the first begin method call for a transaction. This method must create a context in the IOManager for the transaction.

Parameters:
pCallbackCallback interface used for the transaction. The IOManager must use this interface to finish the action for each passed node in the transaction.
serviceContextService context including the session context used for the UA service call.
hTransactionHandle for the transaction used by the SDK to identify the transaction in the callbacks.
totalItemCountHintA hint for the IOManager about the total number of nodes in the transaction. The IOManager may not be responsible for all nodes but he can use this hint if he wants to optimize memory allocation.
maxAgeMax age parameter used only in the Read service.
timestampsToReturnIndicates which timestamps should be returned in a Read or a Publish response. The possible enum values are: OpcUa_TimestampsToReturn_Source OpcUa_TimestampsToReturn_Server OpcUa_TimestampsToReturn_Both OpcUa_TimestampsToReturn_Neither
transactionTypeType of the transaction. The possible enum values are: READ WRITE MONITOR_BEGIN MONITOR_MODIFY MONITOR_STOP
hIOManagerContextHandle to the context in the IOManager for the transaction. This handle is passed into the IOManager begin methods to identify the transaction context in the IOManager.
Returns:
Error code

Implements IOManager.

UaStatus IOManagerUaNode::beginWrite ( OpcUa_Handle  hIOManagerContext,
OpcUa_UInt32  callbackHandle,
VariableHandle pVariableHandle,
OpcUa_WriteValue *  pWriteValue 
) [virtual]

Begin writing an attribute value for a node. Is called by the SDK for each node in a UA Write service call. It is expected that this method does not block for external communication with the underlying system. See also beginRead description for more details. The corresponding callback method is the finishWrite method.

Parameters:
hIOManagerContextIOManager handle for the transaction context. This handle is used to identify the transaction in the IOManager.
callbackHandleHandle for the node in the callback. The in parameters are valid until the last finishRead method is called for the transaction.
pVariableHandleVariable handle provided by the NodeManager::getVariableHandle. This object contains the information needed by the IOManager to identify the node in its context.
pWriteValueContext for the node to write. The context contains the IndexRange requested by the client. The NodeId and Attribute parameters of this context are already handled by the VariableHandle
Returns:
Error code

Implements IOManager.

UaStatus IOManagerUaNode::finishTransaction ( OpcUa_Handle  hIOManagerContext ) [virtual]

Finish a transaction. Is called by the SDK after the last begin method call for a transaction. If the nodes for the transaction are stored in the transaction context and the access to the underlying system is done in the finishTransaction, this access must be done asynchronous like in an own worker thread. It is expected that this method does not block for external communication with the underlying system. After finishing the communication with the underlying system, the corresponding finish callback methods of the interface IOManagerCallback can be called for each node in the transaction

Parameters:
hIOManagerContextIOManager handle for the transaction context. This handle is used to identify the transaction to finish in the IOManager.
Returns:
Error code

Implements IOManager.

UaStatus IOManagerUaNode::readValues ( const UaVariableArray arrUaVariables,
UaDataValueArray arrDataValues 
) [virtual]

Reads the value attributes for a list of UaVariables. This method needs to be overwritten by a derived class if the value attribute should be read not from cache but from an external data source.

Parameters:
arrUaVariablesAn array of UaVariable interface pointers used to indicate which variables should be read. The implementation of the interface needs to have the necessary information to access the data from the external source.
arrDataValuesAn array of UaDataValue classes used to return the read values.
Returns:
Error code

Reimplemented in NodeManagerNS1, and NodeManagerRoot.

UaStatus IOManagerUaNode::shutDownIO (  ) [virtual]

Shut down IOManager.

UaStatus IOManagerUaNode::startUpIO ( ServerManager pServerManager ) [virtual]

Start up IOManager.

Parameters:
pServerManagerInterface to the central ServerManager object.
void IOManagerUaNode::variableCacheMonitoringChanged ( UaVariableCache pVariable,
TransactionType  transactionType 
) [virtual]

Event that is called after the monitoring of a cache variable was changed. This method needs to be overwritten by a derived class to get informed about monitoring changes for a cache variable. This can be used to start or stop the data aquisition if the values in the cache are only update when the variable is monitored.

Parameters:
pVariable[in] UaVariableCache that was changed. The class UaVariableCache provides information about the number of subscribed monitored items and the smallest requrested sampling interval.
transactionType[in] Type of transaction. Could be MONITOR_BEGIN, MONITOR_MODIFY or MONITOR_STOP
UaStatus IOManagerUaNode::writeValues ( const UaVariableArray arrUaVariables,
const PDataValueArray arrpDataValues,
UaStatusCodeArray &  arrStatusCodes 
) [virtual]

Writes the value attributes for a list of UaVariables. This method needs to be overwritten by a derived class if the value attribute should be written to an external data source.

Parameters:
arrUaVariablesAn array of UaVariable interface pointers used to indicate which variables should be written. The implementation of the interface needs to have the necessary information to update the data in the external source.
arrpDataValuesArray of pointers to OpcUa_DataValue structures containing the data to write.
arrStatusCodesAn array of OpcUa_StatusCode values used to indicate if the write succeeds on a single variable base.
Returns:
Error code

Reimplemented in NodeManagerRoot.


The documentation for this class was generated from the following files:
  • /home/buildbot/work/uasdkcpp/src/uaserver/uaservercpp/coremodule/iomanageruanode.h
  • /home/buildbot/work/uasdkcpp/src/uaserver/uaservercpp/coremodule/iomanageruanode.cpp