LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

clear waveform chart using an explicit non-strict reference?

I'm trying to clear a waveform chart using the property node for a explicit non-strict reference.  I've tried setting the history data to an arbitrary set of data; however, the problem is that there is no history data property.  I'm trying to write an initialization procedure which will initialize all controls.  If I try to invoke reinitialize to default, it doesn't clear the history of my waveform chart.  I've included code outlining what I'm trying to accomplish.
0 Kudos
Message 1 of 15
(4,188 Views)
Is this what you are after or did I miss the boat?
Now Using LabVIEW 2019SP1 and TestStand 2019
0 Kudos
Message 2 of 15
(4,177 Views)
GovBob, I know you can use implicit references or strict explicit references and just set all items in the history data to an empty array.  What I was trying to get at is: if I have many waverform charts, is it possible for me to use some kind of loop structure to go through all my controls, including charts, and reinitialize everything while also clear the charts?  Let's say I have 100 charts and I want to clear the data from their plot area, it's a little cumbersome to create an implicit reference and set the history data to zero.  Instead, could I do this in a for loop?
0 Kudos
Message 3 of 15
(4,167 Views)
OK, so I use a strict reference...  But I think if you look at the implementation, you will see how I only use ONE, and can use it to set the history to empty array for ANY waveform chart.  I hammered it together quickly... so excuse the clutter, and lack of error handling etc... it is only meant to show you it can be done.  I think openG has a VI or set of VIs that can do a recursive class interpreter (sp?), which can be use of you have embedded this things in tabs, clusters, arrays etc... but this is getting a lot more complicated... but you get the idea.
Good luck

Paul
0 Kudos
Message 4 of 15
(4,148 Views)

The "To more specific" function will allow you to take a generic reference and type it as any type you desire. If you cast the ref as the proper type, you should get access to the history property.

Alternatively, the invoke node Re-initilize to default should be available for generics (I beieve).

Ben

Retired Senior Automation Systems Architect with Data Science Automation LabVIEW Champion Knight of NI and Prepper LinkedIn Profile YouTube Channel
0 Kudos
Message 5 of 15
(4,139 Views)
First off, using a "to more specific class" vi will only work if the target class is instantiated from the desired waveform chart.  This will not work in the generic case as I have shown in the attached example.  In the file, I've made 2 additional copies of the original waveform chart.  The property node is strict and so, when the program is run, an error arises pertaining to a type mismatch involving the "to more specific class" vi.  Why is it that history data isn't available for generic waveform charts? And is it still possible to do a general clear chart operation?
0 Kudos
Message 6 of 15
(4,130 Views)
Do the "to more..." conditionally.
 
 
Ben

Message Edited by Ben on 06-27-2007 11:40 AM

Retired Senior Automation Systems Architect with Data Science Automation LabVIEW Champion Knight of NI and Prepper LinkedIn Profile YouTube Channel
Download All
0 Kudos
Message 7 of 15
(4,122 Views)

Sorry to hijack this thread but I have similar problem...Ben, what do you mean by "Do the "to more..." conditionally." because I found that your code and jimmy1981 is similar but jimmy code thrown an error. Can you please show me how to do that?

 

 

Thanks.

DAKBIAS
0 Kudos
Message 8 of 15
(3,660 Views)

I was advising that the error could be avoided if the "To more specific" node was only invoked under the restriction that the refernce is of the proper class. If you attempt to cast a ref to a class that is inappropriate (i.e. LV can't figure how how to make a stirng look like graph) it will through an error... so only do the casting (using the "to more specific.." ) when it is legal.

 

I wrote my Nugget "Using Control References" to help people get an idea of what can be done with control refs. You may want to review that thread.   (Don't worry about the extreme example   I posted at the end. It was intended as an academic exercise to entertain the more advanced users.

 

Take care,

 

Ben

Retired Senior Automation Systems Architect with Data Science Automation LabVIEW Champion Knight of NI and Prepper LinkedIn Profile YouTube Channel
0 Kudos
Message 9 of 15
(3,654 Views)

@mrutm wrote:

 because I found that your code and jimmy1981 is similar but jimmy code thrown an error.  

 


If you look closely, you'll see there is a difference between Jimmy's code and Ben's in where the casting of the reference is occurring.  Notice that Ben's casting occurs inside the case structure so that it only happens when the classID is correct.  Jimmy's casting occurs on every control reference on the front panel, and most of them would be incorrect.

0 Kudos
Message 10 of 15
(3,639 Views)