Closed dkhawajafaithtechinc closed 4 months ago
your device do not respond.
A couple of potential problems:
client.write_register(1, 10, slave=SLAVE)
rr = client.read_holding_registers(1, 1, slave=SLAVE)
assert not rr.isError() # test that call was OK
assert rr.registers[0] == 10
In any case your device do not like the request....if it works with other technologies, then do a trace and check the difference in the package.
Yes we already tried specifying those as well like this:
rr = client.read_holding_registers(53236, 1, 1)
That is not according to our examples, please read the documentation or at least follow the examples, slave is NOT a positional parameter.
Did you look in the debug log and control that the slave changed to 1 ?
I apologize, seems that we got it worked out. We were initially using this:
rr = client.read_holding_registers(address=53236, count=1, unit=1)
But the parameters were incorrect so when using this, it worked:
rr = client.read_holding_registers(53236, 1, 1)
I believe we can close this issue now
Just a quick question, what exactly does the slave parameter do?
Versions
Pymodbus Specific
Description
My team and I have been attempting to read modbus data from a device using PyModbus. We are able to read from this device from 6-7 different modbus technologies, but pymodbus is the only one that is giving us this error: WinError 10054 An existing connection was forcibly closed by the remote host. Seems that the modbus server is shutting down the connection whenever we are trying to read data from it.
Code and Logs
Please see the image attached for the logs