Industrial
Electronic Devices
ADFweb.com S.r.l.
User Manual
Modbus Master / MQTT
Document code: MN67933_ENG Revision 1.101 Page 38 of 45
TEMPLATE STRING: DEFINITION OF MQTT PAYLOAD
In the section “Set Communication” of the SW67933, if “Synchronous” mode is selected, it is possible to define a Template string for the
MQTT messages. The template is necessary in order to define the structure of the payload of the MQTT message and the info contained.
It is possible to have a simple text format or a JSON format.
This template is valid for the Modbus requests in reading.
The definition of the template can be done using Key words, used to link a specific information of the Modbus requests. The key words used
and their meanings are:
SOURCE: ID of the Modbus slave
FC: Function code
ADDRESS: Modbus register
NPOINT: Number of consecutive Modbus registers
TYPE: The type of message is defined (request or response)
CRC: validation of the CRC (OK or wrong)
VALUE: value of the Modbus variable
DESC: description of the Modbus request (define in the “Modbus Set Access” table)
DATA: Modbus string (hex format)
TIME: date and time of the Modbus message
Warning:
The key words must be defined between “$” chars in order to be recognized (Ex.: $DATA$).