5 supported function codes, 6 supported function codes – GE Industrial Solutions Entellisys 4.0 Integrator's Guide User Manual
Page 30
![background image](/manuals/294929/30/background.png)
Modbus® protocol implementation
30
2
2.5 Supported function codes
Modbus officially defines function codes from 1 to 127 though only a small subset is generally
needed. The CPU supports some of these functions, as summarized in the following table.
Subsequent sections describe each function code in detail.
2.5.1 Function Code 03H/04H – Read Actual Values or Settings
This function code allows the master to read one or more consecutive data registers (actual
values or settings) from a relay. Data registers are always 16 bit (two byte) values transmitted
with high order byte first. The maximum number of registers that can be read in a single packet
is 125. See the MODBUS MEMORY MAP table on page 17 for exact details on the data registers.
Since some PLC implementations of Modbus only support one of function codes 03h and 04h,
the CPU interpretation allows either function code to be used for reading one or more
consecutive data registers. The data starting address will determine the type of data being read.
Function codes 03h and 04h are therefore identical. The following table shows the format of the
master and slave packets. The example shows a master device requesting 3 register values
starting at address 4050h from slave device 11h (17 decimal); the slave device responds with
the values 40, 300, and 0 from registers 4050h, 4051h, and 4052h, respectively.
FUNCTION CODE
MODBUS DEFINITION
CPU DEFINITION
HEX
DEC
03
3
Read Holding Registers
Read Actual Values or Settings
04
4
Read Holding Registers
Read Actual Values or Settings
05 5 Force
Single
Coil
Execute Operation
06
6
Preset Single Register
Store Single Setting
10
16
Preset Multiple Registers
Store Multiple Settings