Difference between revisions of "Protocol:Modbus:Strings"

From Serious Documentation
Jump to: navigation, search
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'''
 
'''READ'''
Master:
+
 
 +
Master Command:
  
 
Byte 0:                  0xXX                      // slave address
 
Byte 0:                  0xXX                      // slave address
Line 16: Line 19:
  
  
Slave Response
+
Slave Response:
  
 
Byte 0:                  0xXX                      // slave address
 
Byte 0:                  0xXX                      // slave address
Line 25: Line 28:
  
 
Byte 3….              <string data, null terminated>
 
Byte 3….              <string data, null terminated>
 +
  
 
'''WRITE'''
 
'''WRITE'''
  
Master:
+
Master Command:
 +
 
 
Byte 0:                  0xXX                      // slave address
 
Byte 0:                  0xXX                      // slave address
  
Line 38: Line 43:
  
 
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

Revision as of 15:08, 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 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>