LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

If a reentrant "main.vi" has a subVI "mainSub.vi", can mainSub be unique to the instance of Main?

Greetings!

This question was asked and answered some (6 or 😎 years ago, but I can't find the thread.

Say there's an app that uses an instrument - say a DVM (digital voltage meter).  The instrument is encapsulated by a functional global that "remembers" interface details like the VISA Resource.  This DVM "driver" VI appears many places in the application and it's not necessary to pass a VISA Resource to it.

 

Now I want to make the top-level VI reentrant and clone it.  Each "clone" needs to use a different DVM, so the DVM vi needs to be unique under each clone.  Of course we could make the DVM reentrant, open a reference to it and pass the reference everywhere the DVM is used, but that's exactly what the OP wanted to avoid in the "other" thread (which I can't find). 

 

If I remember correctly, this is possible, but I never understood exactly how.

 

Any help is appreciated!

0 Kudos
Message 1 of 4
(2,291 Views)

Like this perhaps? http://forums.ni.com/t5/LabVIEW/Multiple-reentrant-clones-with-not-reentrant-FGV-timer/td-p/3058465

 

In that example you still need to know which "clone" you are operating on so you would need to pass on the VI ref wire to whomever needs in within your top-level VI and SubVIs.

 

You could store the VI ref in some other global object (the thread suggests ideas like named queues and DVRs) but even in those circumstances you still need to pass a wire around so you don't really gain anything - just more overhead in getting the ref out each time.

0 Kudos
Message 2 of 4
(2,283 Views)

Hi,

Thanks tyk!

FYI:

I found the (4 year old) thread, here:

"https://forums.ni.com/t5/LabVIEW/Reentrant-top-level-vi/m-p/2418444"

 

0 Kudos
Message 3 of 4
(2,259 Views)

Great. Also; great profile name.

0 Kudos
Message 4 of 4
(2,254 Views)