Showing results for 
Search instead for 
Did you mean: 

Can anything stop my vi?

Can anybody tell me how to stop Open in ds What you see doesn't stop the vi?

Download All
0 Kudos
Message 1 of 15
First off, why are you saving your code in the LabVIEW program directory? If you need to reinstall LabVIEW you may lose your code. Smiley Surprised

Second, why do you need to stop a VI that's going to stop itself anyway? You're calling the System Exec with "wait until completion" set to false, so it should not wait until the command is completed before it stops. Or, are you trying to stop the process that's being started by the System Exec function?

Third, why are you calling the Stop function on a VI that's going to stop anyway on its own?
0 Kudos
Message 2 of 15
Because it opens an application that needs to be open for a long as the main vi runs.  Since the System Exec won't close until the application closes, I need to somehow close the vi.
0 Kudos
Message 3 of 15
I only looked at your 'open', but it seems that the 'wait until completion' option set to false isn't working for some reason.

Perhaps you can find a different method to open the application that doesn't wait for it to finish.

I don't know how you would do it in MacOS but this works in Windows...

Create a shortcut to the application you want to run and then execute the shortcut... like this...

Then it doesn't even need to be in a subvi.

Message Edited by Troy K on 04-01-2008 09:53 AM
Troy - CLD "If a hammer is the only tool you have, everything starts to look like a nail." ~ Maslow/Kaplan - Law of the instrument
0 Kudos
Message 4 of 15
Agreed. Perhaps this is a MacOS thing. The System Exec should not wait until the application it launches is done before returning if "wait until completion" is set to false. I would be interested in knowing if this behavior occurs with just this application or with any application you try to launch with System Exec.
0 Kudos
Message 5 of 15
It's any application that doesn't finish, despite setting wait to completion to false. This is what I was told by LV. I think calling a batch file works though. But I'm not sure yet; I'm looking at other things.

Thanks for the heads up about the location of my files. It's also a pain having buried so far down the directory tree. Maybe now I'll change it.
0 Kudos
Message 6 of 15
"This is what I was told by LV"

Who said this, NI? Were they referring to something specific, as in its use on MacOS, or something else?
0 Kudos
Message 7 of 15
Somebody at tech support. As for the rest, I'm not sure.
0 Kudos
Message 8 of 15
I got this to run on my Mac without too many problems. I changed the command line input from a constant to a control so I could change the path. I added indicators to the standard error, return code and error out so I could see why things did not work.

1. My version of does not have a space before the DS9.
2. I changed the command to: open "/Applications/"
3. When I do this, Open launches the SAOImage ds9 application and terminates the VI.
4. I modified to use a file dialog rather than a constant, added timing measurements, and disabled the Stop and the System Exec calls outside the sequence structure. This calls Open and ends execution immediately (before SAOImage ds9 is done launching). The timing is about 300 ms for the Run VI invoke node frame. According to the Profiler, Open takes about 22 ms and the System takes about 172 ms.
5. Disabling the Abort VI node reduces the time to 80-90 ms for the Run VI invoke node frame.

This was tested on a Dual G5 Power PC running Mac OS X 10.4.11 and LV 8.5.

The modified VIs are attached.

Download All
0 Kudos
Message 9 of 15
Lynn, thanks for your help.

SAOImage DS9 is the X11 based version.
SAOImageDS is the standalone version.

What brings you to ds9?
0 Kudos
Message 10 of 15