"DATA_ADDR" 参数
SIMOCODE pro V Modbus RTU 可以存储输入和输出的过程映像区和内存映像中顺序保存寄存器。因此,您可以通过内存区(逐位)或寄存器存储区(逐字)访问输入和输出位。
下表显示了在 SIMOCODE pro V Modbus RTU内存映像区的起始地址的偏移量,使用时必须添加此偏移量来计算“data_addr”参数的对应值
| Memory area | Start address | Offset | DATA_ADDR |
|---|---|---|---|
| Process image of the outputs (command data) | 0x0000 |
1 (bit by bit) 40001 (word by word) |
1 (bit by bit) 40001 (word by word) |
| Process image of the inputs (monitoring data) | 0x0400 |
1 (bit by bit) 40001 (word by word) |
1025 (bit by bit) 41025 (word by word) |
| Measured values | 0x0800 | 40001 | 42049 |
| Display and statistics data | 0x0C00 | 40001 | 43073 |
| Device diagnostics | 0x1C00 | 40001 | 47169 |
| Error memory | 0x2100 | 40001 | 48449 |
| Event memory | 0x2200 | 40001 | 48705 |
| Trace data | 0x2A80 | 400001 | 410881 |
| I&M0 (device identification) | 0x4000 | 400001 | 416385 |
| I&M1 (data) | 0x4020 | 400001 | 416417 |
| I&M2 (installation date) | 0x4040 | 400001 | 416449 |
| I&M3 (comment) | 0x4060 | 400001 | 416481 |
| Basic device parameter 1 | 0x4180 | 400001 | 416769 |
| Extended device parameter 1 | 0x4380 | 400001 | 417281 |
| Labels | 0x4880 | 400001 | 418561 |
通过在内存映射中的存储顺序,其他偏移量(函数代码)也用于访问输入和输出的进程映像。
字节顺序
SIMOCODE pro V Modbus RTU 存储了大端模式下比一个字节要长的数据。FB”modbus_master”需要一个标准的访问存储区(优化访问禁用),CPU中的数据存储模式也是大端模式,这就意味着保留了字节顺序。
当从内存区(逐位)访问时,字节顺序反转。
下表通过示例说明了在CPU中存储数据的过程,读取对来自内存区域的输入的进程映像(逐位)。
| SIMOCODE pro V MR | CPU | ||||
|---|---|---|---|---|---|
| Register address | high/low | Coil address | Status | Holding register | Status |
| 0x0400 | low | 0x0400 | 0 | holdReg[0] | 2#1010_0010_0000_0000 |
| 0x0401 | 1 | ||||
| 0x0402 | 0 | ||||
| 0x0403 | 0 | ||||
| 0x0404 | 0 | ||||
| 0x0405 | 1 | ||||
| 0x0406 | 0 | ||||
| 0x0407 | 1 | ||||
| high | 0x0408 | 0 | |||
| 0x0409 | 0 | ||||
| 0x040A | 0 | ||||
| 0x040B | 0 | ||||
| 0x040C | 0 | ||||
| 0x040D | 0 | ||||
| 0x040E | 0 | ||||
| 0x040F | 0 | ||||
更多信息
SIMOCODE pro V Modbus RTU 内存映射的更多信息请参考以下功能手册 SIMOCODE pro - Communication.
更多关于FB”modbus_master”的信息及其参数可在TIA 博途信息系统或系统手册中查询
STEP 7 Professional V14 SP1.
原创文章,作者:ximenziask,如若转载,请注明出处:https://www.zhaoplc.com/plc342096.html

微信扫一扫
支付宝扫一扫