0% found this document useful (0 votes)
1K views

How To Clear A Chart or Graph Programmatically in LabVIE1

This document describes how to clear charts and graphs programmatically in LabVIEW. For waveform charts, a property node must be used to clear the chart history by writing an empty array of data. For waveform graphs, either a property node or invoke node can be used to clear the graph by writing empty data or reinitializing to default. The document provides code examples for clearing both charts and graphs programmatically in different LabVIEW releases.

Uploaded by

williamII
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
1K views

How To Clear A Chart or Graph Programmatically in LabVIE1

This document describes how to clear charts and graphs programmatically in LabVIEW. For waveform charts, a property node must be used to clear the chart history by writing an empty array of data. For waveform graphs, either a property node or invoke node can be used to clear the graph by writing empty data or reinitializing to default. The document provides code examples for clearing both charts and graphs programmatically in different LabVIEW releases.

Uploaded by

williamII
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 2

How to Clear a Chart or Graph Programmatically in LabVIEW

Primary Software:
Primary Software Version: 1.0
Primary Software Fixed Version: N/A
Secondary Software: LabVIEW Development Systems>>LabVIEW Full Development System, LabVIEW
Development Systems>>LabVIEW Professional Development System
Problem:
I have a chart and a graph on my front panel in LabVIEW, but the only way I can find to clear it is to right-click
the chart or graph and choose Data OperationsClear Chart or Data OperationsClear Graph from the
shortcut menu. Is there a way to clear the chart or graph programmatically?
Solution:
To clear a Waveform Chart programmatically, a Property Node must be used to clear the Chart History. For
more information, see KnowledgeBase 3VGFK1HY: Why Doesn't Reinitializing to Default Value Clear
Waveform Charts? in the Related Links section below.
Waveform Chart:

1.
2.
3.

Right-click the chart and select CreateProperty NodeHistory Data.


Right-click History Data and select Change to Write.
Right-click the History Data Terminal and select Create Constant.

This writes an empty array of data to the chart, which will clear the history when this code is executed.

Waveform Graph:
To clear a graph programmatically, a Property Node or Invoke Node can be used.
Property Node:
1.
2.
3.
4.

Make sure the graph is clear by right-clicking the graph and choosing Data OperationsClear Graph.
Right-click the graph and select CreateProperty NodeValue.
Right-click Value and select Change to Write.
Right-click the Value Terminal and select Create Constant. This writes empty data to the graph
which will clear the graph when this code is executed.

Invoke Node:
1.
2.

Make sure the graph is clear by right-clicking the graph and selecting Data OperationsClear Graph.
Right-click the graph and select CreateInvoke NodeReinitialize to Default.

In LabVIEW releases prior to 8.0, you cannot create a constant if waveform data is being written to the
chart. Instead, use one of the methods described below.
Waveform Chart and Graph (Property Node):
1.
2.

Right-click the property and select CreateControl.


Go to the Front Panel and right-click the newly created control. Select AdvancedHide Control.

Waveform Graph (Invoke Node):


1.
2.

Make sure the graph is clear by right-clicking and select Data OperationsClear Graph.
Right-click the graph and select CreateInvoke NodeReinitialize to Default.

The following link shows a LabVIEW shipping example that demonstrates how to do this:
How to Clear Charts & Graphs
You can also find this example in the NI Example Finder, or in this file location:
[labview]\examples\general\graphs\charts.llb\How to Clear Charts & Graphs.vi

Related Links:
KnowledgeBase 3VGFK1HY: Why Doesn't Reinitializing to Default Value Clear Waveform Charts
Developer Zone Example: Clearing Charts and Graphs Programmatically
Example: How to Clear Charts & Graphs
Community: Clearing Charts & Graphs Programmatically

You might also like