LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

How can pass data to an exe file build with LabVIEW?

Solved!
Go to solution

I have an application that can launch one or more instances of the same executable using "System Exec" VI, the option "Wait until completion?" false. My problem is that I want to transmit a different value for each instance, to an input parameter. Something like that if you launch notpad.exe, followed by a file name. The executable file is an build application from LabVIEW too.

 

How can I do this?

 

Best Regards,

0 Kudos
Message 1 of 3
(3,390 Views)
Solution
Accepted by topic author Marinica

Passing command line parameters into a LabVIEW application is actually fairly straightforward. 

 

There are 2 things you need to do:

- Modify the LabVIEW exe build specification to pass all command line arguments to application

- Read the App.Args property which returns an array of strings for the parameters - the first parameter is always LabVIEW.exe.

 

For an example:

 

2014-07-28_14-08-44.png

 

Here I read the arguments, ignore the LabVIEW.exe and then read a file path as the first argument and check it exists and there's also an optional "-choose" parameter which determines whether or not to show the UI.

 

Information is here: http://digital.ni.com/public.nsf/allkb/17C3AD70493CE0208625666A00763364

 

 

 


LabVIEW Champion, CLA, CLED, CTD
(blog)
0 Kudos
Message 2 of 3
(3,383 Views)

Thank you very much! It worked very well!

 

Best Regards,

0 Kudos
Message 3 of 3
(3,353 Views)