LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

can you break from a subvi without stopping top-level VI execution?

Hello,

 

I'm wondering if, in LV, there is an easy way to exit a subVI at some point in its execution and return to a top-level VI ('easy' being by using a simple function, similiar in idea to 'break' or 'goto' from other languages). I have a state machine for a top-level, and each state executes one or more subvi's to perform specific functions. The subvi's that are in while loops are easy enough to stop when I want, but i'm wondering about the ones in flat sequences or the like.I tried 'stop' in application control, but that stops my top-level VI too.

 

0 Kudos
Message 1 of 4
(2,854 Views)

-SK- wrote:
The subvi's that are in while loops are easy enough to stop when I want, but i'm wondering about the ones in flat sequences or the like.I tried 'stop' in application control, but that stops my top-level VI too.

How exactly have you designed the interaction between the top-level VI and the subVI? Is it possible to post sample code that explains this?

Adnan Zafar
Certified LabVIEW Architect
Coleman Technologies
0 Kudos
Message 2 of 4
(2,839 Views)
I'm assuming you're referring to needing to do this while in debug mode. Unfortunately, no, there is no easy way, and that's primarily because LabVIEW is a dataflow language, not a "procedural" language.
0 Kudos
Message 3 of 4
(2,838 Views)

Adnan: the interaction is pretty simple; the subvi's receive their inputs from, and pass their outputs to, the top-level VI in the standard way. I'm not using global variables or references or anything. 

 

smercurio: I've tried a few things since posting, and looked around a bit more, and I'm getting the impression that you are right, and I must do it the long way.

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