LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

calling *.exe

I have an executable file (*.exe) that I want to run through Labview. This exe asks for few input parameters when I run it through DOS prompt, How can I input them through a labview interface.

The exe code writes a few excel files; I also want to read those files and plot them automatically when i run the application through Labview. I want to know how I can go about that issue too.
0 Kudos
Message 1 of 5
(3,558 Views)
Peeru,
You can call the program using "System Exec" in the communication pallette. That VI allows you to enter the commandline with input parameters, just like you would in a DOS prompt.

If the file is something like a plain text tab delimited file, and not a true Excel file, you can read it into an array using "Read from Spreadsheet File" in the File I/O pallette. However, if the file has header information, you may need to do a little more work to get at the data.
Message 2 of 5
(3,555 Views)

As mentioned:  You can call the program using "System Exec" in the communication pallette. That VI allows you to

enter the commandline with input parameters

, just like you would in a DOS prompt.......

 

Would you please show an example of entering input parameters?

Thank you.

0 Kudos
Message 3 of 5
(3,260 Views)
Hi Camu,

just do a search for "System Exec" here in the forum. There are so many threads on this topic and you will easily find posts explaining how-to-do this!
Have you tried to give a command like "dir c:\"? Have you tried a batch-file instead of the raw command?

Message Edited by GerdW on 09-21-2007 09:23 AM

Best regards,
GerdW


using LV2016/2019/2021 on Win10/11+cRIO, TestStand2016/2019
0 Kudos
Message 4 of 5
(3,246 Views)


@Camu wrote:

As mentioned:  You can call the program using "System Exec" in the communication pallette. That VI allows you to

enter the commandline with input parameters

, just like you would in a DOS prompt.......

Would you please show an example of entering input parameters?


I have a hunch that the OP has a program that interactively wants the user to enter values in the DOS screen before doing something useful. There are only two possibilities for this. Either the command line executable allows to specifiy the necessary parameters as optional command line parameters and then System Exec will work.

Or you need to have some sort of standard IO redirection where you can make the standard input and output of a console program being directed to some form of LabVIEW communication stream. I have developed something like this in the past using pipes and put the code on OpenG as pipes module but haven't gotten around to test it to a point where I would feel comfortable to put it out as OpenG package. So if you want to tinker with it you can go and grab the VI library and DLL at http://opengtoolkit.cvs.sourceforge.net/opengtoolkit/pipe/source/ and play with it. As stated already it has worked for me in the past but I can't guarantee that it will for you nor your specific console program and it is not likely I could do a lot of work on this in the immediate future. 

Rolf Kalbermatter

Message Edited by rolfk on 09-21-2007 10:03 AM

Rolf Kalbermatter  My Blog
DEMO, Electronic and Mechanical Support department, room 36.LB00.390
0 Kudos
Message 5 of 5
(3,242 Views)