Overview

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 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

Requirements

Development environment

Target system type

PLC libraries to be linked

TwinCAT v3.0.0

PC or CX (x86)

Tc2_ModbusSrv