10-16-2013 04:19 AM
Hi,
we have a big LV-project with some "conditional disabled" or with a "switch" unused VI's. But LabVIEW still tries to load them when building an application (even when they are not used). Is there a setting to prevent this behavior? Something like "ignore unused/missing VI's during built"?
Thanks
Peter
10-16-2013 12:12 PM
When you say "Conditional Disable", do you mean you are putting the VI in a case structure, with a "F" boolean constant wired to the empty case?
If this is so, you should use the Disable structure instead.
10-16-2013 02:25 PM
You can define custom symbols in your project properties to use in the Conditional Disable structure. I don't know if that helps you any.
10-16-2013 02:40 PM
conditionally disabled structures conditions are evaluated at runtime. Therefore, the "Disabled" code case cannot be removed during compile and must be loaded unbroken for the callers to compile correctly.
10-17-2013 01:59 AM
Ok, I understand;
So there is no way to prevent LabVIEW to load really not used (conditional disabled...) VI's during a build?
Maybe for future version?
Peter
10-17-2013 05:39 AM
10-17-2013 08:25 AM - edited 10-17-2013 08:26 AM
@JÞB wrote:
conditionally disabled structures conditions are evaluated at runtime. Therefore, the "Disabled" code case cannot be removed during compile and must be loaded unbroken for the callers to compile correctly.
I don't think that's true. If it is evaluated at runtime that would mean the compiled code must contain the code from all conditions. This can't be true since the code for some (unused) conditions can be broken and it will still work.
The condition is evaluated at design time. When changing a disable symbol it will recompile the code.
10-17-2013 10:40 AM
The difference is disable structure and Conditional disable structure. unconditionally disabled code can be broken as it cannot run. Compare that to a case driven by a constant- the unreachable code is removed by the optomizer in certain conditions (We won't guess what conditions prohibit this optomization and it has been changeing a lot since 8.6 to 2013 I imagine it will continue to evolve) however, Because the optomization is not garanteed to occurr the unreachable code cannot be broken. This is simillar to the conditional disable symbols- they are not evaluated untill runtime and the condition may depend on variables external to LabVIEW. So, all cases must be compilable.
@ Mike- Yup, I believe those symbols values CAN be manipulated external to the app instance (Certainly App.Kind comes to mind). I don't have any experience doing that.
10-17-2013 10:50 AM - edited 10-17-2013 10:50 AM
OK, let me rephrase my earlier post:
Unused cases in a conditional disable structure can contain broken code and the VI is still executable. I have that all the time, e.g. for VIs that can run both on RT and Host and use target specific functionality. So NOT all cases must be executable. The disable symbols thus CAN'T change during runtime.
App.Kind has nothing to do with disable structures. How would you link the two?
10-17-2013 02:38 PM
I think some of the pre-defined symbols are evaluated at runtime. For example "RUN_TIME_ENGINE".
But cases for custom symbols that you define yourself can contain broken code and still compile OK. I do this all the time as well.