Protocol:Modbus:Strings

From Serious Documentation
Revision as of 12:42, 27 February 2015 by Admin (talk | contribs)
Jump to: navigation, search

The string feature is 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:

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: 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 is identical, as is normal

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>