LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

stream data to xygraph

Trying to solve what I thought would be simple. I have an app creating an array of 10 values every 20 ms (approx - not exact intervals on the data).  The data system will be running for weeks monitoring and controlling processes - data storage is elswhere in the program. All values are doubles, starting with a time tag, then 9 values. Currently plotting to a waveform chart, which is easy and I can set history length, but the timing is not right since it assumes all data updates arrive at regular intervals. So, my assumptions, after going thru many examples and tutorials, is:

 - must use xygraph to plot against time since data intervals are not regular

 - xygraph can only accept one data value per time value in 2-element clusters (though I did create an xygraph that took a 3 element cluster - can't repeat it!)

 

I created a sample vi that creates a data stream and sends it to a queue (similar to the data system, except that this ixample does have regular timing)

Then plots data using 2 different methods to xygraphs, both methods taken from NI discussion forum sample code. Both seem to work, but neither are very elegant compared to the simplicity of a waveform chart, and both appear to re-generate the entire graph every time new data is added (efficiency?)

 

So, am i missing something? Is there an easier way to continuously add points to a graph, and keep the array to a manageable size? Or should I just pick one of the methods in the atached vi?

 

Thanks.

0 Kudos
Message 1 of 2
(2,105 Views)

That's almost half a million collects per day (times 10 values equals 4.32 million doubles!)  You want to store all that data in memory?  What if you lose power?  I would store the data to file (TDMS) as it's collected and then create a reader to extract the regions of interest for display/analysis or whatever.

 

SIDE NOTE:  Rather than using a stop button with locals to communicate between loops, use the queue you already have.  Monitor it in one loop with queue status (wire the error out to your stop terminal), in your other loop have a destroy queue wired AFTER the loop, then when you stop the other loop the queue is destroyed and the monitoring loop will see the queue is gone and generate an error which stops its loop.

LabVIEW Pro Dev & Measurement Studio Pro (VS Pro) 2019
0 Kudos
Message 2 of 2
(2,098 Views)