Ignition MQTT Engine string data type


The historic value is stored as a string datatype when transmitting to a custom namespace from a script using the system.cirruslink.transmission.publish function.
How can it be published and recieved as an int or float?


The datatypes for tags are always strings unless using the ‘Parse as JSON’ option. When using this option, datatypes are set based on the incoming JSON datatype. Those can Strings, Longs, Floats, etc. Of course in this case the incoming payload must be valid JSON. This behavior is not configurable. If you really want a different datatype and can’t change the incoming payload format, you can create a tag change script and parse the payload yourself based on the incoming string value. From there, you can create/update your own tags of the type that you want.

Great! thanks for the quick response and clarification.

We currently have a project where we are reading in sparkplug B payloads from a OEM machine in Node Red. Interestingly, during testing it was found that the spB payloads were not written to the exact specification. I will create another forum post for this as Ignition couldn’t consume the spB payloads but Node red could.

Anyway, to pass it into Ignition as a work around the payloads were re-published from node red into a custom namespace setup in Ignition and parsed as JSON as you mentioned previously, however, looking at the data type on the tag value it comes back as <type ‘Unicode’> .
Please pic below shows and example of the structure sent from Node Red (top pic).

Testing the theory of whether we should have converted the data type prior to publishing I setup a test in Node Red to send a string and long value to Ignition and checked the data type for both values but they both came back as <type ‘long’>

Do you have a capture of the raw payload you can share?