From Friday, April 19th (11:00 PM CDT) through Saturday, April 20th (2:00 PM CDT), 2024, ni.com will undergo system upgrades that may result in temporary service interruption.

We appreciate your patience as we improve our online experience.

LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Set X-axis Span

Looking for Ideas on how to set the span of my X-axis.  to explain that a little better, I am taking samples from a sensor every 250ms the sensor is handling that poll rate just fine and i am looking at the data time stamped on an xy graph i will upload a sample VI where the sensor is replaced by a random number vi. What is the problem is that i want to let this run indefiantly, so i need to destory the data after fifteen minutes when its been logged to a database and no longer need to be on the screen.  and i would like to only see the most recent three minutes on the graph with a scroll bar to go back to the oldest avilable point.  

 

Any one have a starting place.  

 

Thanks,

 

Mark R.  

0 Kudos
Message 1 of 4
(2,860 Views)

I can't open your vi right now, but here are some initial suggestions:

 

If your data is coming at regular 250ms rate then you can use a Waveform Chart insteas of an XY Graph. With a chart you feed it a sample at a time and it keeps its own history buffer (set to 3600 samples for 15 mins at 250ms). Set the X axis multiplier to 0.25 to get the axis to display seconds.

 

However, if you are continuously adding new samples then you will not be able to scroll back through the existing data (at least not that I have been able to manage so far). If this is essential then you can create your own history buffer of 3600 points in an array and store it in a shift register - add a new one each time round the loop and delete the oldest. Then feed this into a waveform graph. You can then programatically set the scale max and min to set the range, and use the scroll bar to scroll.

 

This snippet shows both a chart and a graph with a separate buffer for comparison.

 

charts.png

0 Kudos
Message 2 of 4
(2,846 Views)

Sorry for the delay in my response to your prompt reply.  I had similar Idea though your is much cleaner.  The question I had using this method is rather or not the data that is push into the array after all 500 slots are filled truly taken out of memory.   I don't know enough on LV memory monitoring tools to know how to check.  

 

 

Thanks,

 

Mark R.  

0 Kudos
Message 3 of 4
(2,783 Views)

The simplest way to get started with monitoring memory usage in your LabVIEW code is to use the Profile Performance and Memory tool. You can get more information about it at the link below.

 

Profile Performance and Memory Window

http://zone.ni.com/reference/en-XX/help/371361J-01/lvdialog/profile/

0 Kudos
Message 4 of 4
(2,760 Views)