LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

reentrant / invariant VIs how to use...

Hello,

I have a problem to run a vi reentrant (invariant). I set the vi properties to reentrant and tried out two ways to start the vi. The vi is intended to open a new little window showing a device name and retrieving a measurement value for that device, thats all. I hand over a cluster including the attributes (like device name, connection id,...)

First "call vi per reference":

That does not work because the vi does not start immediately. A window is opened but the vi does not run. Than it is possible to start the vi through the vi run button.

Second "invoke node":

The "invoke node" works for one device the way i need it. But when a hand out other parameters for another device no second window is opened.

Hope someone can give me some hints.

Big THX

Attachement: The expand vi is my reentrant vi.



0 Kudos
Message 1 of 3
(2,477 Views)
You can't achioeve what you want with a re-entrant VI.  What you need is a VI template (Save the VI as a VI template, and it will get the *.vit extension).  Simply renaming the file to a vit extension won't make it a template.

Then whenever you open it, LV will generate a new copy of it.

The reson why you need to do this is because the panel of a reentrant VI is decoupled from the code executing.  The panel will load only once, but the code can be running in multiple instances in the background.  Because of this, the front panel does NOT display any of the real-time information of any of the multiple instances running.  With a template, each piece of code has it's own panel.  They are actually all different VIs, duplicated and renamed on-the-fly by LabVIEW so that they can all co-exist, co-execute and co-display.

Hope this helps

Shane.
Using LV 6.1 and 8.2.1 on W2k (SP4) and WXP (SP2)
0 Kudos
Message 2 of 3
(2,475 Views)
thanks a lot, could already use it.
0 Kudos
Message 3 of 3
(2,466 Views)