I have thought of that. One thing I do not like about it is diagram space, the other I do not know. In a compiled application is only the enabled part kept? Is it seen as a conditional? I have a global that can enable disable the debugger VIs but there are still calling and returning times along with loading VIs into memory. I guess I'm trying to make my application as lean as possible, but the return is probably not worth the effort.
I was curious about whether or not it still in memory and checking the condition each time. After some Google searching I was unable to find anything... so I decided to test it.
After spending way longer than I should have trying to find a way to determine if a VI is in memory as part of a compiled application without my method of determining if it is in memory placing it in memory... the short answer is no. If a VI is compiled as part of a conditional disable structure the VI is never actually placed in to memory.
Thanks for your effort!!
Edit: @BowenM tried to give you multiple kudos, but it erased the previous one, then I gave another, hopefully it went through.
I would agree with BowenM Conditional Disables with Conditional Disable Symbols setup in the Project Properties is the preferred way to toggle debugging code. I do this all the time with simulated versus actual hardware.
One caveat to BoewnM's statement is that VIs in Disabled Diagrams are not built into executables unless you build with debugging enabled. Then they will be included. To ensure it is disabled, in the application builder window, go to the Advanced section and make sure it is not checked.
Thanks for the advice. Just to be clear, this is also true for conditional disable structures? See below.
EDIT: Just checked. It works!! Thanks.
One more thing. You can setup your own symbols in the Project Properties. Below I setup one as DEBUG_MODE with a value of True.
Then in your Conditional Disable Structures your symbols will show up.
This Conditional Disable Structure has a case for True and for False with False also being the default. This is cool because this applies everywhere in your project. You can have Conditional Disable Structures everywhere you need one and then to toggle them all, just set the value in the Project Properties by double-clicking the value and typing a different value. When building make sure you have them set to the one you want it built with. The disabled ones won't be included as long as the Debugging check is off (as I stated earlier).