modbus icon indicating copy to clipboard operation
modbus copied to clipboard

ValueError: The slave is indicating an error. The response is: '\x01\x83\x02\xc0\xf1'

Open arsohel opened this issue 6 years ago • 1 comments

when i run the program its showing value error

import minimalmodbus instrument = minimalmodbus.Instrument('COM3', 1) # port name, slave address (in decimal) instrument.serial.baudrate = 9600 instrument.serial.bytesize = 8 instrument.serial.parity = minimalmodbus.serial.PARITY_EVEN instrument.serial.stopbits = 1 instrument.serial.timeout = 1 instrument.debug = True instrument.mode = minimalmodbus.MODE_RTU print instrument #l1_voltage = instrument.read_float(3911, functioncode=3, numberOfRegisters=2) temperature = instrument.read_register(3911 , 2) print temperature

Traceback (most recent call last): File "C:/Python27/usbtors485.py", line 12, in temperature = instrument.read_register(0x3911 , 2) File "C:\Python27\lib\minimalmodbus.py", line 258, in read_register return self._genericCommand(functioncode, registeraddress, numberOfDecimals=numberOfDecimals, signed=signed) File "C:\Python27\lib\minimalmodbus.py", line 697, in _genericCommand payloadFromSlave = self._performCommand(functioncode, payloadToSlave) File "C:\Python27\lib\minimalmodbus.py", line 798, in _performCommand payloadFromSlave = _extractPayload(response, self.address, self.mode, functioncode) File "C:\Python27\lib\minimalmodbus.py", line 1088, in _extractPayload 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'

arsohel avatar Aug 07 '17 13:08 arsohel

This is a go library, you're using python?

andig avatar Jan 05 '19 13:01 andig