LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

how to have three different output according to different input range

Hello, everyone
 
I have such a situation. There are three output values -5, 0, 5 which are chosen according to the range of input value. If input value is less 3, output -5; if input value is between 3 and 4, output 0; if input value is greater than 4, output 5. How can I make it happen in labview? Thank you all.
Regards
Li
0 Kudos
Message 1 of 8
(3,514 Views)
Hi, Li:
 
   The attached VI should do the trick
 
Eric
0 Kudos
Message 2 of 8
(3,505 Views)

Thank you, Steelston.

Can you attach a picture of the diagram please? I'm using labview 8.0 and couldn't read your version 8.2 properly.

Thanks.

Li

0 Kudos
Message 3 of 8
(3,499 Views)
This should work
0 Kudos
Message 4 of 8
(3,492 Views)
Here's a version 8.0
0 Kudos
Message 5 of 8
(3,486 Views)
Did you know that a single case statement can have ranges? For example, if you have an integer wired to the selector, you can type '..1' as the case value and it will handle everything less than or equal to 1. You can enter 5.. for values equal to or greater than 5. You can enter comma separated values such as '3,4'. If you use this, you should really use integer comparisons as floating point comparisons and computers can lead to unexpected results.
0 Kudos
Message 6 of 8
(3,484 Views)
Ah yes,
 
    Well, that's the old analog designer in me coming out. 🙂 I just went for the obvious.  But your technique is very cool.  I shall definitely put that in my repertoire.  Thanks!!
 
Eric
0 Kudos
Message 7 of 8
(3,476 Views)
Thank you, Steelstone and Dennis.  It really help!
0 Kudos
Message 8 of 8
(3,442 Views)