代码之家  ›  专栏  ›  技术社区  ›  Intrastellar Explorer

支持扩展地址间隔的Python modbus库?

  •  1
  • Intrastellar Explorer  · 技术社区  · 6 年前

    我有一个Modbus RTU设备,其信息存储在非标准数据地址中。

    例如,它存储读取值(32位IEEE-754浮点、, converter link )注册号为1003-1004。

    我 认为 这意味着我不能再使用标准的Python+Modbus RTU库,比如 modbus-tk 和 pymodbus .

    在这种情况下可以做什么?


    设备细节

    • 设备:E+E Elektronik系列二氧化碳传感器 EE872
    • User Manual (第5.2节包含Modbus RTU信息)
    • 该设备已插入带有Python 3.6的Windows 10计算机
    0 回复  |  直到 6 年前
        1
  •  1
  •   luc    6 年前

    通过将modbus tk作为 execute 方法

        # Read and write floats
        # master.execute(1, cst.WRITE_MULTIPLE_REGISTERS, starting_address=0, output_value=[3.14], data_format='>f')
        # logger.info(master.execute(1, cst.READ_HOLDING_REGISTERS, 0, 2, data_format='>f'))
    

    数据_格式基于python struct 单元此处列出了预期值。

    https://docs.python.org/3.7/library/struct.html#format-characters

    我希望有帮助