Protocol descriptionΒΆ

The MODBUS TCP protocol is implemented in the AC500 Processor Modules.

MODBUS is a master-slave (client-server) protocol. The client sends a request to the server(s) and receives the response(s).

Each ETHERNET interface can work as MODBUS client and server interface in parallel if required.

The MODBUS operating mode of an ETHERNET interface is set in : MODBUS Protocol

MODBUS client

In this operating mode, the telegram traffic with the server(s) is handled via the Function Block ETHx_MOD_MAST: ETHx_MOD_MASTMODBUS request telegrams to the server(s) via the set interface and receives MODBUS response telegrams from the server(s) via this interface.

The MODBUS Function Blocks transferred by the client contain the following information:

  • Transaction identifier for synchronization between messages of server and client (2 byte)
  • Protocol identifier (0 for MODBUS/TCP) (2 byte)
  • Length field (Number of bytes in frame) (2 byte)
  • Unit identifier (1 byte)
  • Function code that defines the request of the client (1 byte)
  • Data to be exchanged (n bytes)

MODBUS server

In this operating mode, no Function Block is required for MODBUS communication. Sending and receiving MODBUS telegrams is performed automatically.

The AC500 CPUs process the following MODBUS operation codes:

Function code Description
DEC HEX
01 or 02 01 or 02 Read n bits
03 or 04 03 or 04 Read n words
05 05 Write one bit (encoded in one word)
06 06 Write one word
     
15 0F Write n bits (encoded in one byte)
16 10 Write n words
22 16 Mask write
23 17 Read/write multiple words in one telegram

The following restrictions apply to the length of the data to be sent:

Function code Max. length
DEC HEX
01 or 02 01 or 02 2000 bits
03 or 04 03 or 04 125 words / 62 double words
05 05 1 bit
06 06 1 word
15 0F 2000 bits
16 10 123 words / 61 double words
22 16 Write: 1 word
23 17

Read: 125 words / 62 double words

Write: 123 words / 61 double words