08-10-2017 05:03 PM
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!
08-10-2017 05:13 PM - edited 08-10-2017 05:15 PM
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.
08-10-2017 05:46 PM
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"
08-10-2017 06:02 PM
Great. Also; great profile name.