
Industrial
Electronic Devices
ADFweb.com S.r.l.
User Manual
Modbus TCP Master / MQTT
Document code: MN67935_ENG Revision 1.001 Page 33 of 37
MODBUS WRITING WITH SYNCHRONOUS MODE
If “Synchronous” mode is selected, in order to send the Modbus writing requests it is necessary to use a specific MQTT payload.
In this way, the converter can get all the info ned and compose the Modbus request. It is necessary to use a JSON format, described below:
{
"ip address":$ip address$,
"port":$port$,
"slave id":$SOURCE$,
"fc":$FC$,
"address":$ADDRESS$,
"npoint":$NPOINT$,
"value":"$VALUE$"
}
Where:
ip address: IP Address of the Modbus TCP slave to write
port: TCP port to use for the connection
SOURCE: ID of the Modbus slave
FC: Function code
ADDRESS: Modbus register
NPOINT: Number of consecutive Modbus registers
VALUE: value of the Modbus variable (hex format)
Note:
If a field is missing or wrong JSON is sent, the Modbus writing request is not sent by the converter