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...")
 
 
(3 intermediate revisions by 2 users not shown)
Line 1: Line 1:
The string feature is a new function code pair:
+
Buffer support in Modbus is implemented via a new function code pair:
 +
 
 
   
 
   
 
* FC109 (hex 0x6D) for STRING READ
 
* FC109 (hex 0x6D) for STRING READ
 
* FC110 (hex 0x6E) for STRING WRITE
 
* FC110 (hex 0x6E) for STRING WRITE
 +
  
 
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''
+
 
Master:
+
'''READ'''
 +
 
 +
Master Command:
 +
 
 
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''
+
 
Master:
+
'''WRITE'''
 +
 
 +
Master Command:
 +
 
 
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:
 +
 
 
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>

Latest revision as of 15:09, 15 November 2018

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>