LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

How do I return Labview errors from a LV executable when calling from another application?

I'm calling a third party executable under WindowsXP. The program returns an exit code when complete. I tried Sys Exec VI, but the 'return code' field does not seem to grab the exit code. Help.
0 Kudos
Message 1 of 3
(2,773 Views)
Hi Steve,

Are you calling another third-party executable in LabVIEW and trying to catch its return code using System Exec.vi? Are you certain that the executable returns an error code? My experience has been that executables don't have return codes... Can you check this by calling the .exe from command line?

You can also see if you can get to the return code from the "standard output" and "standard error" outputs of System Exec.vi.

Also, it seems like there is another Discussion Forum posting with the exact question that you might find helpful: Discussion Forum: "Return Code of a Labview Standalon
e Executable"


Good luck!

Kileen C.
NI
0 Kudos
Message 2 of 3
(2,773 Views)
Although I am not fully verse in this subject, I have to disagree because of previous experiences I had.

You can write executables that return "exit codes". For example, in C++ you can use the function exit(). The syntax of the function is:

#include
void exit(int status);

"status" is provided for the calling process as the exit status of the process. Typically a value of 0 is used to indicate a normal exit, and a nonzero value indicates some error.

In the past I've seen commercial applications that allows you add your own functions. Sometimes what the application expect is an exit code after your custom .exe executes.

Unfortunatelly, I've been unable to do this with LabVIEW, therefore I must use another development environment
such as MS VC++ or Borland C++ Builder to accomplish this. I wish I could do that with LabVIEW though...

Enrique
www.vartortech.com
0 Kudos
Message 3 of 3
(2,773 Views)