New in LabVIEW 8: Diagram Disable Structure
Overview
Many LabVIEW users have often requested the ability to "comment out code." Similar to traditional text-based languages, they wanted to prevent one section of their code from running while other portions executed. The new Diagram Disable Structure in LabVIEW 8 makes this easy.
Description of the Diagram Disable Structure
The main concept behind this new feature is the ability to create sections on a VI's diagram where code will not be included in the compiled form of the VI. This is different from using a Case Structre and wiring a false into the case you don't want to execute. LabVIEW will now "dead-strip" any code that is not to be executed. "Dead-stripping" essentially means that when a VI compiles it does not include any code that is in an inactive frame. The 'disabled' frame of a Diagram Disable Structure is one example of where this would occur.
When a VI is loaded with user-defined objects (subVIs, typedefs, etc…) that are in the 'disabled' frame of a Diagram Disable Structure, LabVIEW will not load those objects into memory. However, once a user shows the block diagram of the VI, LabVIEW will then attempt to load those objects. LabVIEW will report a warning if it cannot find the objects, which will not cause the VI to break, as the code is dead-stripped when compiled.

How to use the Diagram Disable Structure
To drop a Diagram Disable Structure:
1. On the block diagram you can drop a Diagram Disable Structure from the structures palette.
2. Place code you do not wish to be included when the VI runs in the 'Disabled' frame.
3. Create additional frames by right-clicking on the border of the Diagram Disable Structure and selecting one of the options provided:

4. Only one frame can be Enabled. To enable a particular frame, right-click on the border of the Diagram Disable Structure and select Enable This Subdiagram...:
Reader Comments | Submit a comment »
Legal
This tutorial (this "tutorial") was developed by National Instruments ("NI"). Although technical support of this tutorial may be made available by National Instruments, the content in this tutorial may not be completely tested and verified, and NI does not guarantee its quality in any way or that NI will continue to support this content with each new revision of related products and drivers. THIS TUTORIAL IS PROVIDED "AS IS" WITHOUT WARRANTY OF ANY KIND AND SUBJECT TO CERTAIN RESTRICTIONS AS MORE SPECIFICALLY SET FORTH IN NI.COM'S TERMS OF USE (http://ni.com/legal/termsofuse/unitedstates/us/).
