ni.com is currently experiencing unexpected issues.
Some services may be unavailable at this time.
02-19-2010 01:02 PM
Solved! Go to Solution.
02-19-2010 01:14 PM
My mother taught me never to down load anything unless I trust the source.
Well how else am I supposed to reply to a post like this?
Please post some words that tempt us into helping out.
Ben
02-19-2010 01:16 PM
02-19-2010 01:17 PM
Sorry, for the missing text...
I'm having a problem with System Exec.vi.
I modified a MIL-STD-1553 PCMCIA adapter program originally written in C++ as a command line executable program to output the results of the self-test to a text file called "SelfTest.out".
When I run the program "modified.tester.exe" in command prompt window it runs fine and outputs the file as intended.
I use the following statement at the prompt, with arguments as shown, to run the program:
d:\temp4\modified.tester 2 0
However when I try to run it using the System Exec.vi the command prompt window flashes briefly but the program does not output the "SelfTest.out" file.
I've tried running it using the following statements cmd.exe /c, cmd /c, and command.com /c prior to the path statement above but still do not get the proper output file.
Any help would be appreciated.
02-19-2010 01:40 PM
In general, when using System Exec.vi you should be sure to specify the working directory (ie. the path to your executable) in the VI. Your command line should then simply be the executable name and parameters. To read the file, just build the path using the working directory plus the name of the file you output.
In this case it looks like "d:\temp4\" should be the working directory. The command line should be 'modified.tester 2 0'
02-19-2010 02:06 PM
Darin,
Thanks for the quick reply. I just tried your suggestion but, unfortunately, it didn't work.
In fact I've tried it, and numerous other variations of inputs and settings (wait till completion t/f...., run minimized t/f..., ect.) all to no avail.
It almost seems as if System Exec.vi doesn't pass the command properly or times out prematurely.
In trouble shooting this problem I've tried putting a pause statement in the C++ code for the "modified.tester.exe" program prior to the program's final return statement. When run in a command prompt window, the command prompt would display "press any key to continue" to force the user to manually hit a key to close the window. A "SelfTest.out" file would then be created.
However, running that same program from the System Exec.vi, would open the command prompt window with no text displayed, and when any key was pressed the window would close but no "SelfTest.out" file would be created.
02-19-2010 02:09 PM
bat files are far away and long ago but
How about using a bat file and adding an extra carrige return?
Ben
02-19-2010 02:37 PM
I think that Bat Man (aka Ben) has a good idea. I was a bit ahead of myself, the working directory will specify where the file is written, the full path to the executable must be specified in the command line.
Works for me (other than the fact that the text file says there was some registry error).
02-19-2010 02:43 PM
That did it. Thanks.
I needed to include the full path in the command line to get it working right.
The error in the text file is a normal indication. Since you don't have the specific PCMCIA 1553 adapter card or the drivers for it loaded on your system it will return an error.
Thanks again,
Paul