LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Why does compiled (EXE) VI run when you double-click the icon even though I un-checked "Run When Opened"?

My VI code uses the VI's that came with the NI  USB-8451  USB-to-SPI converter.  Before compiling I needed to use one of those VI's to select the particular USB device that I'm trying to address, then I click the Run button.  But after I compile my code into an EXE file, and then double-click the executable file it immediately starts running without allowing me to select the USB device - even though I un-checked the "Run When Opened" box.  In fact I also un-checked the Show Menu Bar and Show Scroll Bars boxes as well, yet it shows both of them.  What am I doing wrong?
0 Kudos
Message 1 of 5
(3,076 Views)

It seems silly to start and stop a built LabVIEW application from the toolbar. A complete application should always run and have the LabVIEW toolbar hidden. A user of you code is not supposed to be familiar with LabVIEW mechanics.

You should do all this in code. Really!

Do a nice state machine with at least two states. (1) a state for where the device has not been entered and is simply waiting for your input, and (2) another state that verifies your device input and hands it to the rest of the code for afterwards.

 

Still, what LabVIEW version do you have. Did you set the "run when openend" setting in the application builder for the desired VI or just in the VI itself?

 

0 Kudos
Message 2 of 5
(3,068 Views)

I already have a state machine with about a dozen states.  The 8451's sub-VI's require that you connect something called a "Device Reference" to one of their inputs.  They (meaning NI) provide a sub-VI that does nothing but output the Device Reference.  Note that the Device Reference comes from the MAX tool (or at least its alias does, since I entered the alias).  Regardless, the problem is that the Device Reference sub-VI puts a control input on the front panel.  When I compile to an EXE it's grayed-out, so it doesn't matter what kind of a state machine you use - the user can't enter anything.

Fortunately someone suggested that I change it from a Control to a Constant.  And that solved the problem although it still doesn't allow the user to change the device that is being driven!

0 Kudos
Message 3 of 5
(3,056 Views)
I have the same problem. I have a lot of legacy test programs that I support. The are a number of front panel switch settings that need to be set before the test executes depending on the product being tested. They have worked from version 6.0 thru 8.01 but with the 8.2 compiler I can not find a way to compile a stand alone executable that doesn't run when opened??
0 Kudos
Message 4 of 5
(3,020 Views)

Hi Kirshme,

This was reported to R&D (# 40HEDDJG) for further investigation.

A workaround for this setting is tot go to the Advanced page of the build specification and check "Enable debugging" and "Wait for debugger on launch". One side effect is this will include the block diagrams of the VIs and extra code for debug tool support.

Here is a link that contains workarounds to several known issues in LabVIEW 8.2.

Hope this helps!

Kalin T.
0 Kudos
Message 5 of 5
(2,998 Views)