Modbus Serial Errors
-
Have you tried just setting your timeout higher? What do you mean "at just the wrong time"?
-
I tried setting the timeout to 700 and 1000 ms and get this error immediately
I've been using 500 ms which seems to work the best.
'mainbox': Plug3: com.serotonin.messaging.TimeoutException: request=com.serotonin.modbus4j.serial.rtu.RtuMessageRequest@1b58992
"Just the wrong time" may not be relevant any more but I had the data source pulling every 5 seconds and it seemed that if I clicked the toggle button in mango at just the right or wrong time I got the error but other times it was fine. I was thinking that maybe if I sent the write command at the same time as the read command was happening this caused the problem. Now that I did the test where there was not a read command happening but doing a series of write commands (toggling the value) caused the same issue leaves me totally clueless where the conflict is coming in. I'm going to do some testing with another master to the same slave and record the traffic to see if it reveals a problem with my slave.
Thanks,
Joel. -
I just used Modbus Poll to test communication to my slave:
I used a 500ms timout and a 10 ms delay between polls
In the first test where there was no polling happening only toggling the register I noticed that MP just sends the 06 command and gets the response. In Mango it looks like it sends the 06 command and then re-reads the register with a 03 command.
In the second test I set up a poll every 1 second and then toggled the point as fast as a could and did not getting any errors. Attached is the serial traffic from all of my experiments.
Does Mango have a setting for delay between polls?
Thanks,
Joel.Attachment: download link
-
Actually, it's the opposite: there is a read req/res, and then there is a write req/res. The reason for this is that your particular point is a binary within a holding register. Your equipment presumably does not support the write-mask-register message, so a regular write-holding-register must be used. The master doesn't know what should be in the other 15 bits of the register, so it does a read, a local masked write into the value, and then a write. This minimized the possibility that the other values in the register get overwritten.
Not sure how the apparently corruption happened. What is your serial duplexing like?
-
Interesting. I believe I'm using half duplexing. communication is over RS-485 with one RX and one TX wire with one ground so three wires all together.
Joel.
-
I've added some concurrency settings to the modbus stuff. Hopefully this will solve your problems. It will be available in the next version.
-
That is great. Is there any way I could test this before you release it to see if it will resolve the issue?
For now I can set all my points to numeric rather than binary and it seems like this should work but it's kinds of a bummer as I can't display the information like I really need to.
Thanks for the help,
Joel. -
An update has been posted.
-
I still get the following error when I use Modbus Serial.
"'Modbus': Exception from modbus master: No recipient was found waiting for response for key com.serotonin.modbus4j.serial.SerialWaitingRoomKeyFactory$TransportSyncWaitingRoomKey@1".
Is this a known bug?