LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Don't want LabVIEW application to run on startup of .exe.

I'm creating an executable in LabVIEW 8.2.  I don't want the LabVIEW application to run when the executable is started.  I have the "VI Properties\Execution\Run when opened" box unchecked.  I have tried all possible combinations of checking/unchecking the "Source File Setting \ Run When Opened" boxes in the Build Specification as well.
 
Is there a way to build the .exe so the application won't run until the user selects the run arrow?
0 Kudos
Message 1 of 12
(9,509 Views)
what version of labview are you using?
Paul Falkenstein
Coleman Technologies Inc.
CLA, CPI, AIA-Vision
Labview 4.0- 2013, RT, Vision, FPGA
0 Kudos
Message 2 of 12
(9,501 Views)

I just compiled a application using 8.0 today with the run on opened under the buildscript to use a value of false and have no issues.  The exe opens under an non run state and waits for the run arrow.  I am pretty sure I have done this with the app builder in 7.1 and 7.1 I dont remember about prior to 7.0 (I havent used >7.0 in a few years and removed 4.0 5.0 6.0 and 6.1 from my machine so I cant verify this).

 

Paul

Paul Falkenstein
Coleman Technologies Inc.
CLA, CPI, AIA-Vision
Labview 4.0- 2013, RT, Vision, FPGA
0 Kudos
Message 3 of 12
(9,500 Views)

Oops 8.2.  I can check on this later.  Is there a bug in 8.2 app builder.

Paul

Paul Falkenstein
Coleman Technologies Inc.
CLA, CPI, AIA-Vision
Labview 4.0- 2013, RT, Vision, FPGA
0 Kudos
Message 4 of 12
(9,498 Views)
Changing the property of the vi is not enough. You'll have to change it in the vi properties settings in the executable (just like Falkpl said): under the build script). LabVIEW by default overrules this property there, because usually it makes no sense not to start the application automatically.


Regards,


Wiebe.
Message 5 of 12
(9,473 Views)
Hi all,

We have a listing of known upgrade issues associated with 8.2 located in the KnowledgeBase article LabVIEW 8.2.x Upgrade Issues, including an issue where VI settings saved in a build specification are ignored while building the application.  This has been fixed in the recently released 8.2.1 version of LabVIEW, which all SSP customers can download from the Services Resource Center.  The KB article also mentions a simple workaround if using the 8.2.1 update is not possible for you, which is to select both the "Enable Debugging" and "Wait for debugger on launch" options on the application's Build Specification properties dialog.  Doing this will give your users the behavior you are looking for, though it will make your executable larger by including extra debugging code.
Cheers,

Matt Pollock
National Instruments
0 Kudos
Message 6 of 12
(9,404 Views)

Here is a solution NI gave me.

You can create a case structure around the whole block diagram of the application.

1. Create a while loop around that case structure.

2. Wire a True constant to the stop terminal so the while loop only runs

once.

3. Create an uninitialized boolean shift register on the while loop.

4. Wire the left shift register to the input of the case structure (making

sure the customer's code is in the True case) and wire a True constant to

the right shift register.

The VI will run for a split second as soon as the exe is launched, but noneof the customer's code will be executed. Every time after that, the exe will run as expected when the user presses the run arrow.

Brian
Message 7 of 12
(9,385 Views)

Hi,

 

I am having the same problem; my .exe starts running at startup even though the "Run when opened" checkbox is unchecked. I did not follow the buildscript tip. What is this and how do I find and change it?

 

 

I am building a controller that will write to and read from a programmable power supply. I was really looking for a way to add a "Start measurement" button in the VI so that my measurements would not start until this was pressed, even though the VI was running. However, I have not figured out a way to do this yet, does anyone have any suggestions?

 

Thanks!

 

Clara

0 Kudos
Message 8 of 12
(9,004 Views)

Clara –

When I asked this question almost 2 years ago, I knew ways to make things in the program not run until a button was selected – I was more just being lazy and asking the folks at NI “you have this button, so why doesn’t it work?” because it would have saved me a bit of time.

From a programming and user standpoint, it is better to have the program start running when the .exe is selected and then have your program/user control when particular portions of code (functions) are enabled.  One simple way to achieve this is to place the code (your measurement code) into one case of a case structure with two cases (true and false).  Then wire a button (your “Start Measurement” button) to the input of the case statement.  As the program is running, the button can be pressed once to enable the measurements, and then pressed again to disable the measurements.

Another way is to make two while loops.  In the first while loop, place a button (your “Start Measurement” button) so that the program will remain in the first while loop until the button is pressed.  Place the code (your measurement code) into the second while loop.  Make sure there is a wire connecting the two loops so the second loop will not run until the first loop is stopped with the button.  The second while loop can be stopped any way you wish (including the “Start Measurement” button).

Brian McLean also suggested a good approch to this in an earlier post in this thread if you didn't already see it:

"Here is a solution NI gave me.

You can create a case structure around the whole block diagram of the application.

1. Create a while loop around that case structure.

2. Wire a True constant to the stop terminal so the while loop only runs

once.

3. Create an uninitialized boolean shift register on the while loop.

4. Wire the left shift register to the input of the case structure (making

sure the customer's code is in the True case) and wire a True constant to

the right shift register.

The VI will run for a split second as soon as the exe is launched, but noneof the customer's code will be executed. Every time after that, the exe will run as expected when the user presses the run arrow."

Keep in mind that there are probably a million other ways to do this, but the main idea is to somehow isolate the code you want to turn on/off, and then figure a way to control its activation/deactivation.

- Jim
Message 9 of 12
(8,965 Views)

Hi Clara,

 

If an acceptable solution has been posted, please go ahead and give the poster credit by marking it as so and giving out kudos. 

 

Thanks!

 

Marti C
Applications Engineer
National Instruments
NI Medical
0 Kudos
Message 10 of 12
(8,946 Views)