To download NI software, including the products shown below, visit ni.com/downloads.
Overview
Programmatically clear a waveform chart in LabVIEW. This example clears the chart by wiring a Constant to the History Data Property Node for the Waveform Chart. Alternatively, a Reinitialize To Default Invoke Node can be used. Caution with the Reinitialize to Default as the 'Default' can be programmatically modified.
Description
The 'Programmatically Clear Wfm Chart.vi' has a while loop and event structure. When the 'Generate Data' button is selected, a for loop generates an array of random doubles. The array is plotted on the waveform chart. When the 'Clear Chart' button is pressed, then an empty array of doubles constant is wired to the History Data Property Node to clear the chart. To create the property node, right-click on the chart. Select Create > Property Node > History Data. Then right-click on the Property Node and select 'Change to Write'. Right-click on the property node and select 'Create Constant' to create the empty array of doubles to clear the chart. For more information, see the following KnowledgeBase article: How to Clear a Chart or Graph Programmatically in LabVIEW.
Requirements
Steps to Implement or Execute Code
Additional Information or References
VI Block Diagram
**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.
Can this be done for a single plot rather than the whole chart?
Say I want to give the user some checkboxes and controls to select which data they want to plot at runtime, so that while the chart is running they can add a new plot, or take one away.
So far the closest I can get is to visibly hide the plots at runtime, but this isn't exactly what I want.
Thanks