09-14-2012 04:22 PM
Hello,
this is just an example
i have a led that blink inside a subvi and i what to stop it form the ui of the user (MainHelp.vi)
but because the subvihelp.vi dont know the stop button it will not stop when i klick on the stop button
How i can work it out with out using global Var
thanks for your replay.
09-14-2012 08:20 PM
Hi
Here is one method to stop a blinking VI in a SubVI. I tried not to change your version of how the blinking works. Since the subVI is running continuously this example calls the VI using static reference and using the control names. You could also use a queue to pass values to the subVI controls.
Your original VI has a lot of stuff that made no sense, so I cleaned them all out or up, so to speak.
.
Good Luck.
09-15-2012 04:09 AM
thanks for your replay
there is a a chance you can save it that it can be open in labview 2010
09-15-2012 04:40 AM
Ok thanks
i did understand the vi,
but what if i have alot of vi?
this is will be a good what to stop a process
from where i question is comming from:
i am building a program that control on a vacuum.
i have a SubVI for every output, in the subVI of the output i look if the valve is close/open and just then i quit the SubVI and continue to the next one.
but what if i have a problem in the system the pressure is not good enough and more problem that can occur while i am waiting to valve to close,
just when i exit the SubVI it see the problem and take an action
09-15-2012 10:17 PM
Hi,
Glad you liked the example of controlling an LED in a SubVI from a parent VI.
The description is not so clear. The subVI is looking to see the valve state. When and where do you look at the pressure? How long does it take to close the valve, and when do you tell the valve to close?
I'm not sure how this example converts to the code you want to develop. DO you have some smple code?
Mark
09-16-2012 04:35 AM
OK i will try to expline my self
there is two way to say to a valve to open/close
manual: every valve have a button
auto: sequence of action (open that, close that, heat that ....)
the open/close valve look like that
this is a subVI to open/close Valve P.
when i try to expline my self i thought on somehing.
to make a MainMain VI that will run the Main Program, like that
the VI 1 in control on the front panel.
when the system is not ok, i dont care about the front panel. i just what to close all the valve and the heat.
when i try that to Labview return me Error 1000
thanks for your replay
09-16-2012 09:18 PM
Hi,
I have not use the abort VI property, so I am not sure why you are getting error 1000. This says the VI is not in a state to be aborted.
It seems you are using two levels of dynamic dispatch, so that might have something to do with it.
If your goal is to shut down all the subVI's that are running valves you probably need a scheme to close those subVI's first, then close the main VI that has called all the SubVI's.
Can you restate what the goal is that you are trying to achieve?
thanks
Mark
09-17-2012 01:28 AM
Why don't you use a queue or a message to pass the status of those stop buttons bettween the VIs?
If the queue have the same name even if you call it from different VIs you are calling the same queue
It's only an idea, but I think that it could work.
09-17-2012 03:35 AM
The beautiful solution is to use user events and react to them in the sub-vi. The easy is to use a global variable that stops the sub vi's.
/Y