From Friday, April 19th (11:00 PM CDT) through Saturday, April 20th (2:00 PM CDT), 2024, ni.com will undergo system upgrades that may result in temporary service interruption.

We appreciate your patience as we improve our online experience.

LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Clear chart in subvi from the main vi

Hi all,

im not sure if this has been solved before but my problem is, is there a easier method if i create a subvi containing a waveform chart and i want to clear the data in the chart after each run so that new values from the main vi can be plotted without the previous data plot. I placed the "history data" property node and wired it to an empty array in the subvi but when i ran the program, the graph doesnt plot at all..


Regards
Adrian

0 Kudos
Message 1 of 6
(2,547 Views)

Why you want to clear the chart from main. Pass the data from main and before passing the data use invoke node and clear the chart in subvi.

--------------------------------------------------------------------------------------------------------
Kudos are always welcome if you got solution to some extent.

I need my difficulties because they are necessary to enjoy my success.
--Ranjeet
Message 2 of 6
(2,530 Views)

Yup, the data actually comes from main VI. Since there is data from the main VI goes to the subVI (actually consists of just a waveform chart for reading data), when i wired a constant array to the "history data" in the subVI, it doesnt plot but just gives an empty chart. 
But i'll try out what you said and see if it works
Thanks and appreciate your help 

0 Kudos
Message 3 of 6
(2,515 Views)

You might have fun trying to find an invoke node for a Waveform Chart to clear data...

 

Property nodes are the way forward. You're essentially wiring an empty array to either Waveform Graph >> Property >> Value (for a waveform graph) or Waveform Chart >> Property >> History Data for the chart.

 

Without seeing your code, my guess is that you're sending data to the chart and then sending an empty array to History Data *after* this. So you're plotting data and then clearing it. You can use the error connectors for the property node to ensure it runs before you send new data to the chart, or similar techniques.

 

Have a look here for an example.

---
CLA
Message 4 of 6
(2,510 Views)

Post the VI.

--------------------------------------------------------------------------------------------------------
Kudos are always welcome if you got solution to some extent.

I need my difficulties because they are necessary to enjoy my success.
--Ranjeet
0 Kudos
Message 5 of 6
(2,498 Views)

hmm ii'll try using the invoke property method.
Appreciate and thanks for the help guys!

Download All
0 Kudos
Message 6 of 6
(2,471 Views)