1. Overview
The Siemens S7-1200 series PLC supports Modbus RTU master/slave functions through the CM1241 RS485 communication module. Based on the official Siemens technical documentation, this article explains the Modbus address mapping rules of the S7-1200 in detail.
2. Modbus Address Types
| Modbus Address Area | Function Code | Read/Write | S7-1200 Memory Area |
| 0xxxx (Coils) | 01/05/15 | Read/Write | Q output bits / M bits |
| 1xxxx (Discrete Inputs) | 02 | Read-only | I input bits |
| 3xxxx (Input Registers) | 04 | Read-only | IW analog inputs |
| 4xxxx (Holding Registers) | 03/06/16 | Read/Write | MW / DBD data blocks |
3. S7-1200 Modbus Address Mapping Table
3.1 I Input Area → 1xxxx Discrete Inputs
| Modbus Address | S7-1200 Address | Description |
| 10001 | I0.0 | Input bit 0 |
| 10002 | I0.1 | Input bit 1 |
| ... | ... | And so on |
3.2 Q Output Area → 0xxxx Coils
| Modbus Address | S7-1200 Address | Description |
| 00001 | Q0.0 | Output bit 0 |
| 00002 | Q0.1 | Output bit 1 |
| ... | ... | And so on |
3.3 M Memory Area / DB Blocks → 4xxxx Holding Registers
| Modbus Address | S7-1200 Address | Description |
| 40001 | MW0 | Memory word 0 |
| 40002 | MW2 | Memory word 1 |
| ... | ... | Or data in a DB block |
4. Modbus Instructions
The S7-1200 uses the following Modbus instructions:
- MB_COMM_LOAD: Port initialization
- MB_MASTER: Modbus master
- MB_SLAVE: Modbus slave
5. FAQ and Troubleshooting
- Check that the CM1241 module is installed correctly
- Verify the communication parameter settings (baud rate, parity)
- Pay attention to the non-optimized block access attribute of data blocks
- Check that the MB_COMM_LOAD instruction executes correctly
6. Summary
Modbus address mapping rules for the Siemens S7-1200:
- 0xxxx Coils → Q output bits / M bits
- 1xxxx Discrete Inputs → I input bits
- 4xxxx Holding Registers → MW memory words / DB block data
Leave a Reply