Search code examples
ioserial-portsimulatormodbus

Modbus simulator weird behavior


I am running the following modbus slave simulator http://www.modbusdriver.com/diagslave.html as well as the following modbus poller http://www.modbusdriver.com/modpoll.html. The weird thing is, I cna not however get them to discover each other. Here is the output from the slave simulator

Protocol configuration: Modbus RTU
Slave configuration: address = -1, master activity t/o = 3.00
Serial port configuration: /dev/ttyS0, 19200, 8, 1, even

Server started up successfully.
Listening to network (Ctrl-C to stop)
....................

and the following is the output from the modbus poller.

Protocol configuration: Modbus RTU
Slave configuration...: address = 1, start reference = 1, count = 1
Communication.........: /dev/ttyS0, 19200, 8, 1, even, t/o 1.00 s, poll rate 1000 ms
Data type.............: 16-bit register, output (holding) register table

-- Polling slave... (Ctrl-C to stop)
Reply time-out!
-- Polling slave... (Ctrl-C to stop)

As you can see, the modbus slave simulator as well as modbus poller both have the same values there should be able to find each other. However they can not which I find odd. Does anyone have any suggestions on what may be happening to cause this?


Solution

  • The time-out can be for various reasons such as

    • register address your polling for does not exist in the slave device(also check if the type of register you are polling for is right)

    • the connection has not been established between the slave & the master(this can be due to configuring the slave and the master serial port interfaces incorrectly).

    • Also check if the serial link has been physically wired correctly to the correct pins on both ends (slave and master).

    -Check the timeout period set at the master. You may have set it to a very low value and hence the responses from the slaves are being missed.

    Hope this helps.