Replies: 1 comment 2 replies
-
Not sure I understand what you want, a server do not read data. You do not write which version of the library you use, so I assume it is the newest. If you refer to the client, then the reason is probably that you did not define slave 1 in the server. Did you try to to read valid data first ? Normally you would get illegal address if the slave is correct. |
Beta Was this translation helpful? Give feedback.
2 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
-
I am trying to create simple SerialModbusServer using pymodbus library and then I want to read some not exisiting registers. I expect getting a modbus "Illegal Data Address" error but as I understand it correctly I'm getting "Slave Device Failue":
DEBUG:pymodbus.logging:Processing: 0xf1 0x80 0x4 0x40 0x30
Can anyone explain what am I doing wrong? I was also trying to use ModbusSequentialDataBlock but with similat results.
I am using that simple script to get required serial ports:
import virtualserialports virtualserialports.run(2, loopback=False, debug=True)
PS I was really trying to show my code in a proper code block using editor but I always ended up like this:
Server code:
`def run_server():
nreg = 200
hr_data = {i: 17 for i in range(nreg)}
`
Client code:
`def test_virtual_device():
client = ModbusSerialClient(port="/dev/pts/3", baudrate=9600, bytesize=8, parity="N", stopbits=1)
Beta Was this translation helpful? Give feedback.
All reactions