12-14-2006 12:52 PM - edited 12-14-2006 12:52 PM
Message Edited by BobChuck on 12-14-2006 01:52 PM
Message Edited by BobChuck on 12-14-2006 01:53 PM
12-14-2006 01:04 PM - edited 12-14-2006 01:04 PM
OK, I got it to work by getting rid of "start" in the input command. Also, you should add code to put quotes around the filename. It may work on your computer, then your customer gives it a path that has a space and windows will return an error. I don't have LV 6.0 so I can't save it for you, but here's a picture.
Message Edited by Marc A on 12-14-2006 02:05 PM
12-14-2006 01:17 PM
12-14-2006 01:30 PM - edited 12-14-2006 01:30 PM

Message Edited by BobChuck on 12-14-2006 02:31 PM
12-14-2006 01:59 PM
12-14-2006 02:06 PM - edited 12-14-2006 02:06 PM
It doesn't do the same thing. When I run their batch file manually, the window opens and is empty. It does not change for a few seconds, then it closes. When I run the LabVIEW program calling the batch file, a window opens and displays the text "The system cannot find the file specified". It also sits for a few seconds and then closes.
I realize that it is a small difference, but it is a difference, and I have no way of doing an accurate test short of sending the customer another software load.
I don't have a special batch file for testing. All I have is a copy of the customer's batch file, which goes to thier server and retreives the latest set of data that I process.
Message Edited by BobChuck on 12-14-2006 03:07 PM
Message Edited by BobChuck on 12-14-2006 03:18 PM
12-14-2006 02:18 PM
Hmm, well try making a test file. Just open notepad, write the word "pause" (without quotes), and save it as test.bat. Try opening this with your VI and see what happens. A window should come up that says "Press any key to continue..."
I'm thinking that the message you are getting in the command window is actually from their batch file. Although I understand that it doesn't show up when you run it manually, which is strange.
12-14-2006 03:26 PM
01-08-2013 04:47 PM
Hi,
I have been struggling with a similar issue, my .bat file executes correctly when run directly, however seems to run too fast and doesn't execute correctly when called from LabView.
Tried a simple test.bat containing @pause, and still had the same result.
Issue:
If I run the test.bat directly, the system pauses and a key stroke is required to close the window.
If called from LabView, the cmd window flashes up and disappears...
The same for my other.bat file, which contains code to communicate to a USB device.
When called from LabView, other.bat appears to start, a window flashes up, USB device starts, but the .bat never completes execution...
Solution:
Found that if you set "Wait until completion" to FALSE, the .bat file will execute all the commands correctly, and display in the cmd window, as well as wait for user inputs.
If set to TRUE, the SystemExec will run the .bat file to completion (bypasses all user inputs like @pause) and displays all outputs in the "standard output".
Tim
01-08-2013 08:24 PM
Further to the above post, check the file path in the .bat file when calling from LabView...
.bat file would work fine, but need to add absolute path when calling from LabView.
I had to change this line
"%batch_path%app_name" -b -a 0x2000 -r -f filename.bin
to this absolute path;
"%batch_path%app_name" -b -a 0x2000 -r -f "%batch_path%filename.bin"
Cheers