LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Compiled vi always runs when opened, Labview 2013 bug?

Hello,

 

As has been mentioned, the only real reason to have an exe not begin execution on launch is if you are waiting for the debugger to connect to a debuggable executable. This is a setting in the Advanced section of the Build Specification and is not set on a VI level.

 

The VI property run when opened will affect the behavior of opening your .vi file (not the built .exe file). If a vi is set to run when opened, if you open the .vi  in the development environment it will immediately start running. As a side note, this is an infrequently used setting since it can make it quite annoying to work with or share those VIs. Typically, if you intend a VI to run immediately every time it is called then you are most likely not developing the code in that VI anymore, and you should build an executable. 

 

You mentioned earlier that you wanted the executable to wait for you to enter values before running, which is why you wanted the exe to not run at startup. The behavior of wanting to wait for initial values is quite common, but can be accomplished within the VI itself instead of trying to stop the exe from running on launch. I am assuming you want the behavior of - user launches exe, user enters values, user presses run button to start program executing, program processes user input and does something and then outputs results.

 

Code an initial state where you are waiting for the user to enter inputs. Add some kind of Run or Start Test button to your front panel, and then wait for that button to be pressed before you start the rest of your code.

 

This has a few additional benefits:

You can return to your initial state to run a new test without the user having to restart the exe.

Your user doesn't have to 'start' the exe, it is always running when it is open.

You can extend the functionality of your front panel to react to the values that your user is entering during the initialization (you can notify them about invalid data for example).

 

Hope that helps,

 

Jeff Peacock 

 

Product Support Engineer | LabVIEW R&D | National Instruments 

Message 21 of 23
(555 Views)

To clarify, I'm trying to make a set of VIs adhere to a very specific set of guidelines, and not only the finished, end-user VI but also the components used to build that VI.

 

I am very well aware of the reasoning behind "run when opened", I'm just wondering why this certain option of setting to not running seems not to work. Saying that "it shouldn't work" does not explain why it is there.

 

Lars Melander
Uppsala Database Laboratory, Uppsala University
0 Kudos
Message 22 of 23
(528 Views)

@LarsM wrote:

To clarify, I'm trying to make a set of VIs adhere to a very specific set of guidelines, and not only the finished, end-user VI but also the components used to build that VI.

 

I am very well aware of the reasoning behind "run when opened", I'm just wondering why this certain option of setting to not running seems not to work. Saying that "it shouldn't work" does not explain why it is there.

 


If I hear you correctly you want the vi-properties to be used by the app builder for the start-up vis.  This will not happen.  The app builer properties for the start-up vis will be applied to the exe.  As I demonstrated, you cannot even check the "Use vi property" box for that property for any start-up.vi.

 

This "Saves us from ourselves" when debuging a project prior to building an executable.

 

Mr. Peacock suggests that changing this setting may help debugging an executable.

 

Spoiler
(a use case I had never considered since... I don't write bugs):smileysurprised:

 


"Should be" isn't "Is" -Jay
Message 23 of 23
(494 Views)