@MattFox I have just setup a simulation locally and run through the code in detail. The timeouts for Modbus Serial work correctly in my setup. I was also able to connect 2 serial data sources using a similar setup and found no problems.
Modbus Serial Slave (RTU) <--> Virtual Serial server type (port 1000) <--> Virtual Serial client type (port 1000) <--> Modbus Serial Data Source (RTU)
Here is some I/O log output using an 8s timeout:
2020/07/16-07:51:11,346 O 010300000002c40b
2020/07/16-07:51:12,371 I 010304001800007a34
2020/07/16-07:51:16,346 O 010300000002c40b
2020/07/16-07:51:24,350 O 010300000002c40b -- 8s timeout
2020/07/16-07:51:32,351 O 010300000002c40b -- 8s timeout
2020/07/16-07:51:35,978 I 010304001800007a34010304001800007a34010304001800007a34
2020/07/16-07:51:36,348 O 010300000002c40b
2020/07/16-07:51:37,369 I 010304001800007a34
2020/07/16-07:51:41,347 O 010300000002c40b
2020/07/16-07:51:42,377 I 010304001800007a34
2020/07/16-07:51:46,347 O 010300000002c40b
2020/07/16-07:51:47,370 I 010304001800007a34
Something worth noting here is the read timeout on the Virtual serial client ports. In my setup I have this setup to 1000ms, and this is why the input
I messages are being read every 1000ms. Basically the read will block Modbus 4J on the socket until that timeout passes.
I am simulating my timeouts by setting a breakpoint inside the Slave to halt its communications. When I play through the breakpoint the data source picks back up where it left off. Hence the multiple messages on the line at
In order to help you out I will need to know what is different between your setup and mine. Is the socket connection being broken/severed or is the timeout actually due to a delayed response from the Slave? As much detail as you can provide will be helpful.