From Friday, April 19th (11:00 PM CDT) through Saturday, April 20th (2:00 PM CDT), 2024, ni.com will undergo system upgrades that may result in temporary service interruption.

We appreciate your patience as we improve our online experience.

LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Run EXE/Write To File Within a batch file

I am looking to do the following within a batch file:

1. Start Running an EXE I created in LabView

2. Write The EXE LabView boolean pass/fail output to a file

 

Is this possible?  Thanks!

0 Kudos
Message 1 of 2
(2,093 Views)

1. Yes of course. Just add the executable to your batch file like any other exe.

2. A little tricker. Currently LabVIEW doesn't currently provide a way of setting the exe Exit Code in an executable (it is on Idea Exchange here). You could write to the stdout stream in your exe and then pipe this to a file via cmd script but this requires a bit of work (and unmanaged calls).

 

I'd suggest the best way would be for your LabVIEW exe to write the result to the file directly on disk rather than just exposing the value(s) on the connector pane. If you need your batch script to customise the filename, you could pass a command-line argument to your exe specifying such. 

Message 2 of 2
(2,086 Views)