Diagram Disable Structures in LabVIEW 8

Publish Date: Nov 26, 2018 | 17 Ratings | 3.65 out of 5 | Print

Overview

In text-based code language, users have the ability to comment-out code, or prevent sections of their code from running. Many LabVIEW users also want the ability to prevent sections of their code from running while other portions of their code execute. As of LabVIEW 8, you can run select portions of your code by using the Diagram Disable structure.

1. Getting Started with the Diagram Disable Structure

You can use the Diagram Disable structure to disable sections of code on the block diagram. In Diagram Disable structures, you can specify areas where LabVIEW does not compile and run code with various Disabled frames. Because Diagram Disable structures only disable code, you cannot use conditions with Diagram Disable structures. If you would like to run a portion of code under certain conditions, use the Conditional Disable structure, or use a Case structure to wire a Boolean value into a case. Note that, unlike with a Case structure, you do not have to wire all of the output terminals in a Diagram Disable structure.

When a VI contains user-defined objects, such as subVIs or typedefs, within the Disabled frame of a Diagram Disable structure, LabVIEW does not load the user-defined objects into memory. However, when a user displays the block diagram of the VI, LabVIEW attempts to load the user-defined objects. LabVIEW reports a warning if it cannot find the objects, but this does not cause the VI to break since the Diagram Disable structure disables the specified code when it compiles.



Back to Top

2. Using the Diagram Disable Structure

Complete the following steps to use the Diagram Disable structure:

  1. Select the Diagram Disable structure from the Structures palette and place it on the block diagram
  2. Place code you do not want to run in the Disabled frame of the Diagram Disable structure.
  3. Create additional frames by right-clicking the border of the Diagram Disable structure to display a shortcut menu. Select one of the available options from the shortcut menu:



  1. You can only enable one frame at a time. To enable a particular frame, right-click the border of the Diagram Disable structure and select Enable This Subdiagram from the shortcut menu.



For more information about Diagram Disable structures, refer to the following topic in the LabVIEW Help: Disabling Sections of the Block Diagram.

Back to Top

Bookmark & Share


Ratings

Rate this document

Answered Your Question?
Yes No

Submit