LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Application all panels run when opened, even if set to not do that.

LabVIEW 8.5 Application builder.
Issue with front panels, loading, then running automatically. 
I have 5 main UI front panels in the application. I want 1 panel to run when opened, the other 4 to only run when Technician actually has the panel prepped and configuration of the channels complete. We also sometimes run just 2 panels and the others are minimized or closed or a combo of the panels, this has never been an issue until this last upgrade to 8.5. The "run when open" box is unchecked in the VI properties. In the build spec, the "use VI properties" box is checked so it should not run when opened, yet VI still runs when opened. These VI's are installed on target machine with application builder installer. In the forum several options are explained to work around, but why do I have to "work around" anything, if the box is unchecked, why is it still loading and running? Do I have to modify 25 UI panels to include a "run" button and a Wait function loop? This panel is packed and already has too many buttons to find. Is there any better solution to the "run when opened" issue?
Thanks
Scottyd
0 Kudos
Message 1 of 7
(3,377 Views)
Hi Scotty,

there surely is a better option than "run when opened"! In an executable all vis "run when opened" as this is usual behaviour. (Do you have to "start" a word document manually when you open it?) An executable should only have one main vi which controls the subvis!

You should use your vis as subvis in the main vi and set them to "show front panel when called" and "close when finished". That's the standard way.
Next option would be to run all your vis in parallel ("run when opened") and have a wait loop in them. That's also standard procedure.


Message Edited by GerdW on 02-25-2008 04:44 PM
Best regards,
GerdW


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

Thanks for the response.

In the project, the 5 Main VI source files are inserted into the "start up files" box, If I only insert the aquisition.vi as a start up file and the other 4 panels into the support files box, would those 4 front panels load without running? Or Is the load when called function necessary to make those load? would I have to change all UI to add booleans to the aquisition.vi's and then have the technician "load' which panel he wanted to use?`

Thanks for the info

Scottyd

0 Kudos
Message 3 of 7
(3,342 Views)
Hi Scott,

"would I have to change all UI to add booleans to the aquisition.vi's and then have the technician "load' which panel he wanted to use?"

Either this way or you have to have a button in each subvi labeled "accept actual settings" (or similar). Or just call those subvis when needed. Or... (many other options)

Point is: in an executable each vi is (automatically) set to "run when opened". When you don't want this behaviour you have to put in some waiting loops checking a "Start" button (using an event structure to avoid cpu hogging) - or only call those vis when really needed.

IMHO it's annoying to have 5 windows open when I only need one at a time. Open the subvi's panel only when needed, change&save settings, close subvi... You will either have 4 buttons on your main vi's panel to start those 4 subvis or you may use an enum/ring control to select&call the subvi.


Message Edited by GerdW on 02-27-2008 09:59 AM
Best regards,
GerdW


using LV2016/2019/2021 on Win10/11+cRIO, TestStand2016/2019
0 Kudos
Message 4 of 7
(3,320 Views)

Thanks for the suggestions.

Time permitting I will try these, for now the Techs will have to just turn them off after they load. They have been using these panels for 10 years now and any change to them is met with resistance. They don't understand how upgrading the base LabVIEW program caused their tools to change. I personally don't understand why a check box is that is unchecked in application builder and LabView overrules this just because it wants to, and it never did it before but now it's just the way it is.

anyhow thanks for the help

Scotty

0 Kudos
Message 5 of 7
(3,301 Views)
I wanted to update the community with the resolution to ScottyD's issue. 

In summary, Scott has an application with multiple Startup (top-level) VIs.  Scott needed to build an executable that would contain all of these VIs and upon launching the executable, he needed to open, but not run those startup VIs.  While many can argue this startup sequence is not a good way of creating an application, the fact remains that this is a legacy application that Scott is upgrading from LabVIEW 7.x, and that is what is operators are used to seeing.  Therefore, Scott wanted to make the application as similarly behaved in LabVIEW 8.5 as the previous version of this tool as possible.

There are multiple ways of acheiving this behavior.  The first one that came to my mind when talking to Scott was to use a single top level VI that programatically using VI Server opened the front panels of the multiple startup VIs.  This would have required a code change for Scott, so we tried to avoid that solution.

The second method that Scott actually implemented to acheive his desired behavior was accomplished by digging a little deeper in the executable build specification.  Scott's main complaint was that even though he set in the VI properties that the VIs should not "run when opened", by default, the application builder always overwrites that setting in an executable to cause startup VIs to run immediately.  This is aligned with the explaination from GerdW, you never have to "start" Word.exe when you open a new document.  Most users expect an application to be running when they launch an executable. 

While the application builder does override the "run when opened" setting, it is always possible to override the application builder, except in LabVIEW 8.2, where it requires a little creativity ;).

Below is a screenshot which outlines the procedure to have multiple startup VIs in a LabVIEW 8.5 executable that do not run when opened:



1. Specify multiple startup VIs on the Sources Files page of the application builder.
2. On the Source File Settings page, select each of the start up VIs one at a time and click Customize VI Properties...
3. Notice in the VI Properties dialog, the "Use VI Property" option is unchecked, and "Run when opened" is enabled and checked, thus causing this VI to run when the executable is opened.
4. Uncheck the box causing the "Run when opened".
5. Repeat steps 2-4 for each Startup VI.
6. Rebuild the executable, and now you have the desired (in this case) behavior.

Cheers,


Message Edited by Spex on 03-03-2008 07:58 AM
Spex
National Instruments

To the pessimist, the glass is half empty; to the optimist, the glass is half full; to the engineer, the glass is twice as big as it needs to be has a 2x safety factor...
Message 6 of 7
(3,264 Views)
Thanks again for the help. The key to this solution was to have BOTH boxes unchecked, if the USE VI SETTINGS box is checked and the VI properties is set to not run when opened, the 8.5 override still occurs.
Matt, Many thanks, my Technicians appreciated your efforts in resolving this issue.
Scotty D
0 Kudos
Message 7 of 7
(3,248 Views)