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: 

How can I programmatically remove a selection of plots from a waveform graph?

I have a waveform graph to display a number of plots, which I need to programmatically add and delete to as selections of data are chosen by the user for display.
I've looked under the VI Server Property node and cannot see anything suitable for adding extra plots, or removing existing plots. I expected to see a Plot Data array variable, with each element containing the data for each of the plots on the graph. There is such an array for the annotations, which I can easily edit by Removing Subset for Array, or Insert into Array, but nothing for the plot data. The Value property is a Variant, which I'm unsure how to handle. Should I be working with this perhaps? Can this be done by creating a Local Variable read node? Or am I missing something simple here?? Smiley Very Happy
Thoric (CLA, CLED, CTD and LabVIEW Champion)


0 Kudos
Message 1 of 3
(2,460 Views)
Hi Thoric,
you can use a property node (value) of your waveform graph to read all values, then use the array functions and write the new data back to you graph.
 
Or you use something like this.
Mike


Message Edited by MikeS81 on 06-19-2008 03:53 PM
0 Kudos
Message 2 of 3
(2,457 Views)
Hi Mike,

I was trying to use the Property Node (Value) to read the waveform graph, but I was getting a Variant type back, not a 2D array of DBLs as I expected. Turns out I was passing the graph control reference to a subvi whose control refnum had the Include Type flag unchecked. As a result of this explicit definition, Value was of an uncertain (undefined) type and couldn't be natively provided. It would have had to have been cast into a more specific type to work. Have solved the problem by ensuring all my references are of a strict type, and now (as you recommend) the Property Node (Value) is useful Smiley Very Happy

Many thanks for the response!
And many thanks for the demo too! You put that together remarkably quickly! Smiley Happy
Thoric (CLA, CLED, CTD and LabVIEW Champion)


0 Kudos
Message 3 of 3
(2,451 Views)