Changes

m
+ table
Line 61: Line 61:     
''You can change Request and Response topics that you will have to publish and subscribe to get information from Modbus TCP Master through MQTT Gateway, but for this example they are left on default topics''
 
''You can change Request and Response topics that you will have to publish and subscribe to get information from Modbus TCP Master through MQTT Gateway, but for this example they are left on default topics''
 +
 +
== Message format for MQTT publisher ==
 +
Format is in text - heavier and slower, but less difficult to edit.
 +
{| class="wikitable"
 +
|1.  Format version
 +
|0
 +
|-
 +
|2. Cookie
 +
|from '''0''' to '''2<sup>64</sup> -1'''
 +
|-
 +
|3. IP Type
 +
|0 - IPv4; 1 - IPv6; 2 - hostname
 +
|-
 +
|4. IP
 +
|IPv6 must be in full format (for example: 2001:0db8:0000:0000:0000:8a2e:0370:7334)
 +
|-
 +
|5. Port
 +
|Port number (for example: 502)
 +
|-
 +
|6. Timeout in seconds (time to wait for response)
 +
|from 1 to 999
 +
|-
 +
|7. Slave ID - Indicates to which slave request is sent
 +
|from 1 to 255
 +
|-
 +
|8. Function
 +
|3 - read registers; 6 - write single register; 16 - write multiple registers
 +
|-
 +
|9. Number of first register from which information will be read or written
 +
|from 1 to 65535
 +
|-
 +
|10. Registry value
 +
|If function is 3 - from 1 to 123 (first register + registry value can not go out of range);
 +
If function is 6 - from 0 to 65535
 +
 +
If function is 16 - from 1 to 123 (first register + registry value can not go out of range), Registry values separated by commas without spaces. Example.: 1,2,3,654,21,789. There has to be as many values, as specified number of registers, and each value must be between 0 and 65535. If number of registries is 0, there should be no registry values
 +
|}

Navigation menu