LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Program runs when opened (application only)

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

0 Kudos
Message 1 of 9
(2,884 Views)

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.

0 Kudos
Message 2 of 9
(2,869 Views)

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…

Best regards,
GerdW


using LV2016/2019/2021 on Win10/11+cRIO, TestStand2016/2019
0 Kudos
Message 3 of 9
(2,850 Views)

@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

0 Kudos
Message 4 of 9
(2,848 Views)

@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.

Bill
CLD
(Mid-Level minion.)
My support system ensures that I don't look totally incompetent.
Proud to say that I've progressed beyond knowing just enough to be dangerous. I now know enough to know that I have no clue about anything at all.
Humble author of the CLAD Nugget.
0 Kudos
Message 5 of 9
(2,834 Views)

@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.


GCentral
There are only two ways to tell somebody thanks: Kudos and Marked Solutions
Unofficial Forum Rules and Guidelines
"Not that we are sufficient in ourselves to claim anything as coming from us, but our sufficiency is from God" - 2 Corinthians 3:5
0 Kudos
Message 6 of 9
(2,829 Views)

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.

0 Kudos
Message 7 of 9
(2,823 Views)

I didn't say it was a strong case.

Bill
CLD
(Mid-Level minion.)
My support system ensures that I don't look totally incompetent.
Proud to say that I've progressed beyond knowing just enough to be dangerous. I now know enough to know that I have no clue about anything at all.
Humble author of the CLAD Nugget.
Message 8 of 9
(2,818 Views)

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.

0 Kudos
Message 9 of 9
(2,815 Views)