Industrial
Electronic Devices
ADFweb.com S.r.l.
User Manual
Modbus Master / MQTT
Document code: MN67933_ENG Revision 1.001 Page 32 of 36
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:
{
"slave id":$SOURCE$,
"fc":$FC$,
"address":$ADDRESS$,
"npoint":$NPOINT$,
"value":"$VALUE$"
}
Where:
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