ni.com is currently undergoing scheduled maintenance.

Some services may be unavailable at this time. Please contact us for help or try again later.

LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Create New Reference from Existing Reference

Solved!
Go to solution

I have a VI where I want to create a new reference off of an existing reference, referring to the same object, so that I can close the new reference without closing the original reference. The original reference needs to outlive this VI. Is there a way to do this?

 

GregFreeman_1-1600454161663.png

 

 

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

I just solved it like so, but I'd like if there was a more generic way to get a new reference, because this doesn't really scale for different types.

 

GregFreeman_1-1600456370706.png

 

 

0 Kudos
Message 2 of 6
(2,231 Views)

Can you call ParentClass once before enter the loop, avoid pass Parser into the loop?

 

George Zou
0 Kudos
Message 3 of 6
(2,221 Views)

@zou wrote:

Can you call ParentClass once before enter the loop, avoid pass Parser into the loop?

 


Yes that's a good option, and then i would only call the loop if it has a parent. Also, I did change it to use recursion instead of a loop, but the question still remains. I guess I have a couple different options. Also, to simplify slightly I found there is an OpenClass method which keeps me from needing to use OpenLibrary with a cast to a class:

 

GregFreeman_0-1600460459734.png

 

0 Kudos
Message 4 of 6
(2,212 Views)
Solution
Accepted by GregFreeman

I'd avoid the problem altogether...

Dont close first.PNG

 

Message 5 of 6
(2,132 Views)

wiebe@CARYA wrote:

I'd avoid the problem altogether...

Dont close first.PNG

 


Nice use of pipelining. Definitely didn't think of this.

0 Kudos
Message 6 of 6
(2,052 Views)