11-05-2019 12:11 AM
Hi Guys, I am working on a final year engineering project that involve streaming live data from a micro controller via serial to labview and hopefully saving it/applying filters etc.
I have modified the basic serial read write vi to give continuous data and change the string to a float with one of the recommendations on this forum.
The microncontroller is simply programmed to serial write a value between -5 and 5 in increments of 0.1 increments. Please attached code, basically just 4 for loops. The variable is a double i.e 8 byte.
I get stuck with graphing, there is a distinct pattern in the graph which corresponds to what my micro controller is outputting but whats happening is Labview reads 4.89 as a 4, and an 89 and graphs those values on the chart.
Thus the charts jumps rapidly but a pattern emerges.
My question is how to read a double properly and graph it as one value. Any reference or thoughts would be appreciated. Thank you!
11-05-2019 04:22 AM
Hi,
you should read input data up to a CR/LF is comming
and then read in the numbers. Otherwise you may
have lost sync of yor data stream.
Maybe you do this in a little state machine that will process
input data with two states one that waits for the CR/LF
and another taking the number.
11-05-2019 05:52 AM
I suspect that you do not understand your microcontroller, do not understand how (most, but not all) Serial Devices that use VISA communicate, and do not really understand LabVIEW and how to utilize the Principle of Data Flow to make your (programming) life simpler.
Know your Device.
Understand LabVIEW and what you want to do.
Sub-VIs are (or should be) your Friend
Bob Schor