
Modbus Protocol Basics
6
Modbus functions
Modbus data types
•
Coil
(1 bit) – forces the ON/OFF state of discrete outputs (DO) or modifies mode / status of client devices.
Coil is both read and write. Addresses are in the
1
to
9999
range.
•
Discrete input
(1 bit) – requests input status of field discrete inputs (DI) or the client devices status.
Input status data is read only. Addresses are in the
10001
to
19999
range.
•
Input register
(16 bit) – provides field analog inputs (AI) or client devices information. Input register is
read only. Floating or double integer data can be handled if consecutive addresses are assigned. Addresses
are in the
30001
to
39999
range.
•
Holding register
(16 bit) – receives data from field analog outputs (AO) or sets information on client
device. Holding register is both read and write. Floating or double integer data can be handled if consecutive
addresses are assigned. Addresses are in the
40001
to
49999
range.
Access type Access size Internal data type
Function Name and code
Data
bit
Physical discrete inputs
Read discrete inputs
2
Internal bits or
physical coils
Read coils
1
Write coil
5
Write multiple coils
15
16 bit
Physical input register
Read input register
4
Internal register or
physical output register
Read holding register
3
Write single register
6
Write multiple registers
16
Read/write multiple registers
23
Mask write register
22
Read FIFO queue
24
File record access
Read file record
20
Write file record
21
Diagnostic
Read exception status
7
Diagnostic
8
Get COM event counter
11
Get COM event log
12
Report server ID
17
Read device ID
43