Use a Case structure to specify two or more case subdiagrams that execute based on the input value you pass to the structure. Refer to the Case Structure - Selector Data Types VI in the labview\examples\Structures directory for an example of using Case structures.
Complete the following steps to specify values of case subdiagrams when you create a Case structure.
Data Type | Subdiagrams of Case Structure |
---|---|
Boolean | The structure has a True case and a False case. |
Error cluster | The structure has an Error case and a No Error case. You also can use an error cluster to handle errors. |
Integer, string, or enumerated type | The structure can have any number of cases. |
Note By default, string values you wire to the case selector are case sensitive. To allow case-insensitive matches, wire a string value to the case selector, right-click the border of the Case structure, and select Case Insensitive Match from the shortcut menu. |
Tip To convert a tunnel to the case selector, right-click the tunnel and select Replace with Case Selector from the shortcut menu. If the previous case selector is wired, LabVIEW converts the previously wired case selector to a tunnel. You can also use the Replace With Case Selector method to convert a tunnel to the case selector programmatically. |
Note For values of case subdiagrams with a string data type, use backslash codes to indicate backslashes and non-displayable characters. For example, enter \\ to indicate a single backslash and \r to indicate a carriage return. |