LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

How to plot data as it is read by TCP

Hi,
I am trying to read data over TCP, save it to a file, and plot it on my front panel, all at the same time.  I have everything working except the plotting portion.  I am reading in a string, converting it to an engineering format number, and then (I think!) converting to an array which goes into a waveform plot of type double.  I can see the graphs trying to autoscale, and I can see the RMS values change as each line is read in, which makes me think that Labview is trying to plot one point, then move on, wereas I want to see all the data at once (think Excel wave plot).  I've attahced my VI.  Can anyone help me?

Thanks!
Brendan
0 Kudos
Message 1 of 6
(3,457 Views)

 

Hi Brendan,

In your VI,  you are getting a single sample of  data from TCP read, which you are converting into an array with a single element in it and doing RMS and FFT on it.

I feel this not what you have in your mind while designing your VI.

First, convert the array you are acquiring in your server( use flatten to string) and write it into your tcp write.

Now unflatten that string after TCP read to get back that array.

Regards

Dev

 

 

0 Kudos
Message 2 of 6
(3,451 Views)
I don't understand what you mean.  I'm not using TCP write, and I don't think I need to.  All the data is coming in correctly from my microcontroller, and is being saved to a file correctly.

Can you explain a little more?

Thanks,
Brendan
0 Kudos
Message 3 of 6
(3,440 Views)
You're not using a graph correctly. A graph takes an array and plots it. Every time you do a conversion, you create a new array so the old data is overwritten. You can add a new array with the old array with a shift register and the build array function or you can use a chart and write a single point to the chart each time. A chart has a history that automatically keeps old values. You might want to review the differences between charts and graphs in the LabVIEW User manual (Help>Sarch the LabVIEW Bookshelf) and look at the shipping examples (i.e. Charts.vi and Waveform Graph.vi).
0 Kudos
Message 4 of 6
(3,436 Views)
Hi Brendan,

I assume you are referencing the same problem you were working on before.

By using Fract/Exp String To Number, you are converting the whole 100+ value string into one number.  Perhaps you need to use Spreadsheet String To Array.  I am sure that whatever separates the data can be put in the format string.  Then our RMS, FFT, and charts should all function as expected.
0 Kudos
Message 5 of 6
(3,429 Views)
Hi Jason,
I have been able to successfully plot the peak currents with the chart function and the fraction string to number packages.  I tried plotting the FFT with the spreadsheet string to array, because I believe the data comes in a format that can be handled by that function.  So far though, I am not having any luck.  I have the output array of the function going into a double array to dynamic data converter, which goes into the spectral measurement VI, which outputs to a chart.  Do I need to specifically build an array in between the ss to array function and the double to dd converter?

Thanks,
Brendan
0 Kudos
Message 6 of 6
(3,410 Views)