Quantcast
Channel: Instrument Control (GPIB, Serial, VISA, IVI) topics
Viewing all articles
Browse latest Browse all 5625

serial port read strings to numbers

$
0
0

Hello. I have a Teensy 3.1 ADC sending out data at a rate of 1KHz to the serial port , and i have a while  loop that reads the port by using "Bytes at port " as counts to "read serial " block with a time delay of 1 milliseconds inside the while loop.It seems though i read with or withot the time delay inside while loop ,i miss the data in between in a random manner. 

The data after converting into numbers using "spreadsheet string to array" function in a waveform chart, i see random spikes and dips for a sinusoidal wave fed as an input which is of 1 Hz frequency.

I doubt that while reading itself ,the strings are being concatenated with one another which creates these random spikes.,since a continuous sine wave input should provide a smooth waveform output in the chart.

I have taken ADC data from Teensy directly and plot them in Excel sheet, and no spikes at all. 

Can the problem arise from labview not in synch with ADC outputrate ? or the conversion from strings to numbers?

Please have a look at the VI i have attched.

Thanks .


Viewing all articles
Browse latest Browse all 5625

Trending Articles