LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Parsing data from serial port into Arrays

Hi Eric,

Previously what I did was do a data check and remove any data whose string length wasnt 5 and the waveform I received had a lot of missing "dots" in the plot.

My lab is closed for the weekend but I've tried out the VI by turning a potentiometer connected to the ADC input of the microcontroller. (as fast as i can to create some waveforms)

Here is an image of the output. The values coincide with those found in hyperterminal. Will test the output in Lab on Monday with a function generator and get back to you.

Btw, how do I change the bar chart to a straight line plot? (still v noob with Labview) I've tried fiddling with the waveform plot properties and managed to get this but i hope to get a straight line plot much like those received in an oscilloscope. Thanks for all your help. Smiley Happy

Regards,
Gerard
0 Kudos
Message 11 of 33
(3,076 Views)
Gerard:

Please take a look at the attached jpeg to change the properties of your graph to output your data in a straight line.
I hope it helps.

Rudi N.
0 Kudos
Message 12 of 33
(3,038 Views)

Hi Rudi,

I've chosen those settings already but it still plots it in a bar chart manner. Here are my settings.

Image

Regards,

Gerard

0 Kudos
Message 13 of 33
(3,026 Views)

The problem is when the graph connects to the next point, it jumps back to the value zero and jumps back up to the next point, resulting in a "bar chart". How do i resolve this?

Regards,

Gerard

0 Kudos
Message 14 of 33
(3,023 Views)
Hi Gerard,
it would make it easier to help if you could attach the VI or a PNG of the block diagram. Since you don't send zero- values with the Pic- controller (you wrote, you proved it with Hyperterm) it seems that you have problems to interpret the incoming string. If we can have a look at the code we can help faster Smiley Very Happy

Greets, Dave
Greets, Dave
0 Kudos
Message 15 of 33
(3,007 Views)

Hey Gerard

Are you still sending a line feed with a carriage return?

If you are that would add zero's between values.  If you could terminate your line with a line feed or a carriage return it will work better.

 

Eric

 

Message 16 of 33
(3,000 Views)
Thanks Eric,
 
Sorry for late reply, was busy drawing my pcb board which is super messy. Reprogramming the microchip to remove the newline solves the dropping to zero problem. The VI is able to display low frequency waveforms (abt 0.1-5hz?) but higher frequency waveforms gets compressed like in tis image. I ve tried controlling the scaling by adding this case statement to control the X.scalefit but it doesnt seem to work. Did i do it wrongly or do i have to do it another way? Thanks!
 
Regards,
Gerard
0 Kudos
Message 17 of 33
(2,976 Views)

Gerard:

It just seems like you have too many points in the window your are viewing. You could always fine tune your window to view your data more clearly. You could also use a property node to change the minimum and maximum values of your graph programmatically so that you have a better display of your data. I hope this helps.

Regards,

Rudi N.

Message 18 of 33
(2,962 Views)
Hey Gerard
 
Glad to hear your data acq is working.
 
To change the time of the x axis on the chart you need to look at the x scale range and change it to a time frame that will fit your freuncy.
 
For example at 10 hz sine wave 1 cycle takes 0.01 sec, if you want to display 10 cycles the range on you x axis would need to be 1 sec.
 
I'll see if I can work an example up for you.
 
What version of labview are you using?  If might be easier to understand if you had an exapmle to play with instead of a screen shot.
 
Good Luck
Eric 
Message 19 of 33
(2,961 Views)
Hi Eric,

I'm currently using labview 8.0 Student Version. If I change my Time X-axis to Relative time and control it in terms of seconds shld I use range increment, min or maximum? Is it possible since the VI reads data into arrays with a delay instead of being a "realtime" acq? Thanks!!

Regards,
Gerard
0 Kudos
Message 20 of 33
(2,944 Views)