LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

system exec.vi labview application

Solved!
Go to solution

Hi everyone,

I'm having a problem with system exec.vi. I simply want to open another program using labview. This works whenever I try to access it using the VI. However, when I turn the VI into an executable, the system exec.vi doesn't do anything. I'm running a windows xp machine. I have tried it with a windows 7 machine and still nothing. any help would be appreciated. Thanks.

0 Kudos
Message 1 of 10
(5,014 Views)

Are you using a relative path to the EXE? If so, LabVIEW may report a different path when a VI is compiled into an executable, so a path relative to a VI's path may be wrong.

0 Kudos
Message 2 of 10
(4,999 Views)

Hey nathand,

I'm not really sure what you mean. The only thing I have connected to the system exec VI is the path to the program. It's also installed at the same place in both the windows 7 machine and the windows xp machine.

0 Kudos
Message 3 of 10
(4,997 Views)
Solution
Accepted by jachy25

Did you put the "cmd /c" before the program to run?


GCentral
There are only two ways to tell somebody thanks: Kudos and Marked Solutions
Unofficial Forum Rules and Guidelines
"Not that we are sufficient in ourselves to claim anything as coming from us, but our sufficiency is from God" - 2 Corinthians 3:5
Message 4 of 10
(4,984 Views)

crossrulz,

Thank you! That did the trick. Is there any way to close the cmd right after it launches the program?

0 Kudos
Message 5 of 10
(4,980 Views)
There are options on the SystemExec.vi for that. You should really read the hep file on it.

GCentral
There are only two ways to tell somebody thanks: Kudos and Marked Solutions
Unofficial Forum Rules and Guidelines
"Not that we are sufficient in ourselves to claim anything as coming from us, but our sufficiency is from God" - 2 Corinthians 3:5
0 Kudos
Message 6 of 10
(4,955 Views)

@jachy25 wrote:

Hey nathand,

I'm not really sure what you mean. The only thing I have connected to the system exec VI is the path to the program. It's also installed at the same place in both the windows 7 machine and the windows xp machine.


Obviously this wasn't the issue, but to clarify: a relative path means you're providing a path relative to some other item. For example, if you were generating the path to the EXE by using the "Current VI's Path" function and then using Strip Path/Build Path, that would be a relative path. The "Current VI's Path" function may return a different path inside an executable than in the development environment, so that could cause the issue you describe.

 

If you're referencing the external program with an absolute path (ie "C:\Program Files\Vendor\program.exe") then this isn't an issue, of course.

0 Kudos
Message 7 of 10
(4,934 Views)

Thanks for the help and great explanations guys 🙂

0 Kudos
Message 8 of 10
(4,884 Views)

Hi,

 

I'm not quite sure what you mean - will you mind explaining in a bit more detail. I have the same problem.

0 Kudos
Message 9 of 10
(4,669 Views)

Which part isn't clear? The accepted solution says to prepend "cmd /c " to the command line string input to System Exec. For example if you wanted to execute notepad.exe, the command line would be "cmd /c notepad.exe".

0 Kudos
Message 10 of 10
(4,655 Views)