annulla
Visualizzazione dei risultati per 
Cerca invece 
Intendevi dire: 

Run a cmd command in LabVIEW with parameters

I have an executable program, for example myprogram.exe, located in "C:\Documents and Settings\myname\myprogram.exe" (I use windows xp 32 bit)

 

When I run the program (by running cmd and type "myprogram.exe > to_text.txt" on the command line), the program will print out the result to that text file.

 

But when I try to run the whole thing on LabVIEW, I can't manage to do so. LabVIEW only supports using the "Run Command" of Windows, not the cmd. (using the SystemExec vi)

 

So how can I run "myprogram.txt > to_text.txt" on LabVIEW as I run it in cmd? Moreover, how can I send the break event (by pressing Ctrl+C in the cmd) by LabVIEW to stop the program?

 

With my appreciations!

0 Kudos
Messaggio 1 di 4
14.645Visualizzazioni
0 Kudos
Messaggio 2 di 4
14.620Visualizzazioni

Often the solution is to initially call the command line interpreter with a subsequent call to the actual program.

So a call to "cmd /C C:\Path\Prog.exe /switch > redirection.log" could help.

For more information on cmd type in a command line window "cmd /?".

Greets, Dave
0 Kudos
Messaggio 3 di 4
14.600Visualizzazioni

I made this a while ago and haven't tested it too much but it should do what you want.  Provide the application path, then the switches in the array.  It does work with built in commands like dir and copy.

0 Kudos
Messaggio 4 di 4
14.579Visualizzazioni