08-10-2015 01:37 PM
HI
I have a Vi that has a subVI inside an event structure, and that subVI runs a measurement, and to stop it I have set up the code so that ater the measurement ends that the program aborts, by using the STOP button, which is the same as pressing the abort execution button. But that is also stopping the main VI. What I want to know is is there a way to stop this subVI without stopping the main VI
Solved! Go to Solution.
08-10-2015 01:40 PM
You should never use the STOP node unless you're using it for debugging.
Your code should follow data flow best practices and you can stop all of your loops using boolean logic. Within your subVI, you'll need to figure out a way to stop the loop(s) using booleans. This can be done in a million different ways depending on your code.
It sounds like maybe you need to tell the subVI to stop from outside the subVI? This can be done using a Queue architecture, a Notifier, or similar. I suggest you take a look at different architectures if you're unfamiliar.
Cheers
--------, Unofficial Forum Rules and Guidelines ,--------
'--- >The shortest distance between two nodes is a straight wire> ---'
08-10-2015 02:06 PM
Why would you use an event structure in the subVI? By definition, it is for responding to front panel events and if you don't show the front panel, a user can't interact with it. You certainly hack something up but you should either remove the event structure or have it in the main.
08-10-2015 02:19 PM - edited 08-10-2015 02:43 PM
@Dennis_Knutson wrote:
Why would you use an event structure in the subVI? By definition, it is for responding to front panel events and if you don't show the front panel, a user can't interact with it. You certainly hack something up but you should either remove the event structure or have it in the main.
I read it as the subVI is within the event structure, so the event structure is in the main VI.
Cheers
--------, Unofficial Forum Rules and Guidelines ,--------
'--- >The shortest distance between two nodes is a straight wire> ---'
08-10-2015 02:52 PM
the event structure is in the main VI
08-10-2015 03:46 PM
08-10-2015 03:47 PM
Dennis, he posted a new thread here...
Cheers
--------, Unofficial Forum Rules and Guidelines ,--------
'--- >The shortest distance between two nodes is a straight wire> ---'
08-10-2015 03:50 PM
08-10-2015 03:53 PM - edited 08-10-2015 03:54 PM
yup
Cheers
--------, Unofficial Forum Rules and Guidelines ,--------
'--- >The shortest distance between two nodes is a straight wire> ---'
05-27-2016 08:54 AM