I would like to point out one crucial bug we found with the Modbus Serial module which is troubling us because we need rapid speeds in the RS485 network and we need a fast solution for solving this issue.
Because our devices are using strict time values meaning that when baud rates are greater than 19200 bps then fixed values for the 2 timers should be used. The recommended use of values of 750 μs for the inter-character time-out (t1.5) and a value of 1.750 ms for inter-frame delay (t3.5).
We noticed that when we change the baud rate to 38400 bps the devices stopped responding so we did the following calculations for trying to solve the issue:
For 38400 bps: t1,5 < 1000000 / 38400 * 8 * 1,5 = 312 µs t3,5 > 728 µs
For 57600 bps: t1,5 < 1000000 / 57600 * 8 * 1,5 = 208 µs t3,5 > 486 µs
We noticed that there was an option to override timing for Modbus Serial communication so we thought that we were in luck with solving the issue.
The compute timing gave us the correct values according to Modbus Network theory but the override timing option does not function correctly.
The devices were still not answering despite the change when we applied the override so we measured the timings and data communication with an oscilloscope by using devices which do not use strict time values. We noticed that the real character spacing was actually around 830-850 µs despite setting the override to 750000 ns.
We then tried to change the character spacing value lower hoping that there was an calculation error for overriding but then the communication did not change and it still stayed around 800-850 µs despite the change in the character spacing.
At around 100000 ns the character spacing changed drastically and we lost data from the query and the network bugged out. In the oscilloscope we noticed that the data changed to gibberish and we could not understand the bits of data which was being transmitted. Some bits were lost in the communication but Mango could still communicate with the device.
The character spacing max value has to be <750 µs when changing to >19200 bps. Currently Mango is not using these standards and we had to use 19200 bps for our devices which is kind of small for the current project. We will see how the project goes but we need fast solution for this.