Showing results for 
Search instead for 
Did you mean: 

reentrancy question

Ok, here's my setup.  I have six tab pages in a VI, and I want to call a SubVI six times (it's reentrant), once for each tab page.  I was under the impression that you could do this, but is reentrancy only an option for separate VIs calling the same SubVI?  I've attached something that should show the behavior.
I understand that I'm apparently doing this wrong, but is there a way to accomplish what I want?  I have six identical machines that I want to reuse the code for, and I need to be able to assign one value for each (i.e. all the code controls a certain machine based on which machine number I put in).
In the examples, temp is the tab control and main VI, temp is the reentrant VI (in this case just throughput of a control).
Download All
0 Kudos
Message 1 of 7
OK, apparently this works with VI templates (.vit) instead of reentrancy.  There isn't much in the way of documentation on VITs, so if anybody has any pointers on them, I'd appreciate it.

Message Edited by JeffOverton on 03-31-2008 01:58 PM
Download All
0 Kudos
Message 2 of 7
You can load multiple instances of a reentrant VI programmatically using the Open VI Reference function. You will need to wire in the option 8 to make sure you load it reentrantly. Right click the function and select Help to see some more documentation on this.

You are correct that you can also do this using vit's. In LabVIEW 7.1 and before, this was the only way to dynamically clone a VI whose FP was supposed to be visible. In LabVIEW 8.0 and above, you can do this with reentrant VIs, which should be more efficient, because LabVIEW doesn't have to clone the entire VI, just the parts necessary to run them independently.
Jarrod S.
National Instruments
0 Kudos
Message 3 of 7
Thanks Jarrod.  So reentrancy is the preferred method in this circumstance?  It's fairly important, because the reentrant VI calls several reentrant VIs itself (there are several methods of controlling each machine), so I imagine any memory issues would be compounded.
0 Kudos
Message 4 of 7
Ok, one more quick question.  When running the actual .vit, it has a path but when running an instance of it (for example, template the "Current VI's Path" returns <Not A Path>.  Since this is the way they'll be handled at runtime, I believe, that makes relative paths unusuable in a template vi.  Is this true?
0 Kudos
Message 5 of 7


You are correct that you will not be able to use relative paths in this instance.


Hillary E
National Instruments
0 Kudos
Message 6 of 7
Thanks Hillary.  If anyone else runs into this problem, my workaround was to use Current VI's Path in the caller, strip it two levels, and pass it to the template instances via property node.
0 Kudos
Message 7 of 7