Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Open
arsohel opened this issue Aug 7, 2017 · 1 comment

Comments

@arsohel
Copy link

arsohel commented Aug 7, 2017

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'

@andig
Copy link
Contributor

andig commented Jan 5, 2019

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants