Modifies the metric to behave as read-write register, with specified initial data (value, timestamp).
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 also makes the timestamp of the metric writable, i.e. Sparkplug host applications will be able to modify its value. If you need a different behavior, call the Writable(SparkplugMetric,Boolean) method subsequently, with the desired parameter, or modify the WritableTimestamp accordingly (set it 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(SparkplugMetric,Type) overloads.
Overload List
| Overload | Description |
| ReadWrite(SparkplugMetric,Type,SparkplugData) | Makes the metric into a read-write register, specifying value type and initial Sparkplug data (value, timestamp). |
| ReadWrite(SparkplugMetric,TypeCode,SparkplugData) | Makes the metric into a read-write register, specifying value type code and initial Sparkplug data (value, timestamp). |
| ReadWrite(SparkplugMetric,SparkplugDataType,SparkplugData) | Makes the metric into a read-write register, specifying the Sparkplug data type and initial Sparkplug data (value, timestamp). |
| ReadWrite<TValue>(SparkplugMetric,SparkplugData<TValue>) | Makes the metric into a read-write register, specifying initial typed Sparkplug data (typed value, timestamp). |
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