Modifies the metric to behave as read-write register, with specified initial value.
This method makes the metric both readable and writable. The data written to the metric will become the data subsequently read from the metric.
This method keeps the settings of WritableTimestamp. This means that by default, the timestamp of the metric will not writable. i.e. Sparkplug host applications will not be able to modify it. If you need a different behavior, call the Writable(SparkplugMetric,Boolean) method subsequently, with desired parameter, or modify the WritableTimestamp 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(SparkplugMetric,Type) overloads.
Overload List
| Overload | Description |
| ReadWriteValue(SparkplugMetric,Type,Object) | Makes the metric into a read-write register, specifying value type and initial value. |
| ReadWriteValue(SparkplugMetric,TypeCode,Object) | Makes the metric into a read-write register, specifying value type code and initial value. |
| ReadWriteValue(SparkplugMetric,SparkplugDataType,Object) | Makes the metric into a read-write register, specifying the Sparkplug data type and initial value. |
| ReadWriteValue<TValue>(SparkplugMetric,TValue) | Makes the metric into a read-write register, specifying the typed initial value. |
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