Company Events Academic NI Developer Zone Support Solutions Products & Services Contact NI MyNI

Creating Conditional Disable Structures

LabVIEW 8.5 Help
August 2007

NI Part Number:
371361D-01

»View Product Info

A Conditional Disable structure executes one subdiagram depending on the configuration of the condition, which can include the platform and other user-defined symbols. If you use the Conditional Disable structure in a LabVIEW project, you can create and define symbols using the Conditional Disable Symbols page. If you use the Conditional Disable structure in a VI outside of a LabVIEW project, TARGET_TYPE is the only symbol available.

Complete the following steps to create a Conditional Disable structure.

  1. Place a Conditional Disable structure on the block diagram.
  2. If you are using the structure in a LabVIEW project and you want to create and use conditional disable symbols, complete the following steps. If you are not using the structure in a LabVIEW project, skip to step 3.
    1. Select Project»Properties to display the Project Properties dialog box.
    2. Select Conditional Disable Symbols from the Category list to display the Conditional Disable Symbols page.
Note  You can create and configure conditional disable symbols that are specific to a target by right-clicking the target in the Project Explorer window and selecting Properties from the shortcut menu. You then can select Conditional Disable Symbols from the Category list to display the Conditional Disable Symbols page.
  1. Enter a name for the symbol you want to create in the Symbol text box. You might choose names for the symbols to indicate the function they perform.
  2. Enter the value you want the symbol to represent in the Value text box.
  3. Click the Add button to add the new symbol to the conditional disable symbols list.
  4. Click the OK button to close the Conditional Disable Symbols page. You now can use the symbols you just defined in the Conditional Disable structure.
  1. Right-click the structure border and select Edit Condition For This Subdiagram to display the Configure Condition dialog box.
  2. Select a Symbol and enter a Value for the symbol.
Note  TARGET_TYPE is the only symbol available if you use the Conditional Disable structure in a VI outside of a LabVIEW project. If you use the Conditional Disable structure in a LabVIEW project, you can define additional symbols using the Conditional Disable Symbols page. Refer to step 2 of this procedure for more information about creating conditional disable symbols.
  1. (Optional) Click the plus sign to add another condition. For example, if you want the subdiagram to apply to multiple platforms, such as Windows and Mac, you can set the Value of the TARGET_TYPE symbol to Windows in one condition, click the plus sign, select the OR operator, and set the Value of the TARGET_TYPE symbol to Mac in the second condition.
  2. Click the OK button.
  3. Place objects inside the Conditional Disable structure to create subdiagrams that the Conditional Disable structure can execute. If necessary, add or duplicate subdiagrams.
Note   If you want to disable a section of code on the block diagram so that it does not compile at runtime, use the Diagram Disable structure. Right-click the border of the Conditional Disable structure and select Change to Diagram Disable Structure from the shortcut menu to switch to a Diagram Disable structure.

Refer to the Conditional Disable Structure VI in the labview\examples\general\disable structures\ directory for an example of using Conditional Disable structures.


Resources


 

Your Feedback! poor Poor  |  Excellent excellent   Yes No
 Document Quality? 
 Answered Your Question? 
Add Comments 1 2 3 4 5 submit