取消
显示结果 
搜索替代 
您的意思是: 

Getting the return code of an exec-called program

I'm trying to simply call an .EXE (Win32 console-) application from LabView 5, which works fine with EXEC. The problem is, that I cannot query the return code of the program afterwards. (The error output is always 0, no matter what the program has returned.) Anyone knows a nice short solution to that? Thanks!
0 项奖励
1 条消息(共 8 条)
4,048 次查看
ritter,

What exactly are you trying to do.

I believe that the outputs of the system exec are strictly for dataflow purposes.

Try looking at the help file for the system exec function for more information.

Good luck.
0 项奖励
2 条消息(共 8 条)
4,048 次查看
I call an .EXE that returns with 0 when everything is ok and exits with an error code != 0 when there was an error. And I would like to get this error code (that can be queried with errorlevel in DOS) into LabView. (The info about exec didn't help me with that.)
0 项奖励
3 条消息(共 8 条)
4,048 次查看
Hi ritter,

I'll take a try at this one (as I cover my head).
1)How about wiring to the standard output?

2)How about redirecting(piping) the output to a text file and checking it there?

Let us know if these are not appropriate ideas,

Ben
Retired Senior Automation Systems Architect with Data Science Automation LabVIEW Champion Knight of NI and Prepper LinkedIn Profile YouTube Channel
0 项奖励
4 条消息(共 8 条)
4,048 次查看
Hi Ben,
The problems in the called .EXE arise (usually) from the file system. Thats why I would not like to make the communication to LabView also file system dependent.
Taking the standard output of the .EXE directly into LabView would be a solution. But how do I do that? Can I get the output of the program right into LabView? Into a string?
Thanks anyways!
0 项奖励
5 条消息(共 8 条)
4,048 次查看
Hi Ritter,

Somehow I think I may be missing something.
(after looking around)
What version of LV are you using?
I am guessing 5.1 or earlier.
LV 6 EXEC has standard output available.

If you are using LV 5.1.1 or so, I can only recomend the the re-directed solution.
If file system is issue how about using a complete file spec starting with "c:"? Do you expect to be running on a machine that does not have a c drive?

Ben
Retired Senior Automation Systems Architect with Data Science Automation LabVIEW Champion Knight of NI and Prepper LinkedIn Profile YouTube Channel
0 项奖励
6 条消息(共 8 条)
4,048 次查看
You're right, we're using LV 5.1. And I guess there's really no more soffisticated solution than using some temp file... 😞
0 项奖励
7 条消息(共 8 条)
4,048 次查看
Well, in that same line, you may want to look at the following examples:

How to Run an Executable with Options from LabVIEW

Programmatic ping Implementation

At least, they can provide you with some guidance.

Best regards;
Enrique
www.vartortech.com
0 项奖励
8 条消息(共 8 条)
4,048 次查看