Instrument Control (GPIB, Serial, VISA, IVI)

cancel
Showing results for 
Search instead for 
Did you mean: 

UART LabView Dataloss and delay

As we are using Arduino to obtain data of the location (in coordinate system), we need to transfer the data from Arduino to Labview. We have observed that the time delay affects the performance and accuracy of the data, however, Labview is unable to read the data perfectly from Arduino. We are currently using the UART program in Labview to transfer 9 digits in the form of string data type. It is observed that sometimes the Labview is unable to read all the 9 digits and some data are lost. The problem is solved when the time delay is increased in Arduino, however, we need to maintain the accuracy so we are looking for an alternative solution. Is there any other solution available for this problem?

0 Kudos
Message 1 of 2
(2,808 Views)

You could get better help if you showed some code.  But from a "this is what I see most"...

 

1. Make sure you are using the Serial.PrintLn in the Arduino.  This will add a Carriage Return (0x0D) and a Line Feed (0x0A) to the end of your send data.

 

2.  Make sure the Termination Character is turned on at the Configure Serial Port.  The default is the Line Feed, so leave that alone.

 

3. DO NOT USE THE BYTES AT PORT!!!  Instead, just tell the VISA Read to read more bytes than you expect in a message.  In your case, I would go with 25.  The VISA Read will stop when it reads the number of bytes you told it or until the termination character is read.  So in the setup, you will read exact one message.  This should eliminate the delay you are adding unless something else is happening in the your loop.



There are only two ways to tell somebody thanks: Kudos and Marked Solutions
Unofficial Forum Rules and Guidelines
"Not that we are sufficient in ourselves to claim anything as coming from us, but our sufficiency is from God" - 2 Corinthians 3:5
0 Kudos
Message 2 of 2
(2,768 Views)