Performant way to get JSON or XML from tags

Are there recommendations for creating XML or JSON from tag values?

Background: For connecting machines to our MES, we use an API that accepts events (machine cycles, process & piece data...) in these formats.

What we have done so far (=our concept): We created UDTs to reference the needed tags in Ignition. An expression tag is part of the UDT to hold the XML/JSON content. That tag is SCRIPTED. (It will refresh its XML/JSON content only when necessary — triggered in its own tag group on a rising edge trigger. Once activated, ⇒ feed a stored procedure with that expression tag value).

My concern: Even when the XML/JSON expression tag does only refresh when needed, the calculation might get slow once we use n different events and connect nn machines.

Is there a performant or quick way to get the JSON or XML representation of tags or tag groups (UDTs)?

Thanks for any feedback,
Regards!
Franz Löschenberger

Consider using a gateway tag change event instead.

You may find this thead of interest:

2 Likes

Consider not using an expression tag. Simply use a single gateway tag change event script that constructs the JSON and submits it to the API. Give it a dedicated thread.

1 Like