03-19-2014 03:14 AM
Hi guys,
I have a vi to read GPS parameters via Serial port. First I configure the serial port, then I write some configuration parameters via Serial and then I start getting messages with position, velocity, time, etc.
The producer is a timed loop. It reads everything in the serial port each 100ms and sends it to the queue. The GPS generates the messages at 100 Hz, so each loop I have 10 values of data each iteration.
The consumer gets the messages and converts strings to final values.
This works well at 115200 baud rate, but when I change to greater values such as 460800 (both the receiver and the serial port can take greater values), I start getting the messages grouped each 4 loops (in the 460800 example). I mean, I get 40 values of data one iteration (it should be 10), then 3 iterations without any data, then 1 iteration with 40 values, and so on.
460800 is four times 115200, so I must be doing something wrong, but I don't know what. Both the serial port and the receiver are properly configured at 460800, am I missing something else that should be configured?
Thanks!
Solved! Go to Solution.
03-19-2014 05:54 PM
I am guessing, but I wonder if the OS is handling things in batches or chunks? If you are getting 10 messages every 100 ms, what is the advantage of going to the higher rate?
Lynn
03-21-2014 02:41 AM
Hi Lynn,
thanks for answering 🙂
115200 wasn't fast enough for the number of characters we need to get, we started getting delayed messages.
What do you mean exactly with the OS handling things in chunks?
03-24-2014 07:05 AM
Ok, I have the solution. I had to lower the latency in the advanced configuration of the serial port from 16 to 4 ms.
Hard to find!