Ixon MQTT Evaluation: Convert data structure into a more usable format

I'm evaluating an MQTT solution for data collection on a certain machine. The data comes in an odd way. I'm not really getting individual tags like I would expect, but a series of values in an array.

I'm wondering if I can make the data more usable and transform this data where the name is an actual tag instead of an item in the metrics array. Any ideas?

It seems like unnecessary overhead to be required to parse the payload and write the values to tags every time seq increments.

{
  "metrics": [
    {
      "alias": 2,
      "datatype": 12,
      "name": "Disturbancetime",
      "timestamp": 1724348040000,
      "value": "396:30:42"
    },
    {
      "alias": 6,
      "datatype": 12,
      "name": "Maintenancetime",
      "timestamp": 1724348040000,
      "value": "00:00:00"
    },
    {
      "alias": 11,
      "datatype": 12,
      "name": "Operationtime",
      "timestamp": 1724348040000,
      "value": "736:55:12"
    },
    {
      "alias": 16,
      "datatype": 12,
      "name": "Setuptime",
      "timestamp": 1724348040000,
      "value": "242:43:27"
    },
    {
      "alias": 18,
      "datatype": 12,
      "name": "Standstilltime",
      "timestamp": 1724348040000,
      "value": "1691:27:31"
    },
    {
      "alias": 20,
      "datatype": 10,
      "name": "Totaloperationtime",
      "timestamp": 1724348040000,
      "value": 3
    },
    {
      "alias": 22,
      "datatype": 3,
      "name": "Velocity",
      "timestamp": 1724348040000,
      "value": 10312
    }
  ],
  "seq": 230,
  "timestamp": 1724348040008
}

This looks like a Sparkplug payload. You aren't meant to parse it yourself (though you can, since this is the JSON encoded payload), you're meant to use something that understands Sparkplug on both ends.

Are you using the Ignition MQTT modules?

1 Like

Yes, I am. The data is coming from an Ixon router, which supports Sparkplug B; however, it was not being parsed correctly on Cirrus Link's side (no tags displayed). Something about google protobufs, so I tried straight JSON format.

If the Sparkplug format would handle the structure better, as you suggested, I will switch back and debug it further with Cirrus Link's support.

Turns out that Ixon deviates from the Sparkplug spec as they do not send a birth message which Engine requires. The JSON format is as good as it gets :frowning:

Ixon Docs
image

:roll_eyes: :roll_eyes: :roll_eyes:

Special place in hell for people who take something with a specification and tweak it such that it's incompatible with that specification.

4 Likes

This calls for the extreme eye-roll:

xtra_roll_eyes

(Credit to @Felipe_CRM )

5 Likes

I would say that it is failing your evaluation and I would look for something else. You might check out RedLion's DA10/DA30/DA50 line as I believe they support SparkplugB and can talk to lots of different devices.

1 Like

The Ixon router is part of an OEM machine, I don't have admin access to its configuration, so I can't just replace it. At least, that I'm aware of.

The good news is the OEM is working on an OPC-UA server as an alternative. I can only hope that it conforms to the OPC-UA spec :sweat_smile:

I'm going to be a beta tester, hopefully, this fall.