TcModbusSrv

The defined modbus functions are implemented in the PLC library TcModbusSrv.lib.

Modbus TCP function

Function code

PLC block

Read Coils

1

FB_MBReadCoils

Read Discrete Inputs

2

FB_MBReadInputs

Read Registers

3

FB_MBReadRegs

Read Input Registers

4

FB_MBReadInputRegs

Write Single Coil

5

FB_MBWriteSingleCoil

Write Single Register

6

FB_MBWriteSingleReg

Write Multiple Coils

15

FB_MBWriteCoils

Write Multiple Registers

16

FB_MBWriteRegs

Read/Write Multiple Registers

23

FB_MBReadWriteRegs

Diagnostic

8

FB_MBDiagnose

Modbus UDP function

Function code

PLC block

Read Coils

1

FB_MBUdpReadCoils

Read Discrete Inputs

2

FB_MBUdpReadInputs

Read Registers

3

FB_MBUdpReadRegs

Read Input Registers

4

FB_MBUdpReadInputRegs

Write Single Coil

5

FB_MBUdpWriteSingleCoil

Write Single Register

6

FB_MBUdpWriteSingleReg

Write Multiple Coils

15

FB_MBUdpWriteCoils

Write Multiple Registers

16

FB_MBUdpWriteRegs

Read/Write Multiple Registers

23

FB_MBUdpReadWriteRegs

Diagnostic

8

FB_MBUdpDiagnose