...
The Payload contains the following key/value pairs:
- timestamp
- The time stamp that the payload was created
- metrics
- An array containing data specific to the message type being published
- Each object in the array will include the following name/value pairs:
- name
- timestamp
- dataType
- value
- Additional name/value pairs in the DBIRTH or NBIRTH messages only include:
- metaData ****
- properties
- The Quality property. See the Ignition Tag Property Enum Reference for the Data Quality value reference
- Additional property values such as engHigh, engLow etc are included if they have been changed from the Ignition default. See the Ignition Tag Properties reference for all available properties.
- seq
- The message sequence number used to ensure that messages are processed in the correct order
Sample JSON messages
Using a simple tag tree structure shown below, we can show how these JSON formatted messages will be generated:
Image Added
Image Removed
NBIRTHThe Edge Node BIRTH message will contain a Topic and Payload:
- Topic
- Namespace
- Edge Node Descriptor
- Group ID
- Edge Node ID
- Message Type
- Payload
- Timestamp - timestamp for when the payload was constructed
- Metrics - array containing
- A Birth/Death sequence number to track the Sparkplug session of the Edge client
- Any Edge Node tags defined in the Edge Node folder
Seq - the message sequence number - Seq
Code Block |
---|
title | Edge Node Birth message |
---|
|
{
"topic": {
"namespace": "spBv1.0",
"edgeNodeDescriptor": "G1/E1",
"groupId": "G1",
"edgeNodeId": "E1"
"type": "NBIRTH"
},
"payload": {
"timestamp": 1638223073190,
"metrics": [
{
"name": "bdSeq",
"timestamp": 1638223073187,
"dataType": "Int64",
"value": 5
},
{
"name": "Tag 4",
"timestamp": 1638223073156,
"dataType": "Int32",
"metaData": {},
"properties": {
"Quality": {
"type": "Int32",
"value": 192
}
},
"value": 100
{,
],
"seq": 0
}
} |
DBIRTHThe Device BIRTH message will contain the following:
...
Code Block |
---|
title | Device BIRTH message |
---|
|
{
"topic": {
"namespace": "spBv1.0",
"edgeNodeDescriptor": "G1/E1",
"groupId": "G1",
"edgeNodeId": "E1",
"deviceId": "D1",
"type": "DBIRTH"
},
"payload": {
"timestamp": 1638223073192,
"metrics": [
{
"name": "T1",
"timestamp": 1638223073192,
"dataType": "Int32",
"metaData": {},
"properties": {
"Quality": {
"type": "Int32",
"value": 192
}
},
"value": 12
}
],
"seq": 1
}
} |
DDATAThe Device DDATA message will contain the following:
...
Code Block |
---|
|
{
"topic": {
"namespace": "spBv1.0",
"edgeNodeDescriptor": "G1/E1",
"groupId": "G1",
"edgeNodeId": "E1",
"deviceId": "D1"
"type": "DDATA"
},
"payload": {
"timestamp": 1638223663812,
"metrics": [
{
"name": "T1",
"timestamp": 1638223662800,
"dataType": "INT32",
"value": 100
}
],
"seq": 2
}
} |
NDEATH
DDEATH
Understanding and decoding Ignition QualityCodes
...