LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

How do I create an executable with arguments that executes once and terminates

I'm just starting with LabView, so I'm sure this issue has been address somewhere already.  I just can't locate the answer.
 
 
I am running version 6i (I may be able to get 7 or 8).
 
I need to create a command line executable program with parameter input that executes only once and then terminates.
 
This is for instrument control (sets the signal generator frequency, level, RF on/off and arms the Trigger).  I have written a simple VI that works from within LabView (programs the instrument when the Run button is pressed).  I have further managed to perform an Application Build to create an executable however, the application continues to run, waiting for the Run button to be pressed.  Also, I need to know how to pass parameters to this executable (freq, level, RF on/off, trigger arm).
 
This executable will (eventually) be called repeatedly by a Matlab file.
 
Thanks,
D
0 Kudos
Message 1 of 5
(3,145 Views)
LabVIEW 7 added a property to get a command line argument. For older versions see http://sine.ni.com/apps/we/niepd_web_display.display_epd4?p_guid=B45EACE3DA5B56A4E034080020E74861.
 
I'm not sure I understand you problem with the Run button. If you set the execution mode to Run When Opened from VI Properties, it should execute once whenever it's called. I think that when building an executable, it changes the property to this if it's not already set. If the application does not have this set, it will not be running at all. I'm assuming that you are talking about the Run button on the toolbar and not a run Boolean that you've created on the front panel.
 
Since you have the app builder, your other option is to create a DLL. If you can call a DLL in Matlab, then that would probably be simpler.
 

Message Edited by Dennis Knutson on 11-28-2005 02:46 PM

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

Thanks Dennis, I managed to read the command line arguments.

Now, to explain a little further concerning the Control Panel display.  I only want the VI to run once (preferrably with no Control Panel display) and then close itself without user intervention.

Currently (after I do an App Build), if I run it, it opens the Control Panel and executes immediately, and then the Control Panel display remains on the screen (waiting for the operator to press the Run button on the Control Panel Window tool bar or to Close the program).  I don't have a run button on the inside the user Control Panel.

This VI will be serving a very low level function of setting the signal generator (frequency, amplitude, trigger state output enable state) as called by a Matlab program which is used for a number of other functions on my test bench.  As such, I want there to be no output from this program other than the GPIB commands sent to the signal generator.

Don

0 Kudos
Message 3 of 5
(3,115 Views)
If you don't want the front panel to show up, then building a DLL is the easiest thing to do. If matlab can't call a DLL and you want the panel to close after it's been run, just put a Quit LabVIEW function at the very end of your program. I don't remember what properties were available in 6.0. With 7.0, there's a property called Front Panel Window:State where you can set the window to hidden. For 6.0, you could just set the window position to somewhere off the screen.
0 Kudos
Message 4 of 5
(3,100 Views)

Thanks Dennis.  I used the Quit LabView command and got it working as needed.  I haven't tried the .dll yet.

Don

 

0 Kudos
Message 5 of 5
(3,072 Views)