Weird. I get nothing under XP when calling from either LV2009 or 8.6.1. Maybe this is an XP issue. Can you try this on an XP machine and confirm?
It works fine for me in XP SP3, too. Maybe you need to install/upgrade .NET?
Posted 12 January 2010 - 12:01 AM
Weird. I get nothing under XP when calling from either LV2009 or 8.6.1. Maybe this is an XP issue. Can you try this on an XP machine and confirm?
Posted 12 January 2010 - 12:04 AM
No joy here. I cannot get anything back from the System Exec call. It does open a console window and I can see the output in the window as I press the write buttons but when I choose exit and close the app's window, nothing is returned to the calling LV VI. Do you have anything special in your exe's ini file?
Weird. I get nothing under XP when calling from either LV2009 or 8.6.1. Maybe this is an XP issue. Can you try this on an XP machine and confirm?
Posted 12 January 2010 - 12:09 AM
No joy here. I cannot get anything back from the System Exec call. It does open a console window and I can see the output in the window as I press the write buttons but when I choose exit and close the app's window, nothing is returned to the calling LV VI. Do you have anything special in your exe's ini file?
Weird. I get nothing under XP when calling from either LV2009 or 8.6.1. Maybe this is an XP issue. Can you try this on an XP machine and confirm?
Posted 12 January 2010 - 12:17 AM
Ok, Now I see what I did wrong. I was calling it like this: 'cmd.exe /c "myapp.exe"'.
That does not work. Interestingly, however, something like this: 'cmd.exe /c dir' does return data to the stdout of System Exec. So, again it appears that you can attach to the console of the caller but System Exec is more like the 'run' command. Still does not explain why redirection does not work.
Posted 12 January 2010 - 02:12 AM
So, when calling this from a real console (cmd.exe) you need to use the start command to make the console wait. But, the start command is it's own app so either the AttachConsole does not really attach you to the cmd.exe's console or the GetStdHandle is not the cmd.exe's StdOut. So, redirection fails.Ya, I use the full path of the EXE as the command.
Posted 12 January 2010 - 02:40 AM
Nope. Back to the drawing board...What about using WriteFile instead of WriteConsoleA? That might make the redirection work.
Posted 13 January 2010 - 09:34 PM
Nope. Back to the drawing board...
Posted 13 January 2010 - 10:17 PM
Sweet! This works for me. Only caveat is I cannot call it from the command line using start /wait to force it to wait until completion. However, calling it with "cmd /c myapp.exe" does work, will wait and redirection works too.OK, I got piping/redirection to work.
Posted 14 January 2010 - 07:43 PM
now to try this in my real world application and see if Python likes it!
Posted 06 March 2012 - 04:41 PM
Write Std Out with Redirection.vi for Labview 8.2?Posted 06 March 2012 - 05:27 PM