08-25-2016 08:42 AM
Hello,
I would like to stop a running vi if a timer exceeds a certain time. I am running a calculation but sometimes it takes ages to finish so, I would like to programmaticaly stop its VI if let's say run over 1min without giving a result and stopping by itself.
I tried the elapsed time with the while loop but it is not working as I have a control&simulation loop inside the while loop and it is stucked there (slow integration) which prohibits the while loop to stop if the maximum run time is reached.
Thanks,
Zied
Solved! Go to Solution.
08-25-2016 09:35 AM
Maybe you could modify this VI to suit your needs.
08-25-2016 11:15 AM
I have all the time a specific vi that I want to stop . I notice that the order of the VIs in memory can change and I have to select manually the right name.
So, I put as constante the VI reference. Unfortunately, I t did not stop the VI and I got error 1004.
I attached the modified VI.
08-25-2016 12:04 PM - edited 08-25-2016 12:11 PM
Can you try replacing the spaces in vi name with maybe "_" or some other but without spaces?
Make sure the vi is open before executing this.
Ref:http://digital.ni.com/public.nsf/allkb/96143643917AF5E6862570D90081152B?OpenDocument
08-25-2016 12:12 PM
Try this:
08-25-2016 01:59 PM
This last method worked for me but when I use the VI as a subvi I get error 1000 and the main VI gives the following error:
Error 1000 occurred at Invoke Node in formula (SubVI).vi->core algorithm v11.vi
Possible reason(s):
LabVIEW: The VI is not in a state compatible with this operation.
Method Name: Abort VI
08-25-2016 02:38 PM
Then don't make it a sub-vi.
I would just put something like this right on the top level VI block diagram and have it run independently of the main program.