LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Another case question

How do I control what is in a case statement from the front panel?

Suppose I have an integer and I wish to check that it lies within the
range -6 to +6 but that 6 must be programed from the front panel so I
can change it to 7 say or any other integer?

thanks

Tom
0 Kudos
Message 1 of 3
(2,653 Views)
Hi Tom,

You can use the "In Range and Coerce" Function from the comparison palette. This will give a TRUE if the x input is within the range set by the upper and lower limits. You can select whether to include the limit values and use the boolean output to select the case required. Example attached..

Hope this helps,

Nick
0 Kudos
Message 2 of 3
(2,653 Views)
Hi,

Cases are static structures, and cannot be changed during runtime.

You'll have to check for criteria before the case, and wire the results to
the case. In your case, wire the 6 or 7 to the "In Range" function and the
negated 7 (= -7) to the second input. this will return a true or false. You
can also take the absolute value of x, and test it against 7 (|x|<=7), if
the range is symetrical around 0.

Regards,

Wiebe.


"Tom" wrote in message
news:3F94A9E8.754C6786@nOpam.com...
> How do I control what is in a case statement from the front panel?
>
> Suppose I have an integer and I wish to check that it lies within the
> range -6 to +6 but that 6 must be programed from the front panel so I
> can change it to 7 say or any other integer?
>
>
thanks
>
> Tom
>
>
0 Kudos
Message 3 of 3
(2,653 Views)