Protocol:Modbus:Strings

From Serious Documentation
Jump to: navigation, search

Buffer support in Modbus is implemented via a new function code pair:


  • FC109 (hex 0x6D) for STRING READ
  • FC110 (hex 0x6E) for STRING WRITE


The strings are null terminated, and the packet format looks like this:


READ

Master Command:

Byte 0: 0xXX // slave address

Byte 1: 0x6D // for string read

Byte 2,3: 0xYYYY // address of string


Slave Response:

Byte 0: 0xXX // slave address

Byte 1: 0x6D // for string read

Byte 2: 0xXX // number of bytes in string, including \0

Byte 3…. <string data, null terminated>


WRITE

Master Command:

Byte 0: 0xXX // slave address

Byte 1: 0x6E // for string write

Byte 2,3: 0xYYYY // address of string

Byte 4: 0xXX // number of bytes in string including \0

Byte 5…. <string data, null terminated>


Slave Response:

Byte 0: 0xXX // slave address

Byte 1: 0x6D // for string write

Byte 2,3: 0xYYYY // address of string

Byte 4: 0xXX // number of bytes in string including \0

Byte 5…. <string data, null terminated, of what was actually acknowledge and set, may not match the request if request cannot be honored>