ni.com is currently undergoing scheduled maintenance.

Some services may be unavailable at this time. Please contact us for help or try again later.

LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Global Variable question

Hi all,

I have a basic global variable question. I am running a vi that is monitoring the voltage of a battery. A sub-vi is called which performs an operation which lasts approximately 30 seconds. During the 30 seconds I would like to monitor the battery voltage, however, my main VI is waiting for the sub-VI to finish. Is there any way for the Main VI voltage-indicator to be updated through the sub-VI?

Thanks for the help,
0 Kudos
Message 1 of 5
(3,208 Views)
You need more than a global: you need to use a VI server. Without using a VI server, your calling VI will pause while the sub-VI is executing. So just having a global won't help because the calling VI won't do anything with it until the sub-VI is done (unless you use a VI server).

Take a look at the VI Server examples that ship with Labview. In Labview 6.1 menus, goto Help>> Find Examples >> Search, then search for VI Server.
0 Kudos
Message 2 of 5
(3,208 Views)
Thanks alot, actually I found a really easy and basic fix for this type of issue....I am just running a while loop in parallel with the main VI that is monitoring the voltage. It is a cheap and dirty way to get the result I need, but I'll keep your answer in mind when this method doesn't work.

Thanks again
0 Kudos
Message 3 of 5
(3,208 Views)
The loop in your main VI will still pause while any sub-VI is running.
0 Kudos
Message 4 of 5
(3,208 Views)
Al S a écrit:

>The loop in your main VI will still pause while any sub-VI is running.
>
>

It will not ...unless you go for it, like telling the subvi to execute
as a "subroutine".

In the simplest scheme parallel tasks WILL be executed in a parallel
way. Disconnected while loops do work that way.

This is a good reason why instrumentation programmers do like to do it
with LabVIEW... 🙂

oz
0 Kudos
Message 5 of 5
(3,208 Views)