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
Overload | Description |
WriteValueFunction<TValue>(UADataVariable,Type,Func<TValue,UAStatusCode>) | Makes data variable that consumes the attribute data using the write value function. Specify the declared type. |
WriteValueFunction<TValue>(UADataVariable,TypeCode,Func<TValue,UAStatusCode>) | Makes data variable that consumes the attribute data using the write value function. Specify the declared type code. |
WriteValueFunction<TValue>(UADataVariable,UANodeId,Func<TValue,UAStatusCode>) | Makes data variable that consumes the attribute data using the write value function. Specify the data type Id. |
WriteValueFunction<TValue>(UADataVariable,UANodeId,Int32,Func<TValue,UAStatusCode>) | Makes data variable that consumes the attribute data using the write value function. Specify the data type Id, and array rank. |
WriteValueFunction<TValue>(UADataVariable,UANodeId,IReadOnlyList<Int32>,Func<TValue,UAStatusCode>) | Makes data variable that consumes the attribute data using the write value function. Specify the data type Id, and array dimensions list. |
WriteValueFunction<TValue>(UADataVariable,Func<TValue,UAStatusCode>) | Makes data variable that consumes the attribute data using the write value function. The declared type is specified using generic type parameter. |
WriteValueFunction<TValue>(UADataVariable,Func<TValue,UAStatusCode>,Int32[]) | 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