LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

IF statement

Hi
 
I like to do the following statements in LabVIEW,
IF AoValue<=0.1 THEN
    AoValue1=(AoValue-0.0060)
    ELSEIF (AoValue >0.1) AND (AoValue<0.2) THEN
     AoValue1=(AoValue-0.0035)
ENDIF
 
Pls help with this
 
Thanks
0 Kudos
Message 1 of 7
(3,224 Views)
Hi Veeru,
you can use a case structure to do that.
See the attached example.
 
Mike
0 Kudos
Message 2 of 7
(3,222 Views)
Use "Select.vi" from comparison palette and "And.vi" from boolean palette.
0 Kudos
Message 3 of 7
(3,222 Views)
Thanks Mike and Eugen
 
for ex if i want to do it for some 10 cases ,this program would be too long.
 
Is there any other method
 
Thanks
0 Kudos
Message 4 of 7
(3,203 Views)
Yes, you can use switch-case structure instead of select.vi
 
Remember, you can write e.g. "1..3" for the case "1 to 3", or "..1" for the case "less than 1"
 
But you can't connect a double to the case-selector and compare doubles with decimal points, integers only.
0 Kudos
Message 5 of 7
(3,189 Views)

You can connect many data types to the question mark of a case structure.  You can connect a string, an enum, an error wire, boolean.  Here are examples:

 



Message Edited by tbob on 06-11-2008 09:47 AM
- tbob

Inventor of the WORM Global
Message 6 of 7
(3,143 Views)
Thanks tbob
0 Kudos
Message 7 of 7
(3,111 Views)