Connectivity Software User's Guide and Reference
PublishLastDataOnly Property (EasySparkplugEdgeNodeCore)



OpcLabs.EasySparkplug Assembly > OpcLabs.EasySparkplug Namespace > EasySparkplugEdgeNodeCore Class : PublishLastDataOnly Property
Determines whether the Sparkplug producer (edge node or device) publishes only the last data known.
Syntax
'Declaration
 
Public Property PublishLastDataOnly As Boolean
'Usage
 
Dim instance As EasySparkplugEdgeNodeCore
Dim value As Boolean
 
instance.PublishLastDataOnly = value
 
value = instance.PublishLastDataOnly
public bool PublishLastDataOnly {get; set;}
public:
property bool PublishLastDataOnly {
   bool get();
   void set (    bool value);
}

Property Value

The default value of this property is False.

Remarks

When this property is false (which is usually the default), the producer will publish all metric data changes collected since last time the data was published. Consequently, there can be multiple entries for the same metric in the payload. Note that when the normal polling mechanism is used without further customization, metric data is only updated at most once during the poll, and therefore even with this setting, each metric appears no more than once in the generated payload.

When this property is true, the producer will only publish the last data known for each metric. Any previous changes made since the last publish are ignored.

If your code calls the PublishDataPayload method, and this property is true, the payload will be sent only with the last data for each metric. If this property is false, it will be sent "as is" (if there are multiple changes for the same metric, they will be all included in the payload).

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