Contains one or more subdiagrams, or cases, exactly one of which executes when the structure executes.
Case Structures behave similarly to switch statements or if-then-else statements in other programming languages.
Value that determines which case to execute based on the input data. The input data can be a Boolean, string, integer, enumerated type or error cluster. The data type you wire to the selector terminal determines the allowed cases you can enter in the case selector label.
|Selector Control||How LabVIEW Creates Cases|
|Ring||Cases match the numeric values of items in the control.|
|Enum||Cases match the string values of items in the control rather than the numeric values.|
|Combo Box||Cases match the string values of items in the control.|
An edit-time error occurs when there are values of the selector data type that do not correspond to any subdiagram in the Case Structure. You must either define a default case to handle out-of-range values or create a case for every possible input value. For example, if the selector is an integer data type and you specify cases for 1, 2, and 3, you must specify a default case to execute if the input value is 4 or any other unspecified integer value.
|Type of Values||Description|
|Numeric ranges||Specify a range as 10..20, meaning all numbers from 10 to 20 inclusively.|
|Open-ended numeric ranges||Specify a range as ..100, meaning all numbers less than or equal to 100, or 100.., meaning all numbers greater than or equal to 100.|
|Lists and ranges||Use commas to separate values, for example ..5, 6, 7..10, 12, 13, 14.|
|String ranges||A range of a..c includes all strings beginning with a or b, but not c. String ranges are case sensitive. For example, a range of A..c behaves differently than a..c because LabVIEW uses ASCII values to determine a string range.|
|Enumerated values||The values display in quotation marks, for example "red", "green", and "blue". However, you do not need to type the quotation marks when you enter the values unless the string or enumerated value contains a comma or range symbol ("," or ".."). In a string value, use special backslash codes for non-alphanumeric characters, such as \r for a carriage return, \n for a line feed, and \t for a tab.|
Where This Node Can Run:
Desktop OS: Windows
FPGA: All devices (only within an Optimized FPGA VI)