Academic Company Events Community Support Solutions Products & Services Contact NI MyNI
209 ratings:
 3.71 out of 5   

What Is the Difference Between Graphs and Charts in LabVIEW?



Primary Software: LabVIEW Development Systems>>LabVIEW Base Development System
Primary Software Version: 7.0
Primary Software Fixed Version: N/A
Secondary Software: N/A

Problem:
How do I know when to use a Waveform Graph or a Waveform Chart in LabVIEW? What is the difference between these two ways to display data?

Solution:
Waveform Graphs and Waveform Charts differ in the way they display and update data.

A Waveform Graph accepts arrays of data in various forms, e.g. array, waveform, or dynamic data. It then plots all the received points at once. It does not accept single point values. When an array of points is wired to a waveform graph, it assumes the points are equally spaced out. By default, the starting X value and step size (t0 and dt) are 0 and 1 respectively. This can be changed in the properties of the graph or using property nodes.

The waveform data type is essentially an array of points that also contains t0 and dt information. In this case, the Waveform Graph receives the t0 and dt contained within the waveform and displays the data accordingly. You can build your own waveform with data points, t0, and dt specified. You can also display multiple plots on the same Waveform Graph by wiring a 2D array of waveform or dynamic data to the graph.

A Waveform Chart remembers and displays a certain number of points by storing them in a buffer. When the buffer gets full, the chart starts overwriting the oldest points with new ones. As the data points become available, the Waveform Chart displays received data in addition to already existing points. You can write single or multiple data points to it at once. If we wire an array of points to the chart, it will append those points to the existing ones. You can display multiple plots on the same chart by wiring in a cluster of points or a 2D array containing waveform or dynamic data for each plot. For example, if you wire in a cluster of 3 points, one point will be added to each of the 3 plots. It is possible to change the chart history length, or chart buffer size, as explained in the article KnowledgeBase 3EQCAC3U: How Can I Programmatically Change Chart History Length?.

The following block diagram illustrates the difference in functionality.

Figure 1: Waveform Chart vs. Waveform Graph VI Snippet

In the upper For Loop, auto-indexing is used to generate an array of 100 random values and then pass the entire array to the Waveform Graph. In the lower For Loop, a new random value is passed to the Waveform Chart each iteration of the loop for 100 times.

Both loops result in the same output, but the Waveform Graph will update once after all data has been acquired, whereas the Waveform Chart will update as the program runs. For a better understanding of this, run the VI snippet in Figure 1. 

Note:
You can set the length of the Chart History buffer (the number of points the chart will remember and display) by right-clicking the on the chart and selecting Chart History Length from the shortcut menu.

To switch between the two items, you can right click on the graph or chart, select replace, and then select the item of choice from the controls palette as shown below.

 
Figure 2: Replace Waveform Graph with a Waveform Chart Location



Related Links:
KnowledgeBase 3YCBGD0E: What Does the Waveform Chart History Mean?
KnowledgeBase 3EQCAC3U: How Can I Programmatically Change Chart History Length?

Attachments:








Report Date: 01/22/1996
Last Updated: 09/29/2017
Document ID: 0HLH2GTA

Your Feedback! poor Poor  |  Excellent excellent   Yes No
 Document Quality? 
 Answered Your Question? 
  1 2 3 4 5
Please Contact NI for all product and support inquiries.submit