Connectivity Software User's Guide and Reference
WriteError Event (EasySparkplugEdgeNodeCore)



OpcLabs.EasySparkplug Assembly > OpcLabs.EasySparkplug Namespace > EasySparkplugEdgeNodeCore Class : WriteError Event
Raised when a write error occurs in the Sparkplug metric.
Syntax
'Declaration
 
Public Event WriteError As SparkplugProducerErrorEventHandler
'Usage
 
Dim instance As EasySparkplugEdgeNodeCore
Dim handler As SparkplugProducerErrorEventHandler
 
AddHandler instance.WriteError, handler
public event SparkplugProducerErrorEventHandler WriteError
public:
event SparkplugProducerErrorEventHandler^ WriteError
Event Data

The event handler receives an argument of type SparkplugProducerErrorEventArgs containing data related to this event. The following SparkplugProducerErrorEventArgs properties provide information specific to this event.

PropertyDescription
The device associated with this event, if any. (Inherited from OpcLabs.EasySparkplug.OperationModel.SparkplugProducerProcessedEventArgs)
The edge node associated with this event. (Inherited from OpcLabs.EasySparkplug.OperationModel.SparkplugProducerProcessedEventArgs)
Describes the error that has occurred in the producer.  
(Inherited from System.ComponentModel.HandledEventArgs)
The name of the metric associated with this event. Empty if the event is not associated with a metric. (Inherited from OpcLabs.EasySparkplug.OperationModel.SparkplugProducerProcessedEventArgs)
Remarks

This event is raised when the produced has received data for the metric, but the metric data cannot be updated, e.g. because of the data type mismatch.

Possible causes of the write error include:

  • The Sparkplug command message specifies a metric with a name that does not exist in the edge node or device.
  • Attempt to write historical data into the metric.
  • The value received in the Sparkplug command message cannot be converted to the data type of the metric. The converted value cannot be represented in a CLS type.Processing of the Write event has indicated failure by returning false in the OpcLabs.EasySparkplug.OperationModel.SparkplugMetricWriteEventArgs.Result property of the event arguments.

Write error is reported through this on the corresponding Sparkplug edge node (EasySparkplugEdgeNodeCore) or device (SparkplugDevice). The event arguments include the name of the metric that has encountered the write error, in the OpcLabs.EasySparkplug.OperationModel.SparkplugProducerProcessedEventArgs.MetricName property.

 

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