08-13-2010 02:00 PM
Hi ,
I am new to LabVIEW executable, and I have the following questions based on the simple example below.
I created the executable, and deployed it . Now I have the following issues:
1. When the user clicks the executable file, the programs starts running immediately, but I would expect the user to be able to click the run button, before the program starts running.
2. As a follow up, can I use a boolean control to start the VI, hence can I program the VI such that clikcing the boolean button will be equivalent to clicking run at the top of the VI.
Thank you.
08-13-2010 02:22 PM
There are many VI properties that can be changed when creating executables. 'Run when Opened' is one that defaults to TRUE. In the Build Specifications you can set them anyway that you want.
08-13-2010 02:41 PM
Quote from this old thread:
"A built application is designed for the end-user, and the end user should not have to learn LabVIEW specific operations such as the RUN button.
Just design your code so the program starts up in a wait loop where all controls can be changed, then add a button that swtiched to the more interesting parts of the program. "
Or here:
"Since you cannot edit a built executable, "running" is the only useful state. All other programs on your computer (browser, word processor, etc.) all run when opened, so why should a LabVIEW application be any different? Right?!"
Now go and modify your program not to be a CPU hog (e.g. by placing a small wait inside the loop or using an event structure).
08-13-2010 03:24 PM - edited 08-13-2010 03:28 PM
@NIquist wrote:
There are many VI properties that can be changed when creating executables. 'Run when Opened' is one that defaults to TRUE. In the Build Specifications you can set them anyway that you want.
Having said that... There ARE conventions that SHOULD be followed. See above post .^. [And I really should have mentioned that turning off 'Run when Opened' will have all your users calling you up to say your program doesn't do anything. The "Run Arrow" WILL be a source of confusion unless they're LabVIEW savvy.]
One common technique is to use a custom run-time menu. Your program (VI) starts up when opened but then just waits (using an Event Structure) for the user to pick a menu option such as: Load New File... or Start Test Sequence. You can decide what's in the menu and what runs when the menu choices are clicked.