LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Run an executable with static user inputs in Labview

Hello,

I need to run an executable called RawPack.exe in Labview that uses consistant user inputs.

 

For example, the exe will always ask the following questions in the cmd window:
1. Adapter number?

2. Sender IP Address?

3. Sender Port?

4. Receiver IP Address?

5. Reciever Port?

 

The resonse to these will always be:
1. 3

2. 128.254.0.1

3. 5001

4. 128.254.0.2

5. 5001

 

I can use System Exec.Vi to run the executable but I would like the the program to automatically put in those inputs when prompted.
How can I do this?

 

Alternatively, I have made an input file called "input.txt" that lists the 5 inputs.

By typing "RawPack.exe < input.txt" in the cmd window, the program runs automatically without needing user prompts.
I tried this in the System Exec.Vi "command line" but it gives me an error saying file is not found.

 

Please help.

0 Kudos
Message 1 of 5
(2,473 Views)

Try putting a CMD /C in front of it.

 

ie. "cmd /c RawPack.exe < input.txt"

0 Kudos
Message 2 of 5
(2,468 Views)

I did, that doesn't work.

0 Kudos
Message 3 of 5
(2,449 Views)

You may want to use a virtual keuboard to generate keystrokes. Take a look at this: http://zone.ni.com/devzone/cda/epd/p/id/4509 🙂 and here is the Windows API information http://msdn.microsoft.com/en-us/library/ms646304.aspx 

 

This may also Help: http://decibel.ni.com/content/docs/DOC-4957 🙂

Sam S
Applications Engineer
National Instruments
0 Kudos
Message 4 of 5
(2,430 Views)

Create a BAT file that works. Then call this BAT file from System Exec.

I had to do this unreleated to LabVIEW and I don't remember the issues why...

 

Felix

Message 5 of 5
(2,413 Views)