To download NI software, including the products shown below, visit ni.com/downloads.
Overview
This VI demonstrates how to effectively plot very large data sets (gigabytes worth, or millions of points of data) on a regular XY or Waveform Graph in LabVIEW.
Description
Here is a brief description of the example:
This code generates a large data set and then plots it with a regular XY Graph. To plot such a large data set without freezing the UI thread, it dynamically draws a reduced number of points to the graph depending on the range set on the x-axis. If the user uses the zoom tool, the graph will automatically redraw the newly zoomed region and pull more detailed points from the original data set to make it appear like the full data set was there to begin with. The purpose for this is to allow a regular graph to very quickly zoom through very large data sets (commonly referred to as "Big Analog Data" sets).
The code works by first taking a subset of the data based on the current range of the x-axis. If your original data contains points with x-values ranging from 0-100, but your graph currently is set to display points between values 30 and 50, then we don't need the entire data set.
It then determines how many pixels wide the graph's display area is. If there are only 1000 pixels to draw data points in, there isn't much benefit to drawing 100,000 points to the graph versus 1,000. For the most part the image will be the same, but the 1,000 point plot will be a lot easier to move and manipulate. Once it knows how many points to draw, it decimates the subset data (takes every nth point) to reduce the data set size further for drawing.
Requirements
Steps to Implement or Execute Code
Additional Information or References
VI Snippet
**This document has been updated to meet the current required format for the NI Code Exchange.**
Example code from the Example Code Exchange in the NI Community is licensed with the MIT license.
Very nice!
It is too bad NI has not yet implemented (or rather fixed, as they claim there is such functionality already) into the XY GRaph itself...I posted it as an idea on the Idea Exchange a long time ago.
After looking at your implementation I wrote a VI that does the decimation by the way. It is posted here: https://decibel.ni.com/content/docs/DOC-43115
Thank you Rayan for the nice code. appreciate it
The only thing that i noticed is that i cannot change/adjust the y axis length through graph palette. can you please help. thanks
PS: i only looked at "92415Manipulate Large Data Sets.vi 36 KB"
Just to explain further, i tried to use the graph palette to adjust the y axis and it did not work. i tried in insert a vertical graduated bar feeding "maximum y axis property node" to control the Y axis. Then I noticed that in every loop iteration, the graph goes back to its original y axis limits. so the plot was quickly toggling between the original y axis and the one fed to the property node.
How do you avoid loosing failing data in the decimation? i.e. data falling above or below a certain value.
Thanks