LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

System Exec return codes

Solved!
Go to solution

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

0 Kudos
Message 1 of 25
(5,736 Views)

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?

0 Kudos
Message 2 of 25
(5,730 Views)

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.

0 Kudos
Message 3 of 25
(5,723 Views)

Did you remember to put "cmd /c" before your command?

Bill
CLD
(Mid-Level minion.)
My support system ensures that I don't look totally incompetent.
Proud to say that I've progressed beyond knowing just enough to be dangerous. I now know enough to know that I have no clue about anything at all.
Humble author of the CLAD Nugget.
0 Kudos
Message 4 of 25
(5,710 Views)

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? 

0 Kudos
Message 5 of 25
(5,703 Views)

@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.

Bill
CLD
(Mid-Level minion.)
My support system ensures that I don't look totally incompetent.
Proud to say that I've progressed beyond knowing just enough to be dangerous. I now know enough to know that I have no clue about anything at all.
Humble author of the CLAD Nugget.
Message 6 of 25
(5,696 Views)

@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.

0 Kudos
Message 7 of 25
(5,668 Views)

Should you put the flags within the quotes as well?

0 Kudos
Message 8 of 25
(5,660 Views)

@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.

 

 

0 Kudos
Message 9 of 25
(5,644 Views)

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?

Bill
CLD
(Mid-Level minion.)
My support system ensures that I don't look totally incompetent.
Proud to say that I've progressed beyond knowing just enough to be dangerous. I now know enough to know that I have no clue about anything at all.
Humble author of the CLAD Nugget.
Message 10 of 25
(5,638 Views)