Instrument Control (GPIB, Serial, VISA, IVI)

cancel
Showing results for 
Search instead for 
Did you mean: 

wrong data from serial instrument

I am using labview 5.1 to acquire data from a serial instrument(tachometer).The program is the one that is in the example of labview 5.1(LabVIEW<-> Serial)

the instrument has the following settings:
8 bits,no parity,1 stop bit,hardware control.
I am collecting some data from the tachometer,but the problem is that some data is incorrect.

USUALLY I OBTAINED THESE NUMBER IN THE COMPUTER:

6.94420
6.93955
6.94857
......
and suddenly the wrong data appear:
94
6.940(these two values in the box:read string)

(the value that is considered is 94 instead of the value i think is correct 6.94094).

Why does it happen that?
Is it a problem of data flow contol?
Is it relatad to the buffer size?

Thanks in advance for your ans
wer.

Gerhard Castro
0 Kudos
Message 1 of 3
(3,299 Views)
Gerhard,

Most likely, your problem is that your application reads-out the serial port during a transfer of data.
So not all data from the tacho has reached the computer.
This is a common problem in serial com. and one of the reasons why certain protocols use a termination character to be sure that the string you print is in fact the entire string.

One simple solution is reading-out the number of bytes in the serial port. When this is a stable value, you can read serial port with the stable number of bytes.
How fast should you scan the number of bytes? Roughly 1/4 of the update rate of the tacho.

Another solution I use for more complex applications is an extra receive-buffer in LabVIEW to do string-scanning on. When I screw up my read on the
buffer, I always still have the original strings. Once you read-out your port and screw up, you've lost your data.

Hope this gets you going,

Patrick
0 Kudos
Message 2 of 3
(3,299 Views)
Double check if the termination character is enabeld.

This could cause this problem.

Ben
Retired Senior Automation Systems Architect with Data Science Automation LabVIEW Champion Knight of NI and Prepper LinkedIn Profile YouTube Channel
0 Kudos
Message 3 of 3
(3,299 Views)