Difference between revisions of "Protocol:Modbus:Strings"

From Serious Documentation
Jump to: navigation, search
(Created page with "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 forma...")
 
Line 6: Line 6:
 
The strings are null terminated, and the packet format looks like this:
 
The strings are null terminated, and the packet format looks like this:
  
''READ''
+
'''READ'''
 
Master:
 
Master:
 +
 
Byte 0:                  0xXX                      // slave address
 
Byte 0:                  0xXX                      // slave address
 +
 
Byte 1:                  0x6D                      // for string read
 
Byte 1:                  0x6D                      // for string read
 +
 
Byte 2,3:              0xYYYY                  // address of string
 
Byte 2,3:              0xYYYY                  // address of string
 +
  
 
Slave Response
 
Slave Response
 +
 
Byte 0:                  0xXX                      // slave address
 
Byte 0:                  0xXX                      // slave address
 +
 
Byte 1:                  0x6D                      // for string read
 
Byte 1:                  0x6D                      // for string read
 +
 
Byte 2:                0xXX                      // number of bytes in string, including \0
 
Byte 2:                0xXX                      // number of bytes in string, including \0
 +
 
Byte 3….              <string data, null terminated>
 
Byte 3….              <string data, null terminated>
  
''WRITE''
+
'''WRITE'''
 +
 
 
Master:
 
Master:
 
Byte 0:                  0xXX                      // slave address
 
Byte 0:                  0xXX                      // slave address
 +
 
Byte 1:                  0x6E                      // for string write
 
Byte 1:                  0x6E                      // for string write
 +
 
Byte 2,3:              0xYYYY                  // address of string
 
Byte 2,3:              0xYYYY                  // address of string
 +
 
Byte 4:                0xXX                      // number of bytes in string including \0
 
Byte 4:                0xXX                      // number of bytes in string including \0
 +
 
Byte 5….              <string data, null terminated>
 
Byte 5….              <string data, null terminated>
  
 
Slave Response is identical, as is normal
 
Slave Response is identical, as is normal
 +
 
Byte 0:                  0xXX                      // slave address
 
Byte 0:                  0xXX                      // slave address
 +
 
Byte 1:                  0x6D                      // for string write
 
Byte 1:                  0x6D                      // for string write
 +
 
Byte 2,3:              0xYYYY                  // address of string
 
Byte 2,3:              0xYYYY                  // address of string
 +
 
Byte 4:                0xXX                      // number of bytes in string including \0
 
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>
 
Byte 5….              <string data, null terminated, of what was actually acknowledge and set, may not match the request if request cannot be honored>

Revision as of 12:42, 27 February 2015

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>