LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

which command I can use to exit from a subvi without exiting from labview in run-time?

Similiar to 'Exit Sub' command in Visual Basic.
0 Kudos
Message 1 of 4
(3,158 Views)
Are you trying to exit a subVI to get back to a Main VI? If so, use a simple state machine. There is a template for this in LabVIEW. Put the SubVI inside the state machine to be called.

For the subVI, under the VI Property "Window Appearances", customize the window to Show Front Panel when called, and Close afterwards if originally closed.

If this is what you are looking for I can send an example.
0 Kudos
Message 2 of 4
(3,158 Views)
In LabVIEW, go to the FIND EXAMPLES menu. View the New Event Handler.VI or the Old Event Handler.VI and either of these will do if this is indeed what you are looking for... =0)
0 Kudos
Message 3 of 4
(3,158 Views)
> Similiar to 'Exit Sub' command in Visual Basic.

There isn't a command to do this. Since LV is a dataflow language, it
is important that all the data be delivered to the output terminals.
BASIC is a procedural language, with all sorts of control flow commands
like this, and if you are using a functional language or a dataflow
language, you simply focus on getting to the end of the function. If
you are in a while loop, you terminate the while loop by the value going
to the conditional terminal. If you are in a For loop and need to exit
early, perhaps it should have used a while loop. If there is code in a
normal diagram that you sometimes do not want to execute, it should
probably go in a case structure.

The other reply has some good suggesti
ons in that you probably have a UI
or a sequence that you want to exit out of. Organizing your code so
that you are in a button handling state or exiting state will help you
organize how you think about the transitions between states. On the
other hand, there lots of examples and user contributed VIs to look at.
I'd recommend you get comfortable with a few of them since the state
machine is just one programming tool, just like the loop and case
statement that it is built from.

Greg McKaskle
0 Kudos
Message 4 of 4
(3,158 Views)