03-11-2010 06:49 AM - edited 03-11-2010 06:50 AM
Hi,
Is there any vi or function that stops running the main vi abruptly upon true.(inside the main vi there may be a subvi that has a while loop meaning it runs indefinitely)
only the main vi should be closed not the LabVIEW insatance.I'm using LabVIEW 2009
03-11-2010 06:53 AM
03-11-2010 06:55 AM
I have to quote one of the most famos quotes on this forums:
Stopping your VI with the Abort Button is like stopping your car with a tree. It works, but it may have consequences!
So never ever do something like this. You architecture should support an "emergency shutdown" for this request, but never ever just kill the execution!
Norbert
03-11-2010 07:13 AM
Norbert,
ok...then how to stop running the vi in between(if we need so)
03-11-2010 07:21 AM
There are several options for this, depending on the overall architcture of your software. Most often, such a request makes sense in a producer/consumer environment.
So the task is to inform the producer and the consumer to shutdown. Even there you have different options:
a) The producer inits the shutdown. This is very easy since it follows the idea of produce/consumer.
b) If the consumer should init the shutdown, you have to include a "messaging mechanism" for the consumer in order to shutdown the producer. Custom user events come quite handy here....
c) You have some kind of watchdog for this feature. The watchdogs takes care about shutting down other parts of the application using user events or notifications. This can be used in producer/consumer as well as in other design patterns.
Sure, the shutdown is not really "immediate", but if there are certain security requirements involved (e.g. robotics emergency shutdown), you must not have a software shutdown working within non-deterministic systems! If you have such an environment, the only acceptable "softwaresolution" would work on FPGAs.......
Norbert