Connectivity Software User's Guide and Reference
ConvertCommandData Property (ISparkplugProducer)



OpcLabs.EasySparkplug Assembly > OpcLabs.EasySparkplug Namespace > ISparkplugProducer Interface : ConvertCommandData Property
Determines whether an attempt will be made to convert the data in the incoming command to the type of the metric.
Syntax
'Declaration
 
Property ConvertCommandData As Boolean
'Usage
 
Dim instance As ISparkplugProducer
Dim value As Boolean
 
instance.ConvertCommandData = value
 
value = instance.ConvertCommandData
bool ConvertCommandData {get; set;}
property bool ConvertCommandData {
   bool get();
   void set (    bool value);
}
Remarks

When the value of this property is true, a precise match is not required between the type of the data in the incoming command, and the data type of the affected metric. In case the data types are not the same, the producer (Sparkplug edge node or device) will first attempt to convert the incoming data into the data type of the metric. For example, if the metric is of Sparkplug data type SparkplugDataType.Int32 and the command data contains SparkplugDataType.UInt8, the conversion can always be made. For the same metric, depending on the actual value, even a conversion from SparkplugDataType.UInt32 can sometimes be made. If the conversion succeeds, the converted value is written to the metric. If the conversion fails, no data is written to the metric, and the ISparkplugProducerEvents.WriteError event is raised.

When the value of this property is false, the type of the data in the incoming command must be precisely the same as the data type of the affected metric. If the data types are different, no data is written to the metric, and the ISparkplugProducerEvents.WriteError event is raised.

This method or property does not throw any exceptions, aside from execution exceptions such as System.Threading.ThreadAbortException or System.OutOfMemoryException.

 

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