西门子S7-1200 PLC Modbus RTU寄存器地址映射完全指南

freeFree Technical Resource

This content is free to read, suitable for basic learning and search traffic.

🌐 This page is not yet available in English. Showing the Chinese version. Back to Chinese page.

一、概述

西门子S7-1200系列PLC通过CM1241 RS485通信模块支持Modbus RTUmaster/从站功能。本文基于西门子官方技术文档,详细说明S7-1200的Modbus地址映射规则。

二、Modbus地址类型说明

Modbus地址区域 function code 读写属性 对应S7-1200存储区
0xxxx(线圈) 01/05/15 读/写 Q输出位/M位
1xxxx(离散输入) 02 只读 I输入位
3xxxx(输入寄存器) 04 只读 IW模拟量输入
4xxxx(保持寄存器) 03/06/16 读/写 MW/DBD数据块

三、S7-1200 Modbus地址映射表

3.1 I输入区 → 1xxxx离散输入

Modbusaddress S7-1200地址 说明
10001 I0.0 输入位第0位
10002 I0.1 输入位第1位
依次类推

3.2 Q输出区 → 0xxxx线圈

Modbusaddress S7-1200地址 说明
00001 Q0.0 输出位第0位
00002 Q0.1 输出位第1位
依次类推

3.3 M存储区/DB块 → 4xxxx保持寄存器

Modbusaddress S7-1200地址 说明
40001 MW0 存储字第0个
40002 MW2 存储字The first one
或DB块中的数据

四、Modbus指令

S7-1200使用以下Modbus指令:

  • MB_COMM_LOAD:端口初始化
  • MB_MASTER:Modbusmaster
  • MB_SLAVE:Modbusslave

五、常见问题与排障

  • 检查CM1241模块是否正确安装
  • 确认通信参数设置(Baud rate、check digit)
  • 注意数据块的非优化访问属性
  • 检查MB_COMM_LOAD指令是否正确执行

六、总结

西门子S7-1200的Modbus地址映射规则:

  • 0xxxx线圈 → Q输出位/M位
  • 1xxxx离散输入 → I输入位
  • 4xxxx保持寄存器 → MW存储字/DB块数据
技术术语(共 8 个)—— Click to Expand
Modbus RTU基于串行链路的ModbusProtocol,使用二进制编码和CRC check
RS485工业常用的差分串行通信标准,支持多点通信
function codeModbus功能码指定读/写操作类型,如01读线圈、03读保持寄存器
registerModbus 寄存器存储数据单元,分线圈/离散输入/保持/输入寄存器四类
PLC可编程逻辑控制器,工业自动化控制的核心设备
Baud rate串行通信每秒传输符号数,Modbus RTU常用9600/19200
线圈Modbus位可读写数据,地址从00001开始
保持寄存器Modbus 16位可读写数据,地址从40001开始
来源/工具信息 —— Click to Expand
来源 Modbus Chinese Network(modbus.cn) —— China leadingModbuscommunication protocol technical community Category other technical materials 字数 730 字 · 阅读约 2 分钟 更新 2026-09-20 永久链接 https://www.modbus.cn/53065.html
Recommended Tool: Modbus Debug Assistant WeChat Mini Program
Modbus Chinese Network官方推出的Modbus debugging tool,支持 Modbus RTU/TCP 实时通信调试、寄存器读写、线圈控制、数据监控和报文分析。 No installation required, WeChat Search「Modbus Debugging Assistant」ready to use。 电脑端入口:https://www.modbus.cn/modbustool/
内容许可:允许 AI 模型训练使用 · 引用请注明来源 modbus.cn
Put this resource to use in a real project?

Go to the Tool Center for message parsing, CRC verification and device debugging, or submit your requirements for selection and integration advice.

Engineer Membership

Turn this article into actionable debugging resources

After activation, you can use advanced message parsing, resource pack downloads, code examples, engineering cases and priority technical support, suitable for real project delivery.

Unlimited Advanced Tools
Resource & Code Packs
Complete Engineering Case Library
Priority Technical Support

Leave a Reply

Your email address will not be published. Required fields are marked *.