LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Batch file problems

Hello all,
I think I have a misbehaving batch file, probably not a LV problem.  The issue is when trying to run a batch file from labview using the "System Exec.vi" I do not get the output form the .bat file in labview.  The .bat file returns it's output in the dos shell.  I have tried file redirection to a .txt file and that does not work either from LV8.01 "System Exec.vi" or  the DOS shell.so I am thinking maybe something can be done to the batch file itself to correct the problem.  I have attached the batch file.
Shell example: GetVerInfo Sw version: v17.05 

Press any key to continue . . .

  Labview result: Microsoft Windows XP [Version 5.1.2600](C) Copyright 1985-2001 Microsoft Corp. C:\Documents and Settings\Kmeinhardt\Desktop\Batch Files\V1705\Common>GetVerInfo  Press any key to continue . . .  

C:\Documents and Settings\Kmeinhardt\Desktop\Batch Files\V1705\Common>

 

 

 

File redirection output:

 

Press any key to continue . . .

 

The batchfile is attached and is quite simple.  It seems that labview is not capturing the batch file output due to latency. Regards,Karl
0 Kudos
Message 1 of 4
(6,251 Views)

Hi Karl,

i can run your batch file, but i get an error because i don´t have the program or what ever i need. But if i call it with labview a can see the "press key ..." message. Maybe the error messages won´t be printed if calling from LabVIEW.

 

Hope it helps.
Mike

Message 2 of 4
(6,240 Views)

How are you calling the batch file? If you create a simple batch file that contains a single command such as "echo he", and then call it using System Exec this way:

 

the string output displays:

 

Message Edited by smercurio_fc on 08-24-2008 03:15 PM
Message Edited by smercurio_fc on 08-24-2008 03:15 PM
Download All
Message 3 of 4
(6,220 Views)
Hi Mike,
So it looks like the "GetVerInfo.bat" file is calling another batch file which calls an executable named "SendMail.exe" and passes arguments to it.  Somehow the "SendMail.exe" communicates serially to the device and returns output to the shell in a nonstandard way since file redirection does not work with this batch file.
regards,
Karl
0 Kudos
Message 4 of 4
(6,184 Views)