C++ Based OPC UA Client/Server SDK  1.5.3.346

Class definition of the UaVariable. More...

#include <uabasenodes.h>

Inherits UaNode.

Inherited by UaDataVariableDevice, and UaVariableCache.

Public Member Functions

 UaVariable ()
 construction
 
virtual UaDataValue value (Session *pSession)=0
 Returns the value of the Variable. More...
 
virtual UaStatus setValue (Session *pSession, const UaDataValue &dataValue, OpcUa_Boolean checkAccessLevel=OpcUa_True)=0
 Sets the value of the Variable. More...
 
virtual UaNodeId dataType () const =0
 Get the DataType for the Variable. More...
 
virtual OpcUa_Int32 valueRank () const =0
 Get the ValueRank for the Variable. More...
 
virtual OpcUa_Boolean isArrayDimensionsSupported () const =0
 Check if the Node is ArrayDimensionsSupported. More...
 
virtual void arrayDimensions (UaUInt32Array &arrayDimensions) const =0
 Get the arrayDimensions value for the passed UaNode. More...
 
virtual OpcUa_Byte accessLevel () const =0
 Get the AccessLevel for the Variable Value. More...
 
virtual OpcUa_Byte userAccessLevel (Session *pSession) const =0
 Get the UserAccessLevel for the Variable. More...
 
virtual OpcUa_Boolean isMinimumSamplingIntervalSupported () const =0
 Check whether a minimum sampling interval is supported. More...
 
virtual OpcUa_Double minimumSamplingInterval () const =0
 Get the minimum sampling interval of the Variable. More...
 
virtual OpcUa_Boolean historizing () const =0
 Indicates if variable value is currently historized or not. More...
 
virtual OpcUa_UInt32 valueHandling () const
 Get the mode for the handling of the value attribute. More...
 
virtual void setValueHandling (OpcUa_UInt32 valueHandling)
 Set the mode for the handling of the value attribute. More...
 
virtual VariableHandlepVariableHandle ()
 Return the VariableHandle for the Value Attribute of the UaVariable. More...
 
OpcUa_NodeClass nodeClass () const
 Get the NodeClass of the current Node. More...
 
virtual UaStatus setAttributeValue (Session *pSession, OpcUa_Int32 attributeId, const UaDataValue &dataValue, OpcUa_Boolean checkWriteMask)
 Sets the value of an attribute of the Node. More...
 
virtual void getAttributeValue (Session *pSession, OpcUa_Int32 attributeId, UaDataValue &uaDataValue)
 Gets the value of an attribute of the Node. More...
 
- Public Member Functions inherited from UaNode
 UaNode ()
 Construction of the UaNode. More...
 
virtual UaNodeId getKey () const
 Get the key of the node used for the hash table. More...
 
virtual UaReferenceListsgetUaReferenceLists () const
 Get the UaReferenceLists interface for the node. More...
 
virtual UaStatus browse (const ServiceContext &serviceContext, BrowseContext &browseContext, UaReferenceDescriptions &References)=0
 Discover the references of a specified node of a view. More...
 
virtual UaNodeId typeDefinitionId () const
 Get NodeId of the type definition node for this node. More...
 
virtual UaNodeId nodeId () const =0
 Get value of the NodeId attribute of this Node. More...
 
virtual UaQualifiedName browseName () const =0
 Get value of the BrowseName attribute of this Node. More...
 
virtual UaLocalizedText displayName (Session *pSession) const =0
 Get value of the DisplayName attribute of this Node. More...
 
virtual OpcUa_Boolean isDescriptionSupported () const =0
 Flag indicating if the optional attribute Description is supported. More...
 
virtual UaLocalizedText description (Session *pSession) const =0
 Get value of the Description attribute of this Node. More...
 
virtual OpcUa_Boolean isWriteMaskSupported () const =0
 Flag indicating if the optional attribute WriteMask is supported. More...
 
virtual OpcUa_UInt32 writeMask () const =0
 Get value of the WriteMask attribute of this Node. More...
 
virtual OpcUa_Boolean isUserWriteMaskSupported () const =0
 Flag indicating if the optional attribute UserWriteMask is supported. More...
 
virtual OpcUa_UInt32 userWriteMask (Session *pSession) const =0
 Get value of the UserWriteMask attribute of this Node. More...
 
virtual UaNodeId modellingRuleId () const
 Get NodeId of the modeling rule for this node. More...
 
virtual void setUserData (UserDataBase *pUserData)
 Defines the method to set user data handled by a derived class. More...
 
virtual UserDataBasegetUserData () const
 Returns user data provided by a derived class. More...
 
const NodeAccessInfogetAccessInfo () const
 Returns the access info for this node. More...
 
void useAccessInfoFrom (const UaNode *pOther)
 Set the NodeAccessInfo from another node to this node. More...
 
void setAccessInfo (NodeAccessInfo *pAccessInfo)
 Set the NodeAccessInfo for this node. More...
 
void attachAccessInfo (NodeAccessInfo *pAccessInfo)
 Set the NodeAccessInfo for this node. More...
 
- Public Member Functions inherited from ChainEntry
 ChainEntry ()
 construction
 
ChainEntryfind (const UaNodeId &key, ChainEntry **ppPrevious)
 finds the right entry in the chain. More...
 
void add (ChainEntry *pNewEntry)
 adds a new entry to the list. More...
 
void prepend (ChainEntry *pNewEntry)
 prepends a new entry to the list. More...
 
ChainEntryremove (const UaNodeId &key, ChainEntry **ppNext)
 removes an entry from the list. More...
 
ChainEntrygetNext () const
 Check if there is a chain. More...
 
virtual void setInvalid ()
 Set the entry to invalid. More...
 
void clearChain ()
 Clear the chain when the hashtable is cleared.
 
- Public Member Functions inherited from ReferenceCounter
 ReferenceCounter ()
 construction
 
virtual ~ReferenceCounter ()
 destruction
 

Protected Member Functions

virtual ~UaVariable ()
 destruction
 
- Protected Member Functions inherited from UaNode
virtual ~UaNode ()
 Destruction of the UaNode. More...
 
- Protected Member Functions inherited from ChainEntry
virtual ~ChainEntry ()
 destruction
 

Detailed Description

Class definition of the UaVariable.

Derived from UaNode Get all information about UaVariables and their references.

Member Function Documentation

virtual OpcUa_Byte UaVariable::accessLevel ( ) const
pure virtual

Get the AccessLevel for the Variable Value.

The valid flags are:

OpcUa_AccessLevels_CurrentRead
The current value of the Variable may be read
OpcUa_AccessLevels_CurrentWrite
The current value of the Variable may be written
OpcUa_AccessLevels_HistoryRead
The history for the Variable may be read
OpcUa_AccessLevels_HistoryWrite
The history for the Variable may be updated
OpcUa_AccessLevels_SemanticChange
The variable semantic may change. A change is indicated through SemanticChange flag or event.
OpcUa_AccessLevels_StatusWrite
The variable value StatusCode is writable
OpcUa_AccessLevels_TimestampWrite
The variable value SourceTimestamp is writable
Returns
the AccessLevel for the Variable.

Implemented in UaPropertyMethodArgument, UaDataVariableDevice, UaGenericVariable, UaDataVariableCache, and OpcUa::BaseVariableType.

virtual void UaVariable::arrayDimensions ( UaUInt32Array arrayDimensions) const
pure virtual

Get the arrayDimensions value for the passed UaNode.

Parameters
arrayDimensionsthe arrayDimensions value for the passed UaNode.

Implemented in UaPropertyMethodArgument, UaDataVariableDevice, UaGenericVariable, UaDataVariableCache, and OpcUa::BaseVariableType.

virtual UaNodeId UaVariable::dataType ( ) const
pure virtual

Get the DataType for the Variable.

Returns
the DataType for the DataVariable.

Implemented in UaPropertyMethodArgument, UaDataVariableDevice, UaGenericVariable, UaDataVariableCache, and OpcUa::BaseVariableType.

void UaVariable::getAttributeValue ( Session pSession,
OpcUa_Int32  attributeId,
UaDataValue uaDataValue 
)
virtual

Gets the value of an attribute of the Node.

Parameters
[in]pSessionInterface to the Session context for the method call
[in]attributeIdAttribute id indicating the attribute to return
[out]uaDataValueThe value of the attribute or the status code for the attribute

Reimplemented from UaNode.

virtual OpcUa_Boolean UaVariable::historizing ( ) const
pure virtual

Indicates if variable value is currently historized or not.

Returns
OpcUa_True if historizing is active OpcUa_False if not.

Implemented in UaPropertyMethodArgument, UaDataVariableDevice, UaGenericVariable, UaDataVariableCache, and OpcUa::BaseVariableType.

virtual OpcUa_Boolean UaVariable::isArrayDimensionsSupported ( ) const
pure virtual

Check if the Node is ArrayDimensionsSupported.

Returns
FALSE if not supported.

Implemented in UaPropertyMethodArgument, UaDataVariableDevice, UaGenericVariable, UaDataVariableCache, and OpcUa::BaseVariableType.

virtual OpcUa_Boolean UaVariable::isMinimumSamplingIntervalSupported ( ) const
pure virtual

Check whether a minimum sampling interval is supported.

Returns
TRUE if supported FALSE if not.

Implemented in UaPropertyMethodArgument, UaDataVariableDevice, UaGenericVariable, UaDataVariableCache, and OpcUa::BaseVariableType.

virtual OpcUa_Double UaVariable::minimumSamplingInterval ( ) const
pure virtual

Get the minimum sampling interval of the Variable.

Returns
the minimum sampling interval.

Implemented in UaPropertyMethodArgument, UaDataVariableDevice, UaGenericVariable, UaDataVariableCache, and OpcUa::BaseVariableType.

OpcUa_NodeClass UaVariable::nodeClass ( ) const
inlinevirtual

Get the NodeClass of the current Node.

Returns
the NodeClass of the current Node.

Implements UaNode.

Reimplemented in UaGenericVariable.

virtual VariableHandle* UaVariable::pVariableHandle ( )
inlinevirtual

Return the VariableHandle for the Value Attribute of the UaVariable.

Needs to be implemented by the derived class if the creation of the VariableHandle should be optimize by keeping a created variable handle in memory.

Returns
the VariableHandle for the Value Attribute of the UaVariable.

Reimplemented in UaVariableCache.

UaStatus UaVariable::setAttributeValue ( Session pSession,
OpcUa_Int32  attributeId,
const UaDataValue dataValue,
OpcUa_Boolean  checkWriteMask 
)
virtual

Sets the value of an attribute of the Node.

Returns
Status code
Parameters
[in]pSessionInterface to the Session context for the method call
[in]attributeIdAttribute id indicating the attribute to set
[in]dataValueNew value for the attribute
[out]checkWriteMaskFlag indicating if the write mask of the node should be checked before setting the new value

Reimplemented from UaNode.

Reimplemented in UaGenericVariable, and OpcUa::BaseVariableType.

virtual UaStatus UaVariable::setValue ( Session pSession,
const UaDataValue dataValue,
OpcUa_Boolean  checkAccessLevel = OpcUa_True 
)
pure virtual

Sets the value of the Variable.

Parameters
pSessionInterface to the Session context for the method call
dataValueNew value for the variable.
checkAccessLevelFlag indicating if the access level of the variable should be checked before setting the new value. The default value is true but may be changed to false for internal calls where the value should be changed even if this is not possible from a UA client.
Returns
Error code

Implemented in UaPropertyMethodArgument, UaDataVariableDevice, UaGenericVariable, UaDataVariableCache, OpcUa::BaseVariableTypeLocalizedTextValue, OpcUa::ConditionVariableType, and OpcUa::BaseVariableType.

void UaVariable::setValueHandling ( OpcUa_UInt32  valueHandling)
virtual

Set the mode for the handling of the value attribute.

The default implementation in UaVariable is not storing the value set. It must be overwritten by implementations of the UaVariable interface.

The value is a bit mask with the following values
UaVariable_Value_None = 0x0 - There is no value stored in the variable. The access to the value attribute must be implemented by the user of the SDK
UaVariable_Value_Cache = 0x1 - The variable has a cached value but normal read and data monitoring will not use the value directly. If only this flag is set all read and sampling access uses IOManagerUaNode::readValues that needs to be implemented in the custom NodeManager. All write operations to this variable are using IOManagerUaNode::writeValues. The cache value is not updated by the SDK. The custom code is responsible for updating the cache to allow the SDK to return values that are not older than the MaxAge parameter in the Read.
UaVariable_Value_CacheIsSource = 0x2 - If this flag is set, the value in the variable node is the data source and all read, data monitoring and write operations are using the value without requiring any custom code. Value changes can be provided with the method UaVariable::setValue(). IOManagerUaNode::beforeSetAttributeValue and IOManagerUaNode::afterSetAttributeValue can be used to control writing of attributes or to get informed about a successful write of an attribute. This requires overwriting these functions in the custom NodeManager implementation class.
UaVariable_Value_CacheIsUpdatedOnRequest = 0x4 - If this flag is set, the custom code is responsible for updating the cache value for variables monitored by one or more clients and to handle read and write operations. Value changes can be provided with the method UaVariable::setValue(). The custom code gets informed about monitoring changes for items of this type by overwriting IOManagerUaNode::variableCacheMonitoringChanged in the custom NodeManager implementation. In addition it is required to implement IOManagerUaNode::readValues and IOManagerUaNode::writeValues for read and write operations. This option allows optimizing cyclic access to devices for data monitoring independent of read operations.

Reimplemented in OpcUa::BaseVariableType.

virtual OpcUa_Byte UaVariable::userAccessLevel ( Session pSession) const
pure virtual

Get the UserAccessLevel for the Variable.

Parameters
pSessionInterface to the Session context for the method call
Returns
the UserAccessLevel for the Variable.

Implemented in UaPropertyMethodArgument, UaDataVariableDevice, UaGenericVariable, UaDataVariableCache, and OpcUa::BaseVariableType.

virtual UaDataValue UaVariable::value ( Session pSession)
pure virtual

Returns the value of the Variable.

Parameters
pSessionInterface to the Session context for the method call
Returns
The current value for the Variable.

Implemented in UaPropertyMethodArgument, UaDataVariableDevice, UaGenericVariable, UaDataVariableCache, OpcUa::BaseVariableTypeLocalizedTextValue, OpcUa::TwoStateVariableType, and OpcUa::BaseVariableType.

virtual OpcUa_UInt32 UaVariable::valueHandling ( ) const
inlinevirtual

Get the mode for the handling of the value attribute.

The value is a bit mask with the following values:

UaVariable_Value_None = 0x0
There is no value stored in the variable. The access to the value attribute must be implemented by the user of the SDK
UaVariable_Value_Cache = 0x1
The variable has a cached value but normal read and data monitoring will not use the value directly. If only this flag is set, all read and sampling access uses IOManagerUaNode::readValues that needs to be implemented in the custom NodeManager. All write operations to this variable are using IOManagerUaNode::writeValues. The cache value is not updated by the SDK. The custom code is responsible for updating the cache to allow the SDK to return values that are not older than the MaxAge parameter in the Read.
UaVariable_Value_CacheIsSource = 0x2
If this flag is set, the value in the variable node is the data source and all read, data monitoring and write operations are using the value without requiring any custom code. Value changes can be provided with the method UaVariable::setValue(). IOManagerUaNode::beforeSetAttributeValue and IOManagerUaNode::afterSetAttributeValue can be used to control writing of attributes or to get informed about a successful write of an attribute. This requires overwriting these functions in the custom NodeManager implementation class.
UaVariable_Value_CacheIsUpdatedOnRequest = 0x4
If this flag is set, the custom code is responsible for updating the cache value for variables monitored by one or more clients and to handle read and write operations. Value changes can be provided with the method UaVariable::setValue(). The custom code gets informed about monitoring changes for items of this type by overwriting IOManagerUaNode::variableCacheMonitoringChanged in the custom NodeManager implementation. In addition it is required to implement IOManagerUaNode::readValues and IOManagerUaNode::writeValues for read and write operations. This option allows optimizing cyclic access to devices for data monitoring independent of read operations.
Returns
The mode for the handling of the Value attribute.

Reimplemented in UaDataVariableDevice, UaVariableCache, and OpcUa::BaseVariableType.

virtual OpcUa_Int32 UaVariable::valueRank ( ) const
pure virtual

Get the ValueRank for the Variable.

This Attribute indicates whether the Value Attribute of the VariableType is an array and how many dimensions the array has.

It may have the following values:

n>1
the Value is an array with the specified number of dimensions.
OneDimension (1)
The value is an array with one dimension.
OneOrMoreDimensions (0)
The value is an array with one or more dimensions.
Scalar (-1)
The value is not an array.
Any (-2)
The value can be a scalar or an array with any number of dimensions.
ScalarOrOneDimension (-3)
The value can be a scalar or a one dimensional array.
Returns
the ValueRank for the DataVariable.

Implemented in UaPropertyMethodArgument, UaDataVariableDevice, UaGenericVariable, UaDataVariableCache, and OpcUa::BaseVariableType.


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