Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

...

MQTT Engine provides a mechanism for publishing MQTT Messages from an Ignition script.  This can be useful for general messaging outside of Sparkplug.  For example, one may want to interface to another system that uses MQTT.  This method allows arbitrary MQTT messages to be published based on events that exist in Ignition.

Note
MQTT Engine must have a client connection to a broker to use the publish mechanism. This is configured here



MQTT Message Publishing via Ignition Script:

...

payload=str('{"name":"John", "age":30, "car":"BMW"}').encode()

payload='{"myTestTag":"' + str(system.tag.read("[default]myTestTag").value) + '"}'


Additional Resources