Showing results for 
Search instead for 
Did you mean: 

signal when sub-vi is done

One of the states in my state machine runs a sub-vi that takes a few minutes to complete. I would like to advance to the next state AFTER the sub-vi has completed running. Is there an event or signal that occurs upon vi completion? If so, how can I access this signal? Thanks.
0 Kudos
Message 1 of 5
If you include error in/out in your subvi, you can use the error out wired to a case structure (for "Error"/"No Error"), and decide which state to go to inside that case structure.  Maybe an error handling case if there's an error, or if not, then the next state of your machine.
Message 2 of 5

If your subVI is in one of your states, the state machine should not advance until it is complete.  That is unless you are calling through VI server.  If your subVI is not in your state machine you can use a notifier or occurance.  Just create a state that waits on that notifier/occurance then advance.


Message 3 of 5

Might be best to post a simplified version of your program to see what your trying to do. If you really need an event fired, and I think the previous answers are examples of more than likely why you might not, you could register your own user events and programatically fire them. There are examples listed in the "Help" menu for this. Also if you are dynamically running your sub vi there is a "Wait till Done" boolean setting.


0 Kudos
Message 4 of 5
I did not realize that the state machine would not advance until it the sub VI is complete. That seems to solve my problem. Now I have another question but I will start a new post.
0 Kudos
Message 5 of 5