LabWindows/CVI

cancel
Showing results for 
Search instead for 
Did you mean: 

Making system() call from CVI

I'm trying to call system() from stdlib under CVI and retreive the resulting stdout/stderr messages. I can't seem to get anything but a non-zero output from system() and can't redirect stdout/stderr to a file. Are there any examples for doing this?
0 Kudos
Message 1 of 2
(2,899 Views)
If the application launched by the system command return a value on exit, you will catch that value and that value allone.

You can spool a command output to a file using a ">" redirect. i.e. cathing you IP info in a file you can do this:

ipconfig >ipinfo.txt

The you can read the file "ipinfo.txt" and the file will be generated in the same directory where the app was launched from or in the root of c: To make sure it's in the same place consistantly you can use SetDir (utility library) to set the current active directory.

There might be a better more elegant SDK function that will do what you are trying to do with a commandline application.
Jattie van der Linde
Engineering Manager, Software & Automation
TEL Magnetic Solutions Ltd
Message 2 of 2
(2,899 Views)