C++ Based OPC UA Client/Server/PubSub SDK
1.7.6.537
|
Implementation of the interface IOManager operating on a generic address space node model. More...
#include <iomanageruanode.h>
Inherits IOManager.
Inherited by NodeManagerBase.
Public Member Functions | |
IOManagerUaNode () | |
Creates an IOManagerUaNode instance initialized with default values. More... | |
virtual | ~IOManagerUaNode () |
Destroys the IOManagerUaNode object. More... | |
virtual UaStatus | startUpIO (ServerManager *pServerManager) |
Starts and initalizes the IOManager. More... | |
virtual UaStatus | shutDownIO () |
Shut down IOManager. | |
OpcUa_Boolean | isIOStarted () |
Check if IOManager is started. | |
UaStatus | restartIO () |
Restart IOManager. | |
virtual UaStatus | readValues (const UaVariableArray &arrUaVariables, UaDataValueArray &arrDataValues) |
Reads the value attributes for a list of UaVariables. More... | |
virtual UaStatus | writeValues (const UaVariableArray &arrUaVariables, const PDataValueArray &arrpDataValues, UaStatusCodeArray &arrStatusCodes) |
Writes the value attributes for a list of UaVariables. More... | |
virtual OpcUa_Boolean | beforeSetAttributeValue (Session *pSession, UaNode *pNode, OpcUa_Int32 attributeId, const UaDataValue &dataValue, OpcUa_Boolean &checkWriteMask) |
Event that is called before the value of an attribute of a Node is set. More... | |
virtual void | afterSetAttributeValue (Session *pSession, UaNode *pNode, OpcUa_Int32 attributeId, const UaDataValue &dataValue) |
Event that is called after the value of an attribute of a Node was updated. More... | |
virtual void | afterGetAttributeValue (Session *pSession, UaNode *pNode, OpcUa_Int32 attributeId, UaDataValue &dataValue) |
Event that is called after the value of an attribute of a Node was read from the node. More... | |
virtual UaStatus | beforeMonitorAttributeValue (Session *pSession, UaNode *pNode, OpcUa_Int32 attributeId, OpcUa_Boolean &returnErrorInCreate) |
Event that is called before a data monitored item is created. More... | |
virtual void | variableCacheMonitoringChanged (UaVariableCache *pVariable, TransactionType transactionType) |
Event that is called after the monitoring of a cache variable was changed. More... | |
UaStatus | beginTransaction (IOManagerCallback *, const ServiceContext &, OpcUa_UInt32, OpcUa_UInt32, OpcUa_Double, OpcUa_TimestampsToReturn, TransactionType, OpcUa_Handle &) |
Begin a IOManager transaction. More... | |
UaStatus | beginStartMonitoring (OpcUa_Handle, OpcUa_UInt32, IOVariableCallback *, VariableHandle *, MonitoringContext &) |
Begin start monitoring of an item. More... | |
UaStatus | beginModifyMonitoring (OpcUa_Handle, OpcUa_UInt32, OpcUa_UInt32, MonitoringContext &) |
Begin modify monitoring of an item. More... | |
UaStatus | beginStopMonitoring (OpcUa_Handle, OpcUa_UInt32, OpcUa_UInt32) |
Begin stop monitoring of an item. More... | |
UaStatus | beginRead (OpcUa_Handle, OpcUa_UInt32, VariableHandle *, OpcUa_ReadValueId *) |
Begin reading an attribute value of a node. More... | |
UaStatus | beginWrite (OpcUa_Handle, OpcUa_UInt32, VariableHandle *, OpcUa_WriteValue *) |
Begin writing an attribute value for a node. More... | |
UaStatus | finishTransaction (OpcUa_Handle) |
Finish a transaction. More... | |
Public Member Functions inherited from IOManager | |
IOManager () | |
Construction. | |
virtual | ~IOManager () |
Destruction. | |
Additional Inherited Members | |
Public Types inherited from IOManager | |
enum | TransactionType { TransactionRead, TransactionWrite, TransactionMonitorBegin, TransactionMonitorModify, TransactionMonitorStop, TransactionInvalid } |
TransactionType enumeration. More... | |
Implementation of the interface IOManager operating on a generic address space node model.
IOManagerUaNode::IOManagerUaNode | ( | ) |
Creates an IOManagerUaNode instance initialized with default values.
|
virtual |
Destroys the IOManagerUaNode object.
|
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.
|
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.
|
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 behavior is to create the monitored item but to send a bad status in the initial data callback. This behavior can be controlled with the flag returnErrorInCreate.
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 error 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. |
|
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
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. |
|
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.
hIOManagerContext | IOManager handle for the transaction context. This handle is used to identify the transaction in the IOManager. |
callbackHandle | Handle for the node in the callback. |
hIOVariable | The handle of the variable in the IOManager created with beginStartMonitoring. The handle was passed to the SDK in the callback finishStartMonitoring. |
monitoringContext | Object containing the requested settings for the monitored item like sampling interval or deadband. The object is only valid during this method is called |
Implements IOManager.
|
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.
hIOManagerContext | IOManager handle for the transaction context. This handle is used to identify the transaction in the IOManager. |
callbackHandle | Handle for the node in the callback. |
pVariableHandle | Variable handle provided by the NodeManager::getVariableHandle. This object contains the information needed by the IOManager to identify the node to read in its context. The object is reference counted. The reference used by the SDK is released after finishTransaction is called. If the IOManager needs the VariableHandle of asynchronous handling, the IOManager must add its own reference as long as the VariableHandle is used. |
pReadValueId | Context 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. The read context pointer is valid until the transaction is completely finished. |
Implements IOManager.
|
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.
hIOManagerContext | IOManager handle for the transaction context. This handle is used to identify the transaction in the IOManager. |
callbackHandle | Handle for the node in the callback. |
pIOVariableCallback | Callback interface used for data change callbacks to the MonitoredItem managed by the SDK. The callback interface is valid until the monitoring is stopped through beginStopMonitoring. |
pVariableHandle | Variable handle provided by the NodeManager::getVariableHandle. This object contains the information needed by the IOManager to identify the node to monitor in its context. The object is reference counted. The reference used by the SDK is released after finishTransaction is called. If the IOManager needs the VariableHandle of asynchronous handling, the IOManager must add its own reference as long as the VariableHandle is used. |
monitoringContext | Object containing the requested settings for the monitored item like sampling interval or deadband. The object is only valid during this method is called |
Implements IOManager.
|
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.
hIOManagerContext | IOManager handle for the transaction context. This handle is used to identify the transaction in the IOManager. |
callbackHandle | Handle for the node in the callback. |
hIOVariable | The handle of the variable in the IOManager created with beginStartMonitoring. The handle was passed to the SDK in the callback finishStartMonitoring. |
Implements IOManager.
|
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.
pCallback | Callback interface used for the transaction. The IOManager must use this interface to finish the action for each passed node in the transaction. The callback interface pointer is valid until the transaction is completely finished. |
serviceContext | Service context including the session context used for the UA service call. |
hTransaction | Handle for the transaction used by the SDK to identify the transaction in the callbacks. |
totalItemCountHint | A 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. |
maxAge | Max age parameter used only in the Read service. |
timestampsToReturn | Indicates 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 |
transactionType | Type of the transaction. The possible enum values are:
|
hIOManagerContext | Handle to the context in the IOManager for the transaction. The handle is managed by the IOManager and must be valid until the transaction is completely finished. This handle is passed into the IOManager begin methods to identify the transaction context in the IOManager. |
Implements IOManager.
|
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.
OPC UA is not providing data type conversions on the server side. The client is responsible for converting the variable data type to the data type he needs for internally. The server must return OpcUa_BadTypeMismatch if the client is not writing the variable data type or a subtype of it. The only exception is an array of Byte. In this case the client is allowed to write a ByteString instead since environments like JAVA and .NET can not preserve the distinction between a ByteString and a one dimensional array of Byte.
hIOManagerContext | IOManager handle for the transaction context. This handle is used to identify the transaction in the IOManager. |
callbackHandle | Handle for the node in the callback. The in parameters are valid until the last finishRead method is called for the transaction. |
pVariableHandle | Variable handle provided by the NodeManager::getVariableHandle. This object contains the information needed by the IOManager to identify the node to write in its context. The object is reference counted. The reference used by the SDK is released after finishTransaction is called. If the IOManager needs the VariableHandle of asynchronous handling, the IOManager must add its own reference as long as the VariableHandle is used. |
pWriteValue | Context 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 The write context pointer is valid until the transaction is completely finished. |
Implements IOManager.
|
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
hIOManagerContext | IOManager handle for the transaction context. This handle is used to identify the transaction to finish in the IOManager. |
Implements IOManager.
|
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.
This method is called for Read calls from OPC UA clients and for monitoring of Variables where the UaVariable::valueHandling is not set to UaVariable_Value_CacheIsSource.
This method will be called for monitored items even if the Variable node was removed from the NodeManager. Monitored items are created by clients and they stay valid even if the node they were created for was removed. Only the status of the monitored item must change to BadNodeIdUnknown in `* this case. The Variable will be invalidated during removal from address space but will stay in memory until all monitored items are reoved for it. When the Variable is made invalid, the user data is also set invalid by calling UserDataBase::setInvalid(). The application specific user data class must implement this method and must set the user data invalid. If the user data is invalid for a Node, readValue shall return BadNodeIdInvalid in this case.
arrUaVariables | An 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. |
arrDataValues | An array of UaDataValue classes used to return the read values. |
Reimplemented in NodeManagerRoot, and NodeManagerNS1.
|
virtual |
Starts and initalizes the IOManager.
pServerManager | Interface to the central ServerManager object. |
|
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 acquisition if the values in the cache are only update when the variable is monitored.
It is not allowed to block this method since it is called from the network thread
pVariable | [in] UaVariableCache that was changed. The class UaVariableCache provides information about the number of subscribed monitored items (UaVariableCache::signalCount) and the smallest requrested sampling interval (UaVariableCache::getMinSamplingInterval). |
transactionType | [in] Type of transaction. Could be MONITOR_BEGIN, MONITOR_MODIFY or MONITOR_STOP |
|
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.
This method is called for Write calls from OPC UA clients for Variables where the UaVariable::valueHandling is not set to UaVariable_Value_CacheIsSource.
arrUaVariables | An 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. |
arrpDataValues | Array of pointers to OpcUa_DataValue structures containing the data to write. |
arrStatusCodes | An array of OpcUa_StatusCode values used to indicate if the write succeeds on a single variable base. |
Reimplemented in NodeManagerRoot.