LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

call a vi multiple times to check progress

My basic setup is that I have a caller vi calling a subvi.  However as the caller vi is looping i would like it to call the subvi and not wait for it to finish its execution.  Except i would like it to go to the next loop and then call the previous instance of the subvi to check on the progress.

 

I have attached some example vi sto show m point, where the caller_vi.vi calls the subvi.vi to bgein exectution.  Basically i would like it to call the subvi to run independantly and while it is running the caller vi can keep calling it to check on the vairables 'x=1' and 'numeric3'.  However if the subvi has finished running then it should begin another execution again when called from the caller vi

 

Thanks

 

Ps. I have played around with the reentrant options and Run vi methods to no avail so far

Download All
0 Kudos
Message 1 of 4
(2,708 Views)

All this make very little sense.

 

  • You have only one instance of the subVI, so "re-entrant" would not make a difference.
  • You must have attached the wrong subVI, because it has no connectors or controls/indicators.
  • The way you are calling the subVI will make the main VI wait until the subVI has completed (dataflow!). Numeric 3 cannot update until the subVI has finished.
  • "x=1" and "numeric3" are NOT variables. They are indicators and have no meaning outside the main VI.

 

 

There are many solutions, but it is not clear what you actually want. Could you describe the problem in a bit more detail?

 

You could run the subVI independently and show/hide its FP as needed, for example.

 

0 Kudos
Message 2 of 4
(2,696 Views)

Yeah the vi's I attached weren't the latest copies. So I have attached them again.

 

As for what I need:

  1. What I would like is to call and run the subvi.vi from the caller_vi.vi and not wait for it to finish execution but return to the caller_vi.vi (For this I believe the run vi invoke node would be used with a false 'Wait until Done'...something similar to what is inside the case structure at the bottom of the Block Diagram)
  2. While the subvi.vi is running the caller_vi.vi should continue doing loops and therefore when it is doing another loop it should call the subvi.vi again. 
  3. From this new call I need it get the values for 'x+1' and 'Numeric3' only if the subvi.vi has not finished executing Otherwise it should run the subvi.vi again. SO if subvi.vi is finished then run again if subvi.vi is not finished then what is the value of 'x+1' and 'Numeric3'
  4. Obviously I have not called the subvi.vi in the correct manner or else my program would have worked but the previous steps shows what I would like to get

 I hope that makes things clearer

 

Download All
0 Kudos
Message 3 of 4
(2,684 Views)

I guess nobody had been able to find a response to this yet but I have managed to adjusts my vi to give a better indication of what I need.  The vi's basically accomplish the requirements I was looking for however I am wondering if this is the best way to go about it or if there is a better more professional way.

 

 

Download All
0 Kudos
Message 4 of 4
(2,653 Views)