Versions Compared

Key

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

...

Start by opening an Ignition Designer window and double clicking 'Project-> Gateway Event Scripts' from the Project Browser as shown below:

Image Modified

 

Now select 'Tag Change' click the 'new Tag' icon at the bottom of the window shown below.

Image Modified

Set the name of the script and then select a tag path.  In this case we're using an MQTT Engine tag from an emulated device.

Image Modified

Now select the 'Script' tab near the top.  In it, type the following line

...

  • serverName: The server name as shown in the MQTT Engine Settings configuration shown below
  • mqttTopic: The MQTT Topic to publish on
  • payload: The MQTT payload
  • qos: The MQTT quality of service to publish on
  • retain: Whether or not to set the retain flag in the MQTT message

Image Modified
When complete, the script should look something like this.  Now click OK.

Image Modified

At this point every time this tags value, quality, or timestamp changes it will result in a MQTT message being published on topic 'a/b/c' with a payload of 'hello world'.

...