3

At the moment we use the .Net built-in SerialPort component to communicate with different sensors via RS485. This shows a latency of more than 10 ms between the arrival of the messages until the DataReceived event is triggered or SerialPort.ReadLine is terminated.

The connected sensors respond in < 1ms and the transmission takes 1 to 3 ms (2 or 3 MBaud/s). These can also be read out so quickly via a microcontroller.

Is it possible to accelerate this? Or are there useful 3rd party components which are in the range of less than 10 ms latency?

Simon Mourier
  • 132,049
  • 21
  • 248
  • 298
NOFX
  • 41
  • 2

1 Answers1

1

I just went through the source code, it doesn't seem the code is delaying the response.

https://referencesource.microsoft.com/#system/sys/system/io/ports/SerialPort.cs

However you can follow the article to change that in Device Manager and see if that works.

https://store.chipkin.com/articles/rs232-how-do-i-reduce-latency-on-com-ports

Edit

As the solution describes that you can go to your device manager and find your serial port from the list. There is a latency timer setting and you can updated that to 1 ms.

1 Start menu–> Settings –> Control panel –> device manager –> Ports (COM & LPT) –>{Select your USB to RS485 converter}

2 Right click and select “Properties”

3 Select the “Port Settings” tab

4 Click the “Advanced ” button 

5 Change the Latency Timer (mSec) to 1 or the lowest possible setting.

6 Change the USB Transfer sizes to 64 or the lowest possible settings.

7 Save and close.

OKEEngine
  • 888
  • 11
  • 28
  • 1
    You should not only provide some links but rather describe (at least roughly) the solution in the answer directly. Links might become dead, so future users will be unable to find a solution anymore. Please read [How to answer](https://stackoverflow.com/help/how-to-answer). – dymanoid Dec 14 '18 at 09:13
  • Thanks a lot! That was just the solution that I was looking for. – NOFX Dec 18 '18 at 11:04
  • I didn't recognize the tick next to your answer. :) – NOFX Dec 18 '18 at 14:18