目录
目录............................................................................................................................ 2
1.该规范的发展概况................................................................................................. 3
2.概述......................................................................................................................... 3
2.1 面向连接……………………………………………………………………….. 3
2.2 数据编码………………………………………………………………………..4
2.3 参考编号的解释………………………………………………………………..4
2.4 隐含长度基本原则............................................................................................. 5
3. 一致性等级概述................................................................................................... 5
3.1 类型 0………………………………………………………………………...... 5
3.2 类型 1.................................................................................................................. 5
3.3 类型 2………………………………………………………………………...... 6
3.4 机器/厂家/网络的特殊功能................................................................................ 7
4.协议结构.................................................................................................................. 7
5. 一致性等级的协议参考值.................................................................................... 8
5.1 类型 0 指令详述.................................................................................................. 9
5.1.1 读乘法寄存器 (FC 3)....................................................................................... 9
5.1.2 写乘法寄存器 (FC 16)..................................................................................... 9
5.2 类型 1 指令详述.................................................................................................. 10
5.2.1 读线圈 (FC 1)................................................................................................... 10
5.2.2 读离散输入 (FC 2).......................................................................................... 10
5.2.3 读输入寄存器 (FC 4)...................................................................................... 11
5.2.4 写线圈(FC 5).................................................................................................... 11
5.2.5 写单一寄存器 (FC 6)...................................................................................... 12
5.2.6 读异常状态字 (FC 7)....................................................................................... 12
5.3 类型 2 指令详述.................................................................................................. 13
5.3.1 强制多点线圈 (FC 15).................................................................................... 13
5.3.2 读一般参考值 (FC 20)..................................................................................... 14
5.3.3 写一般参考值 (FC 21).................................................................................... 15
5.3.4 掩模写寄存器 (FC 22)..................................................................................... 16
5.3.5 读/写寄存器 (FC 23)........................................................................................ 16
5.3.6 读 FIFO 队列 (FC 24)..................................................................................... 17
6. 异常代码……………………………………………………………………….... 17
附录............................................................................................................................. 19
A.客户机和服务器应用指导……………………………………………………..... 19
A.1 客户机设计......................................................................................................... 19
A.2 服务器设计.......................................................................................................... 19
A.2.1 多线程服务器………………………………………………………………...20
A.2.2 单线程服务器................................................................................................... 20
A.3 必需的及期望的性能………………………………………………………….. 21