LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

How can I call a LabVIEW executable from within another LabVIEW executable?

I have a customer requirement for two LabVIEW executables. Based on their current setup, they need to run executable "A" or "B", both of which are under independent revision control. I have created a third "selection" executable that allows the operator to choose between one of the two, but I am receiving errors when I attempt to call a LabVIEW executable from within a LabVIEW executable using either the "System exec" VI or the "Run Application" VI. If I call a non-LabVIEW executable (such as Windows Explorer) everything works fine.
0 Kudos
Message 1 of 7
(3,475 Views)
Hi,

I tried to re-create your problem but failed miserably I'm sorry to say. I simply passed the name of the LabVIEW executable I wanted to run as a string to the "Command Line" input of the "system exec" VI and it worked fine for selecting any program - so long as the path information was correct. (I believe the path is relative to where your "selection" executable is located.)

There is an article online here that may help you showing another method... http://zone.ni.com/devzone/conceptd.nsf/webmain/095F19486B828D0B86256C2C0061F782?OpenDocument&node=200066_us

Other than that have you thought about implementing "A" and "B" as subpanels in your "selection" VI? (Assuming you have LabVIEW 7 of course)

Hope some of this helps.
Neil
0 Kudos
Message 2 of 7
(3,475 Views)
> I have a customer requirement for two LabVIEW executables. Based on
> their current setup, they need to run executable "A" or "B", both of
> which are under independent revision control. I have created a third
> "selection" executable that allows the operator to choose between one
> of the two, but I am receiving errors when I attempt to call a LabVIEW
> executable from within a LabVIEW executable using either the "System
> exec" VI or the "Run Application" VI. If I call a non-LabVIEW
> executable (such as Windows Explorer) everything works fine.

As with the other poster, I suspect a path problem. You might try the
path out in a shell window, and if it works, copy the complete absolute
path to LV to see if that works. LV is basically passing the comma
nd to
the OS and doesn't even know what is in it, so you should be able to get
it to work.

The other poster commented on subpanels, which is a good suggestion, but
without going to LV7, an EXE can have open more than one VI. You can
use the VI Server and the Run method to fire up another top-level VI.
The decision is whether you want both to be in unique processes.

Greg McKaskle
0 Kudos
Message 3 of 7
(3,475 Views)
Hi Neil,

Thanks for your reply.... I did figure this thing out last night. It turns out that this routine will work fine on machines running Windows 98 or older software - the problem shows up with Windows 2000 and Windows XP. Apparently, it is a requirement under the newer OS to prefix the command line with "cmd /x /c start" (without the quotes) and enclose the path\filename string in quotes to get around the issue. This syntax mimics the use of the "START", "RUN" feature in Windows. After much digging, I found a link on the NI site that included a download entitled "Run.vi". For those of you who are operating in the newer OS, see this file. Here is the note that was enclosed with the VI:

The start command in Windows 95/98/Me launches a fil
e using its default application. To use this command in NT/2000, you must first call "cmd /x /c" to launch "start" in a new instance of the command interpreter with extensions enabled.

As far as implementing "A" and "B" as subpanels, that was not an option. We need to maintain individual revision control on the other applications.

Thanks again for your reply... hope this info helps out someone else down the line.

Mark
0 Kudos
Message 4 of 7
(3,475 Views)
Hi Gary,

Yes, the verification of the path string was the first thing I attempted using the Windows "RUN" application - and of course that worked fine. It just did not work at all when making the call from LabVIEW.

As I stated in the response to the last post, this problem relates to the syntax the programmer must use when dealing with the later versions of Windows.

Regards,
Mark
0 Kudos
Message 5 of 7
(3,475 Views)
Feeding the System Exec.vi (inside one LV app) with a path like c:\test\testapp.exe (testapp.exe being another LV application) works fine on my "newer" OS - WinXP.
0 Kudos
Message 6 of 7
(3,475 Views)
I have three applications, two using VISA one Classic serial IO builded with LV 6.0.2. I created a VI which starts these three applications with System Exec. I used LV 6.0.2 and 6.1 for the starting VI and I get no problem either form the develoment system nor from a standalone application. I tried this under Windows NT 4.0 SP 6a. Of course I used the correct paths.

Waldemar
Waldemar

Using 7.1.1, 8.5.1, 8.6.1, 2009 on XP and RT
Don't forget to give Kudos to good answers and/or questions
0 Kudos
Message 7 of 7
(3,474 Views)