From Friday, April 19th (11:00 PM CDT) through Saturday, April 20th (2:00 PM CDT), 2024, ni.com will undergo system upgrades that may result in temporary service interruption.

We appreciate your patience as we improve our online experience.

LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Case Structure Ranges Determined From Input Variables

Hello, 

         I am trying to write a vi that will read in a random number, and depending on how close or far away from the intial given value it is, it will do something different to the value using a case structure.(Not positive this is the best way)

 

Ideally I would like to somehow incorrporate the value that is on the front panel from the user, into the different ranges so they are not set. Is there any way instead of using [ ..10, 11..15, 15.. ] I could use the [..(indicator - 5), (indicator-4)..(indicator +4), (indicator +5)..] as my three different cases? Or is that just crazy and I should be trying to use a different type of structure maybe? 

 

 

Thanks in advance for the help, 

 

KT

0 Kudos
Message 1 of 3
(2,223 Views)

What if you would subtract the reference value before wiring to the case structure?

(assuming you are dealing with integers)

0 Kudos
Message 2 of 3
(2,220 Views)

That is brilliant!! Thank you!!

0 Kudos
Message 3 of 3
(2,216 Views)