ModbusTCP Functions

In the Modbus protocol, the functions determine whether data is to be read or written, and what kind of data is involved.

Function

Code

Description

Read coil status

1

Read digital outputs

Read input status

2

Read digital inputs

Read holding register

3

Read analog outputs and inputs / GPR

Read input register

4

Read analog inputs / GPR

Force single coil

5

Writing a digital output

Preset single register

6

Write one analog output / GPR

Diagnostic

8

Diagnostic

Force multiple coils

15

Write a number of digital outputs

Preset multiple register

16

Write a number of analog outputs / GPRs

Read / Write Registers

23

Write and read a number of process data outputs / GPRs

GPR (General Preset Register) - register structure of the Modbus interface (see Appendix)