LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

What is the best way to call a subVI for a status while it is being executed?

Solved!
Go to solution

Hello,

I am looking for the easiest way to accomplish this:

I have a subVI which takes about 30 sec to execute. I would like to know the status of the execution and get data (Integer value) out of that subVI.

 

Global variable?

 

Any direction is appreciated.

Thanks!

0 Kudos
Message 1 of 6
(1,128 Views)

@_TestMan_ wrote:

Hello,

I am looking for the easiest way to accomplish this:

I have a subVI which takes about 30 sec to execute. I would like to know the status of the execution and get data (Integer value) out of that subVI.

 

Global variable?

 

Any direction is appreciated.

Thanks!


There are so many ways to do this that it is hard to say with the limited information that you have given. What are you doing with the information once you've gotten it back from the subVI? If you use a global variable how are you planning to read it? In most cases I would either send a reference of my indicator to the subVI and let it directly write to the indicator or I would be more likely to set up a messaging loop between the main VI and the subVI. I might also consider using a notifier. I tend to shy away from global variables, though they do have their uses.

0 Kudos
Message 2 of 6
(1,119 Views)
Solution
Accepted by topic author _TestMan_
A global variable would work, but that means you have to continuously check the global in your calling VI. Queues, notifiers, and user events can all "trigger" the data communication, in the sense that your calling VI is just waiting on them until new data is available.
Also, you could have your subVI's front panel open up with a progress bar of some sort so that the user knows what's going on.
0 Kudos
Message 3 of 6
(1,115 Views)

@Gregory wrote:

Also, you could have your subVI's front panel open up with a progress bar of some sort so that the user knows what's going on.

You could even open the subVI in a subpanel in your calling vi, with only the information that you want visible.

0 Kudos
Message 4 of 6
(1,100 Views)

You could use channel wires with a writer in the subVI and a reader in the caller.

0 Kudos
Message 5 of 6
(1,082 Views)

Thank you everyone for the feedback and ideas.

 

channel wires: Interesting. 

Thanks for sharing.

0 Kudos
Message 6 of 6
(1,073 Views)