OPC Studio User's Guide and Reference
WriteValueFunction Method



OpcLabs.ServerOpcUA Assembly > OpcLabs.EasyOpc.UA.NodeSpace Namespace > UADataVariableExtension Class : WriteValueFunction Method
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.

Overload List
OverloadDescription
Makes data variable that consumes the attribute data using the write value function. Specify the declared type.  
Makes data variable that consumes the attribute data using the write value function. Specify the declared type code.  
Makes data variable that consumes the attribute data using the write value function. Specify the data type Id.  
Makes data variable that consumes the attribute data using the write value function. Specify the data type Id, and array rank.  
Makes data variable that consumes the attribute data using the write value function. Specify the data type Id, and array dimensions list.  
Makes data variable that consumes the attribute data using the write value function. The declared type is specified using generic type parameter.  
Makes data variable that consumes the attribute data using the write value function, and specifying array dimensions. The declared type is specified using generic type parameter.  
Requirements

Target Platforms: .NET Framework: Windows 10 (selected versions), Windows 11 (selected versions), Windows Server 2016, Windows Server 2022; .NET: Linux, macOS, Microsoft Windows

See Also