Skip to content

Latest commit

 

History

History
411 lines (381 loc) · 12.1 KB

telemetry-messages-format.md

File metadata and controls

411 lines (381 loc) · 12.1 KB

Telemetry Messages Processing

Home

Note: This page is work in progress.

Telemetry messages used by the IIoT Platform

From IoT Hub - Generated by Edge Publisher

Samples Mode, JSON encoding

{
  "body": {
    "NodeId": "nsu=http://microsoft.com/Opc/OpcPlc/;s=StepUp",
    "EndpointUrl": "opc.tcp://opcplc:50000/",
    "ApplicationUri": "urn:OpcPlc:opcplc",
    "DisplayName": "StepUp",
    "Timestamp": "2022-03-18T12:52:42.137703Z",
    "Value": {
      "Value": 21713,
      "SourceTimestamp": "2022-03-18T12:52:42.1327544Z",
      "ServerTimestamp": "2022-03-18T12:52:42.1327633Z"
    },
    "SequenceNumber": 120,
    "ExtensionFields": {
      "PublisherId": "opc.tcp://opcplc:50000_D09D61EF",
      "DataSetWriterId": "1000"
    }
  },
  "enqueuedTime": "Fri Mar 18 2022 13:52:42 GMT+0100 (Central European Standard Time)",
  "properties": {
    "$$ContentType": "application/x-monitored-item-json-v1",
    "iothub-message-schema": "application/json",
    "$$ContentEncoding": "utf-8"
  }
}

OPC UA PubSub Mode, JSON encoding

{
  "body": {
    "MessageId": "27",
    "MessageType": "ua-data",
    "PublisherId": "opc.tcp://opcplc:50000_70FB9F43",
    "Messages": [
      {
        "DataSetWriterId": "1000",
        "SequenceNumber": 27,
        "MetaDataVersion": {
          "MajorVersion": 1,
          "MinorVersion": 0
        },
        "Timestamp": "2022-03-18T12:55:21.3424136Z",
        "Payload": {
          "AlternatingBoolean": {
            "Value": true,
            "SourceTimestamp": "2022-03-18T12:55:20.9313098Z",
            "ServerTimestamp": "2022-03-18T12:55:20.9314784Z"
          },
          "StepUp": {
            "Value": 23305,
            "SourceTimestamp": "2022-03-18T12:55:21.3313539Z",
            "ServerTimestamp": "2022-03-18T12:55:21.3313638Z"
          },
          "RandomSignedInt32": {
            "Value": 1076635612,
            "SourceTimestamp": "2022-03-18T12:55:21.3419164Z",
            "ServerTimestamp": "2022-03-18T12:55:21.3419728Z"
          },
          "RandomUnsignedInt32": {
            "Value": 1461169798,
            "SourceTimestamp": "2022-03-18T12:55:21.3419727Z",
            "ServerTimestamp": "2022-03-18T12:55:21.3420045Z"
          },
          "BadFastUInt1": {
            "StatusCode": {
              "Symbol": "BadNoCommunication",
              "Code": 2150694912
            },
            "SourceTimestamp": "2022-03-18T12:55:20.8409353Z",
            "ServerTimestamp": "2022-03-18T12:55:20.8409362Z"
          }
        }
      }
    ]
  },
  "enqueuedTime": "Fri Mar 18 2022 13:55:21 GMT+0100 (Central European Standard Time)",
  "properties": {
    "$$ContentType": "application/x-network-message-json-v1",
    "iothub-message-schema": "application/json",
    "$$ContentEncoding": "utf-8"
  }
}

Standalone Publisher mode - Legacy

Full featured message sample is below.

Enhanced compatibility with new version of the IIoT Platform's telemetry processors. Publisher to be started in standalone mode with --fm=true argument

{
  "body": {
    "NodeId": "nsu=http://microsoft.com/Opc/OpcPlc/;s=RandomUnsignedInt32",
    "EndpointUrl": "opc.tcp://opcplc:50000/",
    "ApplicationUri": "urn:OpcPlc:opcplc",
    "Timestamp": "2022-03-18T12:58:45.6660994Z",
    "Value": {
      "Value": 1059185306,
      "SourceTimestamp": "2022-03-18T12:58:45.6329923Z",
      "ServerTimestamp": "2022-03-18T12:58:45.6331823Z"
    },
    "SequenceNumber": 22,
    "ExtensionFields": {
      "PublisherId": "opc.tcp://opcplc:50000_D3C751BF",
      "DataSetWriterId": "1000"
    }
  },
  "enqueuedTime": "Fri Mar 18 2022 13:58:45 GMT+0100 (Central European Standard Time)",
  "properties": {
    "$$ContentType": "application/x-monitored-item-json-v1",
    "iothub-message-schema": "application/json",
    "$$ContentEncoding": "utf-8"
  }
}

{
  "body": {
    "NodeId": "nsu=http://microsoft.com/Opc/OpcPlc/;s=BadFastUInt1",
    "EndpointUrl": "opc.tcp://opcplc:50000/",
    "ApplicationUri": "urn:OpcPlc:opcplc",
    "Timestamp": "2022-03-18T12:58:41.6538735Z",
    "Value": {
      "StatusCode": {
        "Symbol": "BadNoCommunication",
        "Code": 2150694912
      },
      "SourceTimestamp": "2022-03-18T12:58:40.840659Z",
      "ServerTimestamp": "2022-03-18T12:58:40.8406599Z"
    },
    "SequenceNumber": 18,
    "ExtensionFields": {
      "PublisherId": "opc.tcp://opcplc:50000_D3C751BF",
      "DataSetWriterId": "1000"
    }
  },
  "enqueuedTime": "Fri Mar 18 2022 13:58:41 GMT+0100 (Central European Standard Time)",
  "properties": {
    "$$ContentType": "application/x-monitored-item-json-v1",
    "iothub-message-schema": "application/json",
    "$$ContentEncoding": "utf-8"
  }
}

Message example with batching/bulk mode enabled Publisher to be started in standalone mode with --bs=5 argument, where 5 is the number of value-change messages to be batched.

  "body": [
    {
      "NodeId": "nsu=http://microsoft.com/Opc/OpcPlc/;s=AlternatingBoolean",
      "EndpointUrl": "opc.tcp://opcplc:50000/",
      "ApplicationUri": "urn:OpcPlc:opcplc",
      "Timestamp": "2022-03-18T13:01:56.7551553Z",
      "Value": {
        "Value": false,
        "SourceTimestamp": "2022-03-18T13:01:55.9333398Z",
        "ServerTimestamp": "2022-03-18T13:01:55.933447Z"
      },
      "SequenceNumber": 22,
      "ExtensionFields": {
        "PublisherId": "opc.tcp://opcplc:50000_9C43F84E",
        "DataSetWriterId": "1000"
      }
    },
    {
      "NodeId": "nsu=http://microsoft.com/Opc/OpcPlc/;s=StepUp",
      "EndpointUrl": "opc.tcp://opcplc:50000/",
      "ApplicationUri": "urn:OpcPlc:opcplc",
      "Timestamp": "2022-03-18T13:01:56.7551553Z",
      "Value": {
        "Value": 27259,
        "SourceTimestamp": "2022-03-18T13:01:56.7393301Z",
        "ServerTimestamp": "2022-03-18T13:01:56.7401032Z"
      },
      "SequenceNumber": 22,
      "ExtensionFields": {
        "PublisherId": "opc.tcp://opcplc:50000_9C43F84E",
        "DataSetWriterId": "1000"
      }
    },
    {
      "NodeId": "nsu=http://microsoft.com/Opc/OpcPlc/;s=RandomSignedInt32",
      "EndpointUrl": "opc.tcp://opcplc:50000/",
      "ApplicationUri": "urn:OpcPlc:opcplc",
      "Timestamp": "2022-03-18T13:01:56.7551553Z",
      "Value": {
        "Value": -2127202062,
        "SourceTimestamp": "2022-03-18T13:01:56.7393504Z",
        "ServerTimestamp": "2022-03-18T13:01:56.7398952Z"
      },
      "SequenceNumber": 22,
      "ExtensionFields": {
        "PublisherId": "opc.tcp://opcplc:50000_9C43F84E",
        "DataSetWriterId": "1000"
      }
    },
    {
      "NodeId": "nsu=http://microsoft.com/Opc/OpcPlc/;s=RandomUnsignedInt32",
      "EndpointUrl": "opc.tcp://opcplc:50000/",
      "ApplicationUri": "urn:OpcPlc:opcplc",
      "Timestamp": "2022-03-18T13:01:56.7551553Z",
      "Value": {
        "Value": 456421443,
        "SourceTimestamp": "2022-03-18T13:01:56.739439Z",
        "ServerTimestamp": "2022-03-18T13:01:56.7395003Z"
      },
      "SequenceNumber": 22,
      "ExtensionFields": {
        "PublisherId": "opc.tcp://opcplc:50000_9C43F84E",
        "DataSetWriterId": "1000"
      }
    },
    {
      "NodeId": "nsu=http://microsoft.com/Opc/OpcPlc/;s=BadFastUInt1",
      "EndpointUrl": "opc.tcp://opcplc:50000/",
      "ApplicationUri": "urn:OpcPlc:opcplc",
      "Timestamp": "2022-03-18T13:01:56.7551553Z",
      "Value": {
        "Value": 5,
        "SourceTimestamp": "2022-03-18T13:01:55.8426847Z",
        "ServerTimestamp": "2022-03-18T13:01:55.8427264Z"
      },
      "SequenceNumber": 22,
      "ExtensionFields": {
        "PublisherId": "opc.tcp://opcplc:50000_9C43F84E",
        "DataSetWriterId": "1000"
      }
    }
  ],
  "enqueuedTime": "Fri Mar 18 2022 14:01:56 GMT+0100 (Central European Standard Time)",
  "properties": {
    "$$ContentType": "application/x-monitored-item-json-v1",
    "iothub-message-schema": "application/json",
    "$$ContentEncoding": "utf-8"
  }
}

Legacy compatibility mode (reduced) message sample

Compatible with IIoT Platform and Connected Factory 1.0. Publisher to be started in standalone mode with --fm=false argument

{
  "body": {
    "NodeId": "nsu=http://microsoft.com/Opc/OpcPlc/;s=StepUp",
    "EndpointUrl": "opc.tcp://opcplc:50000/",
    "Value": {
      "Value": 28679,
      "SourceTimestamp": "2022-03-18T13:04:18.7244388Z"
    }
  },
  "enqueuedTime": "Fri Mar 18 2022 14:04:18 GMT+0100 (Central European Standard Time)",
  "properties": {
    "$$ContentType": "application/x-monitored-item-json-v1",
    "iothub-message-schema": "application/json",
    "$$ContentEncoding": "utf-8"
  }
}


{
  "body": {
    "NodeId": "nsu=http://microsoft.com/Opc/OpcPlc/;s=BadFastUInt1",
    "EndpointUrl": "opc.tcp://opcplc:50000/",
    "Value": {
      "Value": 4,
      "StatusCode": {
        "Symbol": "UncertainLastUsableValue",
        "Code": 1083179008
      },
      "SourceTimestamp": "2022-03-18T13:04:14.8405063Z"
    }
  },
  "enqueuedTime": "Fri Mar 18 2022 14:04:15 GMT+0100 (Central European Standard Time)",
  "properties": {
    "$$ContentType": "application/x-monitored-item-json-v1",
    "iothub-message-schema": "application/json",
    "$$ContentEncoding": "utf-8"
  }
}

Message example with batching/bulk mode enabled Publisher to be started in standalone mode with --bs=5 argument, where 5 is the number of value-changes to be batched.

{
  "body": [
    {
      "NodeId": "nsu=http://microsoft.com/Opc/OpcPlc/;s=AlternatingBoolean",
      "EndpointUrl": "opc.tcp://opcplc:50000/",
      "Value": {
        "Value": true,
        "SourceTimestamp": "2022-03-18T13:06:30.932775Z"
      }
    },
    {
      "NodeId": "nsu=http://microsoft.com/Opc/OpcPlc/;s=StepUp",
      "EndpointUrl": "opc.tcp://opcplc:50000/",
      "Value": {
        "Value": 30003,
        "SourceTimestamp": "2022-03-18T13:06:31.1337676Z"
      }
    },
    {
      "NodeId": "nsu=http://microsoft.com/Opc/OpcPlc/;s=RandomSignedInt32",
      "EndpointUrl": "opc.tcp://opcplc:50000/",
      "Value": {
        "Value": -2052144044,
        "SourceTimestamp": "2022-03-18T13:06:31.1338343Z"
      }
    },
    {
      "NodeId": "nsu=http://microsoft.com/Opc/OpcPlc/;s=RandomUnsignedInt32",
      "EndpointUrl": "opc.tcp://opcplc:50000/",
      "Value": {
        "Value": 186770890,
        "SourceTimestamp": "2022-03-18T13:06:31.1339985Z"
      }
    },
    {
      "NodeId": "nsu=http://microsoft.com/Opc/OpcPlc/;s=BadFastUInt1",
      "EndpointUrl": "opc.tcp://opcplc:50000/",
      "Value": {
        "StatusCode": {
          "Symbol": "BadNoCommunication",
          "Code": 2150694912
        },
        "SourceTimestamp": "2022-03-18T13:06:30.8423538Z"
      }
    }
  ],
  "enqueuedTime": "Fri Mar 18 2022 14:06:31 GMT+0100 (Central European Standard Time)",
  "properties": {
    "$$ContentType": "application/x-monitored-item-json-v1",
    "iothub-message-schema": "application/json",
    "$$ContentEncoding": "utf-8"
  }
}

From Event Hub - Generated by the Telemetry Processor

Samples Mode

Message body is

{
  "publisherId": "uat46f9f8f82fd5c1b42a7de31b5dc2c11ef418a62f",
  "dataSetClassId": "http://test.org/UA/Data/#i=10845",
  "dataSetWriterId": "uat46f9f8f82fd5c1b42a7de31b5dc2c11ef418a62f",
  "sequenceNumber": 0,
  "metaDataVersion": "1.0",
  "status": "Good",
  "timestamp": "2020-03-24T23:54:23.4955724Z",
  "payload": {
    "http://test.org/UA/Data/#i=10845": {
      "value": 27,
      "sourceTimestamp": "2020-03-24T23:54:23.1307846Z",
      "serverTimestamp": "2020-03-24T23:54:23.1307846Z"
    }
  }
}

OPC UA PubSub Mode

Message body is

{
  "messageId": "21",
  "publisherId": "uat46f9f8f82fd5c1b42a7de31b5dc2c11ef418a62f",
  "dataSetClassId": "78c4e91c-82cb-444e-a8e0-6bbacc9a946d",
  "dataSetWriterId": "uat46f9f8f82fd5c1b42a7de31b5dc2c11ef418a62f",
  "sequenceNumber": 21,
  "metaDataVersion": "1.1",
  "status": "Good",
  "timestamp": "2020-03-25T00:00:28.5713393Z",
  "payload": {
    "http://test.org/UA/Data/#i=10845": {
      "value": -91,
      "sourceTimestamp": "2020-03-25T00:00:28.0498921Z",
      "serverTimestamp": "2020-03-25T00:00:28.0498921Z"
    },
    "http://test.org/UA/Data/#i=10846": {
      "value": 89,
      "sourceTimestamp": "2020-03-25T00:00:28.0498921Z",
      "serverTimestamp": "2020-03-25T00:00:28.0498921Z"
    }
  }
}