# Modbus Function Codes; Supported Function Codes; Read Actual Values Or Settings (function Code 03/04h) - GE B30 Communications Manual

Universal relay family.

## MODBUS FUNCTION CODES

Algorithm
2
2.2 Modbus function codes

### 2.2.1 Supported function codes

Modbus officially defines function codes from 1 to 127 though only a small subset is generally needed. The relay supports
some of these functions, as summarized in the following table. Subsequent sections describe each function code.
Table 2-4: Function codes
Function code
Hex
Dec
03
3
04
4
05
5
06
6
10
16

### 2.2.2 Read actual values or settings (function code 03/04h)

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
registers.
Since some PLC implementations of Modbus only support one of function codes 03h and 04h. The UR interpretation allows
either function code to be used for reading one or more consecutive data registers. The data starting address determines
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 in Modbus RTU. Modbus TCP/IP ADUs have a MBAP
instead of slave address, and CRC is in another stack layer. The example shows a master device requesting three 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.
Table 2-5: Master and slave device packet transmission example
Master transmission
Packet format
FUNCTION CODE
2-4
1.
FFFF (hex) --> A
2.
0 --> i
3.
0 --> j
4.
Di (+) Alow --> Alow
5.
j + 1 --> j
6.
shr (A)
7.
Is there a carry?
8.
Is j = 8?
9.
i + 1 --> i
10.
Is i = N?
11.
A --> CRC
Modbus definition
Force single coil
Preset single register
Preset multiple registers
Example (Hex)
11
04
40
50
No: go to 8; Yes: G (+) A --> A and continue.
No: go to 5; Yes: continue
No: go to 3; Yes: continue
GE Multilin definition
Execute operation
Store single setting
Store multiple settings
Reading PMU records section on page 2-11
Slave response
Packet format
FUNCTION CODE
BYTE COUNT
DATA #1 - high
CHAPTER 2: MODBUS COMMUNICATION
for the data
Example (Hex)
11
04
06
00
UR FAMILY – COMMUNICATIONS GUIDE