Qt Modbus
Modbus 是一种请求/应答协议,在其网络中只有一个 Modbus 客户端,可能有多个 Modbus 服务器。服务器只能控制自己的内部状态,客户端可以读写其中的数据。
每个 Modbus 服务器有四个表,可以存储数据。
名称 | 字段中的数据范围 | 客户端权限 |
---|---|---|
离散输入 | 0-1 | 读取 |
线圈 | 0-1 | 读/写 |
输入寄存器 | 0-65535 (0xffff) | 读取 |
保持寄存器 | 0-65535 (0xffff) | 读/写 |
Modbus API 提供了一些访问 Modbus 设备的通用 API:
- QModbusDevice 为客户端和服务器的通用功能提供 API。
- QModbusClient 提供直接访问 Modbus 客户端的 API。
- QModbusServer 提供直接访问 Modbus 服务器的 API。
- QModbusDataUnit 表示数据值。
- QModbusReply 由 创建,作为写/读操作的句柄。QModbusClient
© 2025 The Qt Company Ltd. Documentation contributions included herein are the copyrights of their respective owners. The documentation provided herein is licensed under the terms of the GNU Free Documentation License version 1.3 as published by the Free Software Foundation. Qt and respective logos are trademarks of The Qt Company Ltd. in Finland and/or other countries worldwide. All other trademarks are property of their respective owners.