Modbus Serial missing configuration options
-
Hi All,
Am working on a new project that involves the use of modbus serial. However, when setting up the datasource there is a mention in the help menu regarding "Override Timing"
which allows us to adjust message frame spacing, character spacing and the compute timing options. Were they ever implemented?Secondly, despite setting the timeout on the datasource to be at 5 or even ten second intervals, the messages are still quickly fired in succession, not apart.
This is over a virtual serial socket, but I cannot see how that would affect timeout retries for messages. Any thoughts regarding this would be greatly appreciated.
Thanks
Fox
-
@MattFox the Override Timing settings were removed, they never did work quite right. It looks like it was removed from the help in the development branch of Mango so in 4.0 that won't be there. As for the timeout, I quickly traced the Modbus4J code and it looks like it should work. Are you sure you are using the correct units. The value should be in ms.
-
Yep, selected 5000 and 10000. Looking in the console they still just ticked out about a second apart.
On an unrelated note, when is mango4 due, and is this a paid upgrade? I can see sods law here I am finally being able to upgrade my dashboard to work with 3.77 and then 4 comes out...
-
I'll make a git issue to review that timeout code. As for Mango 4.0 it will be a paid upgrade but is still months out with no firm release date.
-
Any further new Terry? Trying to establish a timeline for our customer.
Fox
-
Have done some more testing for you. The virtual socket is definitely the issue. Sockets are not being disposed of properly during datasource restarts thus causing a lockup. Secondly it's definitely the virtual serial socket that ignores timeout retry settings for modbus. It seems like fixes have been implemented for the serial datasource side but not the modbus... I've checked with a directly connected serial port connected to an ES and sure enough, the retries are spaced apart as stated in my retry settings.
Hope this helps
Fox
-
@MattFox I have been focused on some other development but I haven't forgotten this and will try to find some time to take a look next week.
-
Thanks, I've continued testing and sure enough, nothing leaves the virtual serial buffer... something is stuck... This affects everything. Serial, modbus, anything that uses the virtual serial port. I need this fixed pronto our whole system revolves around this as it provides excellent real time controls. I cannot go live with my new changes and a freshly upgraded 3.7.7 if all our systems go offline because of it.
Fox
-
@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 20
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
2020/07/16-07:51:35,978
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.
Thanks.
-
I wasn't using a timeout on the virtual port. I had it set as a serial server socket, 1024 buffer and 0 timeout. If I used a timeout when it reconnected a boatload of messages flew out of the buffer. It just seems to fill up like a balloon... If I didn't timeout and manually closed and opened connections it would do it also.
I can give you a copy of my .net serial program since I use it to translate our radio communications but it hasn't changed since 3.5.6.
The 3.5.6 with the same settings has no issues for our serial ports. The modbus however still wouldn't have it...I can email you everything including a connection to our vpn network to test with if it suits.
Fox
-
@MattFox you better email everything over to support@infiniteautomation.com referencing this thread. I don't seem to understand what you are trying to do using a Virtual Serial Server type port on a Modbus Serial data source.
-
Sent an email Terry, it's a start I'm trying to sort some other items to help you with your testing.
Fox
-
I've used Moxa MB3180 RS485 to Ethernet converters quite successfully with Mango instances if that's of any help.
You setup a MODBUS/TCP data source to the Moxa, then plug your RS485 serial into that.