Technical FAQs

Ask a Question

What are the supported Modbus Function Codes for a M221 controller?

This table lists the function codes supported by both serial Modbus and Modbus TCP and their effect on controller memory variables:
Supported Modbus
Function Code
Supported Sub-
Function Code
1 (0x01)           - Read multiple internal bits %M
2 (0x02)           - Read multiple internal bits %M
3 (0x03)           - Read multiple internal registers %MW
4 (0x04)           - Read multiple internal registers %MW
5 (0x05)           - Force single internal bit %M
6 (0x06)           - Write single internal register %MW
8 (0x08) 0 (0x00), 10
(0x0A)...18 (0x12)
15 (0x0F)           - Write multiple internal bits %M
16 (0x10)           - Write multiple internal registers %MW
23 (0x17)           - Read/write multiple internal registers %MW
43 (0x2B) 14 (0x0E) Read device identification (regular service)
Note: For function code 5 and 6 you must use the EXCH function. These two function codes are not available with the WRITE_VAR function block
Was this helpful?
What can we do to improve the information ?