LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

multiple comparision

Solved!
Go to solution

Hi all

 

I have 3 numerical input variables. I have to check wheather the  individual variables lie in a particular range. After getting yes or no confirmation of the 3 variables,based on the resulting condition a particular message will be displayed. There are atleast 6 different cases and messages to be displayed.

 

please help me with a way to proceed into this.

can i have i case structure with all the outputs in it to display for the different cases...but how can i give the case selector then?

 

thank you !!Smiley Happy

0 Kudos
Message 1 of 5
(3,109 Views)

Just wire the array of three element to "in range and coerce" and set the comparison limits (either scalar or arrays of three elements). You'll get an arry of three booleans. Convert that array to an integer using "boolean array to number". Use the number to index into an arry of possible messages.

 

If you need more detailed code, wire the integer to a case selector and create cases for each possible value.

0 Kudos
Message 2 of 5
(3,095 Views)

thank you sir..

 

but the ranges also changes. so i'll have to use more than one 'in range' . then to use case structure to display different messages, the input for different cases will be coming from more than one 'in range'...or i'll have to use multiple case selectors

0 Kudos
Message 3 of 5
(3,081 Views)
Solution
Accepted by topic author 6hari9

6hari9 wrote:

but the ranges also changes. so i'll have to use more than one 'in range' . then to use case structure to display different messages, the input for different cases will be coming from more than one 'in range'...or i'll have to use multiple case selectors


Why? If you feed an array of three elements, and use arrays of three elements for the lower and upper limits, you should be all set. The comparisons will be element by element. You get a boolean array out, one for each af the three comparisons.

 

If the three values are scalar, built them into an array first.

0 Kudos
Message 4 of 5
(3,077 Views)

thank you sir

 

I hadnt considered of giving array values to range.. Smiley Happy

0 Kudos
Message 5 of 5
(3,063 Views)