Connectivity Software User's Guide and Reference
WriteValueAction Method (SparkplugMetricExtension)



OpcLabs.EasySparkplug Assembly > OpcLabs.EasySparkplug Namespace > SparkplugMetricExtension Class : WriteValueAction Method
Modifies the metric for consuming values by a specified action, for the push data consumption model.

This method always makes the metric writable; however, its timestamp will not be writable, i.e. Sparkplug host applications will not be able to modify them. If you need a different behavior, use one of the WriteFunction(SparkplugMetric,Type,Func<SparkplugData,Boolean>) method overloads instead.

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

The write operation defined by this method always succeeds. If you need support the option of failing the write operation to fail, use one of the WriteValueFunction<TValue>(SparkplugMetric,Type,Func<TValue,Boolean>) method overloads instead.

Overload List
OverloadDescription
Makes a metric that consumes the Sparkplug data using the write value action. Specify the declared type.  
Makes a metric that consumes the Sparkplug data using the write value action. Specify the declared type code.  
Makes a metric that consumes the Sparkplug data using the write value action. Specify the Sparkplug data type.  
Makes a metric that consumes the Sparkplug data using the write value action. The declared type is specified using generic type parameter.  
Remarks

 

Sparkplug is a trademark of Eclipse Foundation, Inc. "MQTT" is a trademark of the OASIS Open standards consortium. Other related terms are trademarks of their respective owners. Any use of these terms on this site is for descriptive purposes only and does not imply any sponsorship, endorsement or affiliation.

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