Protocol description¶
The MODICON Modbus® RTU protocol is implemented in the AC500 Processor Modules.
Numerous automation devices, such as PLC installations, displays, variable-frequency inverters or monitoring systems, for instance, have a Modbus® RTU interface by default or as an option and can therefore communicate with the AC500 Processor Modules without any problems via the serial interfaces COM1 and COM2 (RS-485 at PM55x and PM56x; RS-232 or RS-485 at PM57x, PM58x and PM59x).
Modbus® is a master-slave protocol. The server sends a request to the client and receives its response.
Both interfaces COM1 and COM2 can work as Modbus® interfaces simultaneously.
The Modbus® operating mode of an interface is set with several function blocks.
Modbus server
In operating mode Modbus server, the telegram traffic with the client(s) is handled via the function block MODMAST. The function block COM_MOD_MAST sends Modbus request telegrams to the client via the set interface and receives Modbus response telegrams from the client via this interface.
For Modbus on TCP/IP, the function block ETH_MOD_MAST ETH_MOD_MAST: ETH_MOD_MAST ETH_MOD_MAST is used and for serial interfaces the function block COM_MOD_MAST: COM_MOD_MAST COM_MOD_MAST.
The Modbus® blocks transferred by the server contain the following information:
- Modbus® address of the interrogated client (1 byte)
- Function code that defines the request of the server (1 byte)
- Data to be exchanged (n bytes)
- CRC16 control code (2 bytes)
Modbus client
In operating mode Modbus client, no function block is required for Modbus communication. Sending and receiving Modbus telegrams is performed automatically.
The AC500 CPUs process only 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 |
07 | 07 | Fast reading the status byte of the CPU |
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 | Serial | Modbus on TCP/IP |
01 or 02 | 01 or 02 | 2000 bits | 255 bits (up to Communication Module FW V01.033) 1800 bits (as of Communication Module FW V01.041) |
03 or 04 | 03 or 04 | 125 words / 62 double words | 100 words / 50 double words |
05 | 05 | 1 bit | 1 bit |
06 | 06 | 1 word | 1 word |
07 | 07 | 8 bits | 8 bits |
15 | 0F | 1968 bits | 255 bits (up to Communication Module FW V01.033) 1800 bits (as of Communication Module FW V01.041) |
16 | 10 | 123 words / 61 double words | 100 words / 50 double words |
22 | 16 | Write: 1 word | Write: 1 word |
23 | 17 | Read: 125 words / 62 double words Write: 123 words / 61 double words |
Read: 125 words / 62 double words Write: 123 words / 61 double words |