9 function codes, 10 standard message formats, Function codes – In-Situ Aqua TROLL 400 Modbus and SDI-12 Reference Guide User Manual

Page 59: Standard message formats

Advertising
background image

device will always have a published “Register Map” that defines the numerical addresses of
data values that can be accessed in the device.

Note: Register Maps typically use a 1-based numbering system whereas the protocol
requires the data address/register number passed to a device to be 0-based. In this
document, the register maps are 1-based.

Data addresses are associated with two atomic sizes of memory, 1 bit and 2 bytes. These are
divided into Read-Only Bits, Read/Write Bits, Read-Only Words and Read/Write Words each
with their own associated name as follows:

• Discretes: Read Only Bits
• Coils: Read/Write Bits
• Input Register: Read Only Word
• Holding Register: Read/Write Word

All Manufacturer Registers are Holding Registers.

8.9 Function Codes

Function codes in a message packet tell the device what operation to perform. The function
code is always in the byte following the device address. Some of the standard function codes
are as follows:

• 01: Read Coil
• 02: Read Discrete
• 03: Read Holding Registers
• 04: Read Input Registers
• 05: Write Coil
• 06: Write single Holding Register
• 15: Write multiple Coils
• 16: Write multiple Holding Registers
• 17: Read slave device ID
• 22: Mask write Holding Register

The slave device ID is an implementation defined response that will vary with manufacturer
and/or device.
Function codes from 65 to 72 and 100 to 110 can be used as custom function codes.

8.10 Standard Message Formats

The manufacturer has implemented a sub-set of the standard function codes in every Modbus-
enabled instrument. These message formats are defined in this section.

59

Advertising
This manual is related to the following products: