Modbus Error: [Input/Output] No Response received from the remote unit

后端 未结 3 1916
抹茶落季
抹茶落季 2021-01-06 15:02

I\' trying to connect from my Mac laptop to a Modbus device (MR-SI4) using a serial connection using a USB RS485 converter that gets \"mounted\" to /dev/cu.SLAB_USBtoU

3条回答
  •  清歌不尽
    2021-01-06 15:48

    I was able to work around this issue by setting the constant RetryOnEmpty to True.

    from pymodbus.constants import Defaults
    Defaults.RetryOnEmpty = True
    

    It also may be useful to configure a timeout and some retries.

    Defaults.Timeout = 5
    Defaults.Retries = 5
    

    https://pymodbus.readthedocs.io/en/v1.3.2/library/constants.html

提交回复
热议问题