09-17-2014 04:41 PM
Hi All,
I'm trying to open a .exe from labview in windows. when i send the command to the system exec vi I get the return code
-1073740777
does anyone know what this indicates?
thanks
Solved! Go to Solution.
09-17-2014 05:02 PM
Can you start the same executable file in Windows command line without error?
What is the command line & standard input for the System Exec call?
09-17-2014 05:32 PM
yes, i can start the program fine from the command prompt.
the call is c:\[my directory]\WTTServer.exe -pmulti -o2000
the -pmulti and -o2000 are flags which load the program with certain parameters. If i send the labview command without the flags it works fine and the return code is 2. if i add the flags i get the above mentioned error.
in the command prompt the flags work fine as well.
09-17-2014 06:12 PM
Did you remember to put "cmd /c" before your command?
09-17-2014 06:49 PM
The command line string should look like that "c:\[my directory]\WTTServer.exe" -pmulti -o2000, but this is probably already true, otherwise you will see errors when calling the command exec.vi. You are getting a return code, so I guess the command exec is executing properly, but the executable doesn't like it.
Maybe you need to specify the working directory? Or memory problem?
09-17-2014 07:54 PM
@chembo wrote:
The command line string should look like that "c:\[my directory]\WTTServer.exe" -pmulti -o2000, but this is probably already true, otherwise you will see errors when calling the command exec.vi. You are getting a return code, so I guess the command exec is executing properly, but the executable doesn't like it.
Maybe you need to specify the working directory? Or memory problem?
Read my post above and/or the LabVIEW help on the system exec.
09-17-2014 09:48 PM - edited 09-17-2014 09:50 PM
@billko wrote:
Read my post above and/or the LabVIEW help on the system exec.
The LabVIEW help states: "To use a command that must be executed directly from a command prompt window, insert cmd /c before the command."
Hopefully the use of cmd /c "c:\[my directory]\WTTServer.exe" -pmulti -o2000 helps. In most cases cmd /c is not required in order to run executable with the System Exec.vi. I never used it.
I guess that something else is wrong. There is a return code and the executable runs fine when called from LabVIEW without flags.
09-17-2014 10:03 PM
Should you put the flags within the quotes as well?
09-17-2014 11:16 PM - edited 09-17-2014 11:17 PM
@RavensFan wrote:
Should you put the flags within the quotes as well?
Initially I thought also that the complete command has to be in quotes when there are spaces in the executable's path.
I made a quick test with one SysinternalsSuite executable which uses similar type of flags, i.e. pslist.exe -d -m and LabVIEW 2013 on 64-bit Windows7. It looks like it works without quotes at all, but not when the complete command is in quotes.
c:\cmd test\SysinternalsSuite\pslist.exe -d -m and "c:\cmd test\SysinternalsSuite\pslist.exe" -d -m execute fine.
The all quoted "c:\cmd test\SysinternalsSuite\pslist.exe -d -m" generates a LabVIEW error:
Error 2 occurred at System Exec.vi. Command was ""c:\cmd test\SysinternalsSuite\pslist.exe -d -m""
Possible reason(s):
LabVIEW: Memory is full.
09-17-2014 11:24 PM - edited 09-17-2014 11:27 PM
Soo... did you fix it?
LV Help says:
"(Windows) To use a command that must be executed directly from a command prompt window, insert cmd /c before the command."
Since you are including parameters, I'm assuming this must be executed from a command prompt?