From Friday, April 19th (11:00 PM CDT) through Saturday, April 20th (2:00 PM CDT), 2024, ni.com will undergo system upgrades that may result in temporary service interruption.

We appreciate your patience as we improve our online experience.

LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

How to stop all Vi execution when a particular Vi is used??

Hello!

I have a problem. I am using a Data Acquisition/switch Unit(multimeter) to get info into labview. I have several parallel VI´s that call´s a subVI to get the information from the multimeter. Know when those parallel VI try to call the subvi at the same time, the subVi will break down. I kneed a way to make the some kind of cue to he subvi. So when the first Vi calls the subVi it will runt to completion before another Vi can use the subVI. I hope this is possible, or otherwise I got big problems.

I have tried to set the priority to SubVI priority. But it is not allowed due to a number of reasons.

Please help me!

/ Krille
0 Kudos
Message 1 of 4
(2,383 Views)
Hi

You could have one subvi which continuously acquires the data and writes it to a global variable.

This variable you can read everywhere (for instance in all your parallel subvis).

Hope this helps.

Thomas

Message Edited by becktho on 04-21-2005 11:39 AM

Using LV8.0
--------------------------------------------------------------------
Don't be afraid to rate a good answer... 😉
--------------------------------------------------------------------
Message 2 of 4
(2,378 Views)
Sounds like a case for a functional global.

http://zone.ni.com/devzone/conceptd.nsf/webmain/82E60E34E609C22A862569F8007E3F4A
0 Kudos
Message 3 of 4
(2,369 Views)
All you really need to do is make the subVI is not set to be reentrant. (VI Properties>Execution, make sure 'Reentrant Execution' is unchecked)

Having it not be reentrant will only let it be called from one location at a time. So the first instance that gets called will block the rest of them from running until it completes.

Take a look at the attached example. The subVI is simply a wrapper around the 'Wait' function so I can set it's reentrant property. The SubVI is used in both loops. Run 'Main.vi' and note the 'Wait Time(ms)' indicators will show 3000 ms between executions, even though the waits are 1000 and 2000. This is showing the subVI can only be run from one calling instance at a time. This is why we get a total time between executions of the subVI of 3000 ms.

Open the subVI and change it to reentrant execution (VI Properties>Execution, make sure 'Reentrant Execution' is checked). Save and close the subVI and run the main again. The wait times will now be 1000 and 2000 respectivly. This is showing that a separate copy of the subVI is being called for each instance of it.

Ed


Ed Dickens - Certified LabVIEW Architect - DISTek Integration, Inc. - NI Certified Alliance Partner
Using the Abort button to stop your VI is like using a tree to stop your car. It works, but there may be consequences.
0 Kudos
Message 4 of 4
(2,353 Views)