OPC Studio User's Guide and Reference
UADataVariableExtension Class Members
Methods 


OpcLabs.ServerOpcUA Assembly > OpcLabs.EasyOpc.UA.NodeSpace Namespace : UADataVariableExtension Class

The following tables list the members exposed by UADataVariableExtension.

Public Methods
 NameDescription
Public Methodstatic (Shared in Visual Basic)Overloaded. Modifies the data variable to provide the specified constant attribute data (value, status code, timestamp), non-writable.

For reads and subscriptions, the data variable will provide always the same data, specified in this method call. The data variable will not be writable.

 
Public Methodstatic (Shared in Visual Basic)Overloaded. Modifies the data variable to provide the specified constant value, non-writable.

For reads and subscriptions, the data variable will provide always the same value, specified in this method call. The data variable will not be writable.

The status code will be "Good", and the timestamp will be the current time of this method call.

 
Public Method (Inherited from object)
Public MethodServes as the default hash function. (Inherited from object)
Public MethodGets the System.Type of the current instance. (Inherited from object)
Public Methodstatic (Shared in Visual Basic)Specifies that reads of this data variable will be processed by the specified read function.  
Public Methodstatic (Shared in Visual Basic)Specifies that writes of this data variable will be processed by the specified write function.  
Public Methodstatic (Shared in Visual Basic)Overloaded. Makes the data variable readable.  
Public Methodstatic (Shared in Visual Basic)Overloaded. Modifies the data variable to provide attribute data for the pull data provision model by a specified function.

This method always makes the data variable readable, but that does not mean it automatically makes it non-writable. If you need a data variable that is readable and non-writable, combine this method with calling Writable(UADataVariable,Boolean) method with the 'writable' parameter set to false.

 
Public Methodstatic (Shared in Visual Basic)Overloaded. Modifies the data variable to provide value for the pull data provision model by a specified function.

This method always makes the data variable readable, but that does not mean it automatically makes it non-writable. If you need a data variable that is readable and non-writable, combine this method with calling Writable(UADataVariable,Boolean) method with the 'writable' parameter set to false.

The status code will be "Good", and the timestamp will be the current time after the read function has been called.

 
Public Methodstatic (Shared in Visual Basic)Overloaded. Modifies the data variable to behave as read-write register, with specified initial attribute data (value, status code, timestamp).

This method makes the data variable both readable and writable. The data written to the data variable will become the data subsequently read from the data variable.

This method also makes the status code and source timestamp of the data variable writable, i.e. OPC UA clients will be able to modify their values. If you need a different behavior, call the Writable(UADataVariable,Boolean,Boolean,Boolean) method subsequently, with desired parameters, or modify the UADataVariable.WritableStatusCode and/or UADataVariable.WritableSourceTimestamp accordingly (set one or both to false).

In order to make a read-write register of certain type, but without having to specify initial data, consider simply using one of the ValueType(UADataVariable,Type) overloads.

 
Public Methodstatic (Shared in Visual Basic)Overloaded. Modifies the data variable to behave as read-write register, with specified initial value.

This method makes the data variable both readable and writable. The data written to the data variable will become the data subsequently read from the data variable.

This method keeps the settings of UADataVariable.WritableStatusCode and UADataVariable.WritableSourceTimestamp. This means that by default, the status code and source timestamp of the data variable will not writable. i.e. OPC UA clients will not be able to modify them. If you need a different behavior, call the Writable(UADataVariable,Boolean,Boolean,Boolean) method subsequently, with desired parameters, or modify the UADataVariable.WritableStatusCode and/or UADataVariable.WritableSourceTimestamp accordingly (set one or both to true).

In order to make a read-write register of certain type, but without having to specify initial data, consider simply using one of the ValueType(UADataVariable,Type) overloads.

 
Public Methodstatic (Shared in Visual Basic)Sets the array dimensions of this data variable.  
Public Methodstatic (Shared in Visual Basic)Sets the array rank of this data variable.  
Public Methodstatic (Shared in Visual Basic)Sets the minimum sampling interval of this data variable.  
Public MethodReturns a string that represents the current object. (Inherited from object)
Public Methodstatic (Shared in Visual Basic)Updates the write attribute data with given value, and current time for the timestamp.  
Public Methodstatic (Shared in Visual Basic)Overloaded. Modifies the data variable to use certain value type.  
Public Methodstatic (Shared in Visual Basic)Overloaded. Makes the data variable writable.  
Public Methodstatic (Shared in Visual Basic)Overloaded. Modifies the data variable for consuming attribute data by a specified function, for the push data consumption model.

This method always makes the data variable writable, including its status code and source timestamp, i.e. OPC UA clients will be able to modify them. If you need a different behavior, call the Writable(UADataVariable,Boolean,Boolean,Boolean) method subsequently, with desired parameters, or modify the UADataVariable.WritableStatusCode and/or UADataVariable.WritableSourceTimestamp accordingly (set one or both to true).

This method does not change the readability access of the data variable. By default, data variables are readable. If you need a data variable that is writable but non-readable, combine this method with calling Readable(UADataVariable,Boolean) method with the 'readable' parameter set to false.

The write function returns a OpcLabs.EasyOpc.UA.UAStatusCode that indicates the outcome of the OPC UA write operation. The WriteFunction(UADataVariable,Type,Func<UAAttributeData,UAStatusCode>) method overloads are the most generic extensions methods for writing. If you only need to deal with the data variable value (and not its status code and/or timestamp), consider using one of the WriteValueFunction<TValue>(UADataVariable,Type,Func<TValue,UAStatusCode>) or WriteValueAction<TValue>(UADataVariable,Type,Action<TValue>) method overloads, for shorter code and easier programming.

 
Public Methodstatic (Shared in Visual Basic)Overloaded. Modifies the data variable for consuming values by a specified action, for the push data consumption model.

This method always makes the data variable writable; however, its status code and source timestamp will not be writable, i.e. OPC UA clients will not be able to modify them. If you need a different behavior, use one of the WriteFunction(UADataVariable,Type,Func<UAAttributeData,UAStatusCode>) method overloads instead.

This method does not change the readability access of the data variable. By default, data variables are readable. If you need a data variable that is writable but non-readable, combine this method with calling Readable(UADataVariable,Boolean) method with the 'readable' parameter set to false.

Unless the write value action throws a OpcLabs.EasyOpc.UA.UAStatusCodeException, a "Good" status code will be returned as the outcome of the OPC UA write operation. If the write value action function throws OpcLabs.EasyOpc.UA.UAStatusCodeException, the OpcLabs.EasyOpc.UA.UAStatusCodeException.StatusCode of the exception will become the outcome of the OPC UA write operation. For performance reasons, however, if you want to return status codes other than "Good" as OPC UA write operation outcomes, it is recommended that you use one of the WriteValueFunction<TValue>(UADataVariable,Type,Func<TValue,UAStatusCode>) method overloads instead. With these methods, you specify a write value function that returns the OpcLabs.EasyOpc.UA.UAStatusCode that is the OPC UA write operation outcome, allowing the status code be passed without the ineffective throwing and catching of the OpcLabs.EasyOpc.UA.UAStatusCodeException.

 
Public Methodstatic (Shared in Visual Basic)Overloaded. Modifies the data variable for consuming values by a specified function, for the push data consumption model.

This method always makes the data variable writable; however, its status code and source timestamp will not be writable, i.e. OPC UA clients will not be able to modify them. If you need a different behavior, use one of the WriteFunction(UADataVariable,Type,Func<UAAttributeData,UAStatusCode>) method overloads instead.

This method does not change the readability access of the data variable. By default, data variables are readable. If you need a data variable that is writable but non-readable, combine this method with calling Readable(UADataVariable,Boolean) method with the 'readable' parameter set to false.

The write function returns a OpcLabs.EasyOpc.UA.UAStatusCode that indicates the outcome of the OPC UA write operation. If the outcome of your write operation should always be "Good", you can make your code a bit simpler by using one of WriteValueAction<TValue>(UADataVariable,Type,Action<TValue>) method overloads instead.

 
Top
Protected Methods
 NameDescription
Protected MethodAllows an object to try to free resources and perform other cleanup operations before it is reclaimed by garbage collection. (Inherited from object)
Protected MethodCreates a shallow copy of the current System.Object. (Inherited from object)
Top
Extension Methods
 NameDescription
Public Extension MethodSets the arbitrary object associated with the node.
Top
See Also

Reference

UADataVariableExtension Class
OpcLabs.EasyOpc.UA.NodeSpace Namespace