【问题标题】:Reading 32 bit registers on pymodbus在 pymodbus 上读取 32 位寄存器
【发布时间】:2022-07-18 02:05:51
【问题描述】:

请问如何从我通过 pymodbus 与之通信的其中一台设备上的地址读取 32 位值?

谢谢, 贾斯汀

【问题讨论】:

  • 请澄清您的具体问题或提供其他详细信息以准确突出您的需求。正如目前所写的那样,很难准确地说出你在问什么。
  • 我正在使用 pymodbus,我有一个通过串行 RTU 连接的设备,我需要读取它的寄存器。我能够读取 16 位的寄存器,但我无法读取 32 位的寄存器。请问有什么办法吗?

标签: python 32-bit pymodbus


【解决方案1】:
    rr = client.read_coils(0, 32)
                           #start, number of bits

    index = 0
    for A in rr.bits:
        print("Bit " + str(index) + ":", A)
        index += 1

看看https://github.com/riptideio/pymodbus/blob/dev/examples/common/synchronous_client.py

【讨论】:

    猜你喜欢
    • 1970-01-01
    • 2021-12-21
    • 2012-04-11
    • 1970-01-01
    • 2022-01-23
    • 1970-01-01
    • 2014-11-18
    • 2015-03-08
    • 2022-10-26
    相关资源
    最近更新 更多