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

Creating Case Structures

LabVIEW 8.5 Help
August 2007

NI Part Number:
371361D-01

»View Product Info

A Case structure executes one subdiagram depending on the input value passed to the structure.

Complete the following steps to create a Case structure.

  1. Place a Case structure on the block diagram.
  2. Wire an input value to the selector terminal to determine which case executes. You must wire an integer, Boolean value, string, or enumerated type value to the selector terminal. You also can wire an error cluster to the selector terminal to handle errors. If you wire an error cluster to the selector terminal, the True case becomes the No Error case and the False case becomes the Error case.
  3. Place objects inside the Case structure to create subdiagrams that the Case structure can execute. If necessary, add or duplicate subdiagrams. If the data type of the selector terminal is Boolean, the structure has a True case and a False case. If the selector terminal is an integer, string, or enumerated type value, the structure can have any number of cases.
  4. For each case, use the Labeling tool to enter a single value or lists and ranges of values in the case selector label at the top of the Case structure. For lists, use commas to separate values. For numeric ranges, specify a range as 10..20, meaning all numbers from 10 to 20 inclusively. You also can use open-ended ranges. For example, ..100 represents all numbers less than or equal to 100, and 100.. represents all numbers greater than or equal to 100. For string ranges, a range of a..c includes all strings beginning with a or b, but not c. A range of a..c,c includes the ending value of c.
  5. (Optional) If necessary, specify a default case.

Resources


 

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