我不知道为什么pymodbus需要零模式参数?任何用例?似乎通常我们都想得到我们设定的
ModbusSequentialDataBlock(0, [1, 2, 3, 4]))
# And we expect get [1, 2, 3, 4] when
client.read_holding_registers(0, 4)
-
# The slave context can also be initialized in zero_mode which means that a
# request to address(0-7) will map to the address (0-7). The default is
# False which is based on section 4.4 of the specification, so address(0-7)
# will map to (1-8)::
#
# store = ModbusSlaveContext(..., zero_mode=True)
#---------------------------------------------------------------------------#
store = ModbusSlaveContext(
di = ModbusSequentialDataBlock(0, [17]*100),
co = ModbusSequentialDataBlock(0, [17]*100),
hr = ModbusSequentialDataBlock(0, [17]*100),
ir = ModbusSequentialDataBlock(0, [17]*100))
任何人都可以共享一个链接,规范的第4.4节在哪里? https://pymodbus.readthedocs.io/en/v1.3.2/examples/synchronous-server.html?highlight=zero_mode
目前没有回答
相关问题 更多 >
编程相关推荐