How do I make an XY Graph behave as an XY Chart?

Updated Jul 12, 2018

Reported In

Software

  • LabVIEW Base
  • LabVIEW

Issue Details

I want to use an XY Graph, but I would like for it to have a history like waveform charts. What is the best way to implement this?

Solution

If you want an XY Graph to store previous values, you must implement this behavior programmatically. The best way to do this is to store values from previous iterations by using a shift registers in a subVI. 

You can create the subVI which stores the previous data in shift registers for you as seen in the snippet below. This SubVI once saved can be called within other VIs to format XY points into arrays which retain the previous values and can be output to an XY graph. 



You can then create a VI where the subVI you made takes in X and Y values and adds those values to the two arrays that format the data to go into an XY-Graph inside of a while loop. 



Alternatively, searching the Example Finder for "xy" will list several other examples that show how to use and take advantage of XY displays. 

Note: You can drag and drop the code 'snippets' or images onto your block diagram for the code to generate automatically in LabVIEW. The code can also be found as an attachment to this article.

Additional Information

A chart stores historical data from previous iterations and a graph does not. If you open a new VI and right click on the front panel then click on the Graph Palette, you can see that there is an XY Graph option, but not an XY Chart option.

WAS THIS ARTICLE HELPFUL?

Not Helpful