01-29-2019 06:24 AM
Hi,
my program is set to NOT run when opened, the checkbox in VI Properties/Execution is unticked. If i run it on my pc with the Labview programming environment it does exactly as told. However running it on a pc with Labview runtime it starts as soon as I open the application.
Is there another setting that I'm missing?
Best regards
Michael
01-29-2019 07:11 AM
In the application builder in the category 'Source File Settings', you can overwrite the VI properties.
Afaik, the application builder sets 'Run when opened' automatically for the startup VI. But you can customize the VI properties in the application builder yourself.
01-29-2019 08:33 AM
Hi Michael,
Is there another setting that I'm missing?
Yes: you miss how executable behave in general!
Do you need to click a "Run" button in Word or Excel? Do you need to start the execution of your favorite web browser after calling its exe? The answer is NO - because all executables "run when opened"!
So you should design your VI to be used as an executable…
01-29-2019 08:42 AM
@UliB wrote:
In the application builder in the category 'Source File Settings', you can overwrite the VI properties.
Afaik, the application builder sets 'Run when opened' automatically for the startup VI. But you can customize the VI properties in the application builder yourself.
Aha! I never knew this (I was happy to have my applications automatically run when clicked -- I didn't want the User to have to know about the Run Arrow, and certainly not about the Stop icon next to it.
So I went looking for where this is. In LabVIEW 2017, it is "well hidden". I guessed it would be in "Source File Settings", but didn't see it. After looking everywhere else, I came back to "Source File Settings", noticed I could select the Startup VI, and then click the "Customize VI Properties ..." button, which reveals an Execution section with "Run when opened" checked, over-riding "Use VI Properties". Click to turn off the Check Box.
Bob Schor
01-29-2019 10:33 AM
@GerdW wrote:
Hi Michael,
Is there another setting that I'm missing?
Yes: you miss how executable behave in general!
Do you need to click a "Run" button in Word or Excel? Do you need to start the execution of your favorite web browser after calling its exe? The answer is NO - because all executables "run when opened"!
So you should design your VI to be used as an executable…
I would agree with this wholeheartedly, but LabVIEW is a unique bird. It started out life with no such thing as an executable; the source code was the only way to run a LabVIEW program. Therefore, I can kind of make a case for wanting to run a LabVIEW executable in the same manner you would run a LabVIEW top level VI in the development environment. However, I've never felt the urge to do this.
01-29-2019 10:52 AM
@billko wrote:I would agree with this wholeheartedly, but LabVIEW is a unique bird. It started out life with no such thing as an executable; the source code was the only way to run a LabVIEW program. Therefore, I can kind of make a case for wanting to run a LabVIEW executable in the same manner you would run a LabVIEW top level VI in the development environment. However, I've never felt the urge to do this.
That case was possibly valid 10 years ago. But in modern times, it doesn't hold water anymore.
01-29-2019 12:16 PM
A built application should run automatically, initialize itself, and go to the idle state. It should be closed with the [X] in the upper right, which triggers cleanup code and termination.
01-29-2019 12:29 PM
I didn't say it was a strong case.
01-29-2019 12:52 PM
On the flip side, VIs that open as "run when opened" in the development environment are even more annoying. It would easily be possible to post malicious code here and "run when opened" could do some real damage.
To address it, there is this idea, for example. Any VI located for example in the "downloads" folder should never run when opened.