0
我使用minimalmodbus通過RS485使用USB-RS485 adapter cable與PID controller (Love 16C-3)通信。RS485 Modbus-RTU設備給出的這個錯誤是什麼
但是,當試圖讀取寄存器時,會顯示以下錯誤。這個錯誤是什麼意思?
raise ValueError('The slave is indicating an error. The response is: {!r}'.format(response))
ValueError: The slave is indicating an error. The response is: '\x01\x83\x02\xc0\xf1'
從硬件手冊
Python代碼
instrument = minimalmodbus.Instrument(port, 1, 'rtu')
instrument.serial.baudrate = 9600
instrument.serial.bytesize=8
instrument.serial.parity='E'
instrument.serial.stopbits=1
instrument.read_register(4096,1)
看起來像'非法數據地址'異常。參見[modbus例外](http://www.simplymodbus.ca/exceptions.htm)。 –
嘗試'instrument.read_register(0x4700,1)' –
@AndrejDebenjak謝謝,修正了地址並解決了問題。你如何知道錯誤信息'\ x01 \ x83 \ x02 \ xc0 \ xf1'意味着'非法數據地址'? – Nyxynyx