Add MQTT Publisher
Configure a MQTT Publisher to publish messages to MQTT Broker defined Topic. Any MQTT client subscribed to that Topic receives the messages.
TIP:
The publisher only supports scalar variables. Arrays, UDTs, and other
non-scalar variables are not supported.
- In Project view, right-clickMQTT, and select .
- InProperties, configure:
- Sampling mode
- None- automatic recording is disabled. You can record by invoking the Sample method
- Periodic- at regular intervals records the values of all selected variables
- Change in value- at regular intervals records only the values of the selected variables that have changed since to the previous sampling.
- Sampling period
- Frequency of logging the variable to the database. An interval in hours, with millisecond precision, between one sampling and the next.
- Polling time
- Frequency of reading/updating the variable from the external or internal source such as a controller, or theFactoryTalk Optixmodel. An interval in hours, with millisecond precision, between one polling and the next.
- Data source
- Specify data source:
- Folder- A folder that contains variables whose values will be sent to the broker. The Folder node must be a global object and not a session-based object.
- Data logger- Specifies which data logger set of variables is published.
- Topic
- An MQTT Topic to which the publisher sends messages.
- QoS
- MQTT Quality of Service (QoS), defines the guarantee of delivery for a specific message:0- At most once (loss of messages is possible).1- At least once (ensures message delivery with possible duplicate messages).2- Exactly once (ensures message delivery without duplication).
- Retain
- Enables or disables retaining read messages on the topic.
- Store and Forward
- Store and Forward stores data in case of temporary connection loss to storage. See Store and Forward.
- SF Enabled. Enables or disables Store and Forward.
- SF Buffer Max Size. Maximum number of elements in the buffer, which can be set from 1 to 100000. An element is one entry (row) in a database table.
- SF Buffer Overwrite. When set toTrue, overwrites oldest entries with new data when the buffer limit is reached. When set toFalse, ignores new data when the buffer limit is reached.TIP: The following diagnostic, read-only properties are available:SF Buffer usage. Displays the current number of elements in the buffer.SF Buffer overflow. False - indicates that currently upcoming data is handled. True - indicates that the buffer is full and currently upcoming data is ignored.
In
Project view
, in the MQTT
folder, the MQTT Publisher
object appears.Provide Feedback