Entering Values for Each Case Structure Subdiagram

LabVIEW 2018 Help


Edition Date: March 2018
Part Number: 371361R-01
View Product Info

DOWNLOAD (Windows Only)


LabVIEW 2015 Help
LabVIEW 2016 Help
LabVIEW 2017 Help
LabVIEW 2018 Help
LabVIEW 2019 Help

You can enter a single value or lists and ranges of values in the selector label of a Case structure, as shown in the following table.

Type of Values Description of Type of Values
Numeric ranges Specify a range as 10..20, meaning all numbers from 10 to 20 inclusively.
Open-ended numeric ranges Specify a range ..100, meaning all numbers less than or equal to 100, and 100.. represents 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. When you enter values that contain overlapping ranges in the same case selector label, the Case structure redisplays the label in a more compact form. The previous example redisplays as ..10, 12..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.

If you change the data type of the wire connected to the case selector of a Case structure, the Case structure automatically converts the selector label values to the new data type when possible. If you convert a numeric value, for example 19, to a string, the string value is “19”. If you convert a string to a numeric value, LabVIEW converts only those string values that represent a number. The other values remain strings. If you convert a number to a Boolean value, LabVIEW converts 0 to False and 1 to True, and all other numeric values become strings.

If you enter a selector label value that is not the same type as the object wired to the case selector, the value appears red. This indicates that the VI will not run until you delete or edit the value.

Note  Because of the possible round-off error inherent in floating-point arithmetic, you cannot use floating-point numbers as selector label values. If you wire a floating-point value to the case selector, LabVIEW rounds the value to the nearest integer. If you type a floating-point value in the selector label, the value appears red to indicate that you must delete or edit the value before the structure can execute. You also cannot use fixed-point numbers as selector label values. If you wire a fixed-point number to the case selector, the VI appears with a broken Run button.

WAS THIS ARTICLE HELPFUL?

Not Helpful