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: 

How do I set control values in an executable

I'm creating a log in screen that asks for info (user name, serial number, part number) then locates an executable on the network and opens it.  I use the System Exec.vi to open the executable, but the problem I am having is I need to pass the log in info into the executable.  That way when the executable finishes and writes the data to excel, the info can also be sent to excel.  Note:when the executable opens, it isn't running, which is how I want it.  Originally I was using the invoke node and Set Control Value method when it wasn't an executable, but a vi.  How can I do this for an executable?  Also, currently the log in screen is a vi, but will probably end up as an exectuable as well.
0 Kudos
Message 1 of 6
(2,697 Views)
You have to add the application property Application:Command Line Arguments to a VI in order to pass in arguments from System Exec. There's a shipping example called CommandLine.vi that shows how it's done.

Message Edited by Dennis Knutson on 07-26-2006 11:19 AM

0 Kudos
Message 2 of 6
(2,695 Views)
I looked over the examples but I'm having a problem getting it to work.  To open a test executable called 123456.exe I send the following command line into the System Exec.vi
 
 
In the exe I have the property node with Command Line Arguments and an indicator.  I'm able to locate the exe and open it, but the "test" string doesn't appear on the indicator.  Nothing is in the indicator.  I've tried slightly different syntaxes and different types of controls, but can't get anything to work. 
0 Kudos
Message 3 of 6
(2,676 Views)
I don't think your '' marks are in the right place. I just made a simple example and pasted "c:\junk\example.exe -- hello" into the command line input of sytem exec without any '' marks and it worked just fine. Why don't you post the VI you created?
0 Kudos
Message 4 of 6
(2,672 Views)
I've attached the command vi and the vi form of the executable.  I tried to attach the executable also, but got an error that it had the wrong extension type. 
Thanks for all of your help.
Download All
0 Kudos
Message 5 of 6
(2,666 Views)
Try putting c:\Main\USERS\ewilliams\123456.exe -- /string:test into the string. No quote marks. I built your example and it works like that.
0 Kudos
Message 6 of 6
(2,659 Views)