Subscriber diagnostic items
- Last UpdatedAug 21, 2024
- 2 minute read
The subscriber diagnostic items provide diagnostic information specific to the MQTT Subscriber.
Subscriber-specific Diagnostic Items
|
Item Syntax |
DataType |
Read/ Write |
Description |
|
$SYS$SP$IsPrimaryApp |
Boolean |
R |
Displays "True" if the MQTT subscriber is configured to be the Primary Application in the Sparkplug infrastructure. |
|
$SYS$SP$PrimaryAppStatus |
String |
R |
Takes on a value of "Online" or "Offline" based on the online/offline status of the Sparkplug Infrastructure. |
|
$SYS$SP$SCADA_Host_ID |
String |
R |
This is the SCADA Host ID identifying the Sparkplug infrastructure that the Subscriber/Publisher is part of. This value must be identical to that configured in the Primary Application. It can be blank to indicate that the Subcriber/Publisher does not participate the Sparkplug infrastructure. |
Subscriber Query Items
Query items extract diagnostic data related to the MQTT Subscriber based on the QoS and/or payload type. The query item syntax for the MQTT Subscriber is:
/$SYS$DIAG/<ItemName>?<QoS#>&<Payload Type>
where,
-
ItemName is the diagnostic system item. The item name can be one of the following:
<ItemName>
DataType
Read/ Write
Description
SubscribedItemCount
Int32
R
Displays the total number of subscribed items under the broker.
TotalReadItemErrors
Int32
R
Displays the total number of items failed to read in all connections since the MQTT Communication Driver was started or last reseted. (An error is counted if one or more item reads failed, or the entire read is not executed).
TotalWriteItemErrors
Int32
R
Displays the total number of items failed to write in all connections since the MQTT Communication Driver was started or last reseted.
(An error is counted if one or more item writes failed, or the entire write is not executed)
Note: These items can also be accessed at the global level.
-
QoS# is the Quality of Service value. The QoS value can be one of the following:
-
QoS0
-
QoS1
-
QoS2
-
-
Payload type is the format of the message payload. The payload type can be one of the following:
-
JSON
-
SP (Sparkplug)
-
For example, the syntax to access the total number of subscribed items with QoS1 under the broker, in the JSON payload format, is:
/$SYS$DIAG/SubscribedItemCount?QoS1&JSON