LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Case structure 1.. or ..0 and no default value

Probably an easy one for most of you: Could you explain how this case selector works? It seems to me that it just check if the value is different than zero. If so, why not simply use the comparison vi? This is the first time I see a case selector that will work without a default value.

Thanks in advance.
0 Kudos
Message 1 of 3
(3,984 Views)
It doesn't make much sense with a constant wired to the selector but with a variable, you hve one case that handles 0 or anything less, and the other case handles 1 or anything greater. With an integer wired to the selector, the cases handle all possible input values so there is no need for a default. A case statement with a Boolean for a selector is the same way. A True case and a False case cover all possibilities so there is no default case required.
0 Kudos
Message 2 of 3
(3,984 Views)
Thank you Dennis. The constant wired to the case was for the example and I agree with you it doesn't make sense. I forgot that also Boolean selector don't require default case but I'm please to learn a new way to quickly treshold a value. Thanks again !

Martin
0 Kudos
Message 3 of 3
(3,984 Views)