Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
我正在尝试在 pymodbus 模块的帮助下使用 python 通过 modbus 发送查询并获取响应消息(数据)。
response=client.read_holding_registers(19200,126,unit=135) print(response)
正在打印的响应是发送的请求消息和进程状态。我有兴趣阅读从从站发送的数据,而不是进程状态。你能帮我解决这个问题吗?
你应该使用.registers
.registers
尝试以下过程:
response = client.read_holding_registers(19200, 126, unit=135) if not response.isError(): print(response.registers) else: # Handle Error
[注意]:
.isError()