An update of what I have done. I’ve send an e-mail to Genvex instead of to the distributor in Belgium. To my surprise I quickly had an answer with the modbus-settings I need. I made an overview: see attachment.
(after each step I did a disconnect-connect):
- Double checked COM3 (device manager). Was ok.
- Installed a 150 ohm resistor. Genvex itself said “I don’t think you are going to need the resistor”, but I wanted to be sure…
- Switched A and B.
- Searched for an updated driver instead of the default one that Windows found.
- Used another Windows-computer.
Then I used a Linux computer (Lubuntu 20.04):
- Installed libmodbus5, installed the mbpoll-deb I found, checked dmesg to see that ttyUSB0 is used.
- Checked the mbpoll-manual.
Tried some things:
$ sudo mbpoll -b 9600 -p even -m rtu -a 1 -r 3 -c 10 /dev/ttyUSB0
mbpoll 1.0-0 - FieldTalk(tm) Modbus(R) Master Simulator
Copyright © 2015-2019 Pascal JEAN, https://github.com/epsilonrt/mbpoll
This program comes with ABSOLUTELY NO WARRANTY.
This is free software, and you are welcome to redistribute it
under certain conditions; type 'mbpoll -w' for details.
Protocol configuration: Modbus RTU
Slave configuration...: address = [1]
start reference = 3, count = 10
Communication.........: /dev/ttyUSB0, 9600-8E1
t/o 1.00 s, poll rate 1000 ms
Data type.............: 16-bit register, output (holding) register table
-- Polling slave 1... Ctrl-C to stop)
Read output (holding) register failed: Connection timed out
-- Polling slave 1... Ctrl-C to stop)
(etc)
-- Polling slave 1... Ctrl-C to stop)
^C--- /dev/ttyUSB0 poll statistics ---
10 frames transmitted, 0 received, 9 errors, 100.0% frame loss
everything was closed.
Have a nice day !
Some different settings (I omitted some of the output):
$ sudo mbpoll -m rtu -b 9600 -p even -d 8 -a 3 -r 3 -c 1 -t 4:int /dev/ttyUSB0
Protocol configuration: Modbus RTU
Slave configuration...: address = [3]
start reference = 3, count = 1
Communication.........: /dev/ttyUSB0, 9600-8E1
t/o 1.00 s, poll rate 1000 ms
Data type.............: 32-bit integer (little endian), output (holding) register table
-- Polling slave 3... Ctrl-C to stop)
Read output (holding) register failed: Response not from requested slave
-- Polling slave 3... Ctrl-C to stop)
Read output (holding) register failed: Response not from requested slave
-- Polling slave 3... Ctrl-C to stop)
Read output (holding) register failed: Response not from requested slave
-- Polling slave 3... Ctrl-C to stop)
Read output (holding) register failed: Response not from requested slave
-- Polling slave 3... Ctrl-C to stop)
Read output (holding) register failed: Response not from requested slave
^C--- /dev/ttyUSB0 poll statistics ---
5 frames transmitted, 0 received, 5 errors, 100.0% frame loss
Sometimes a combination of ‘timed out’ and ‘not from requested slave’:
$ sudo mbpoll -m rtu -b 9600 -p even -d 8 -a 1 -r 3 -c 1 -t 4:int /dev/ttyUSB0
Protocol configuration: Modbus RTU
Slave configuration...: address = [1]
start reference = 3, count = 1
Communication.........: /dev/ttyUSB0, 9600-8E1
t/o 1.00 s, poll rate 1000 ms
Data type.............: 32-bit integer (little endian), output (holding) register table
-- Polling slave 1... Ctrl-C to stop)
Read output (holding) register failed: Response not from requested slave
-- Polling slave 1... Ctrl-C to stop)
Read output (holding) register failed: Connection timed out
-- Polling slave 1... Ctrl-C to stop)
Read output (holding) register failed: Connection timed out
-- Polling slave 1... Ctrl-C to stop)
Read output (holding) register failed: Response not from requested slave
-- Polling slave 1... Ctrl-C to stop)
Read output (holding) register failed: Response not from requested slave
-- Polling slave 1... Ctrl-C to stop)
Read output (holding) register failed: Response not from requested slave
^C--- /dev/ttyUSB0 poll statistics ---
6 frames transmitted, 0 received, 6 errors, 100.0% frame loss
After rereading everything I saw that the option should have been ‘-t 4’ instead of ‘-t 4:int’:
$ sudo mbpoll -m rtu -b 9600 -p even -d 8 -a 3 -r 3 -c 1 -t 4 /dev/ttyUSB0
Protocol configuration: Modbus RTU
Slave configuration...: address = [3]
start reference = 3, count = 1
Communication.........: /dev/ttyUSB0, 9600-8E1
t/o 1.00 s, poll rate 1000 ms
Data type.............: 16-bit register, output (holding) register table
-- Polling slave 3... Ctrl-C to stop)
Read output (holding) register failed: Connection timed out
-- Polling slave 3... Ctrl-C to stop)
(etc)
Read output (holding) register failed: Connection timed out
^C--- /dev/ttyUSB0 poll statistics ---
6 frames transmitted, 0 received, 6 errors, 100.0% frame loss
So, at the moment, no luck :-(. Maybe I have a faulty USB-RS485-stick?