LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

how to select case structure based on ranges, i have 4 ranges i.e 0 to 1000, 1001 to 5000,5001 to 15000,15001 to 30000. here my Question is how can i write a code to select one range from them rendomly

Solved!
Go to solution

Random ranges.png


I am not allergic to Kudos, in fact I love Kudos.

 Make your LabVIEW experience more CONVENIENT.


0 Kudos
Message 2 of 7
(3,177 Views)

Hi srini,

 

here's another method:

check.png

Set the other cases as needed...

Best regards,
GerdW


using LV2016/2019/2021 on Win10/11+cRIO, TestStand2016/2019
0 Kudos
Message 3 of 7
(3,170 Views)
Solution
Accepted by SrinivasB

Gerd's is the easiest way to go.  To clearify, you can create a range for a case in a Case Structure using "..".  So "0..1000" will execute that case for all numbers from 0 to 1000 inclusive.  But also note that the case structure doesn't exactly work with floating point numbers.  It works with integers.  When you wire a floating point to the case selector, it converts it to an integer.  That's just something to keep in mind.


GCentral
There are only two ways to tell somebody thanks: Kudos and Marked Solutions
Unofficial Forum Rules and Guidelines
"Not that we are sufficient in ourselves to claim anything as coming from us, but our sufficiency is from God" - 2 Corinthians 3:5
0 Kudos
Message 4 of 7
(3,153 Views)

Is there any way, I can remove the coercion dot in my example (U8 to enum indicator)??


I am not allergic to Kudos, in fact I love Kudos.

 Make your LabVIEW experience more CONVENIENT.


0 Kudos
Message 5 of 7
(3,146 Views)

@moderator1983 wrote:

Is there any way, I can remove the coercion dot in my example (U8 to enum indicator)??


Check out this idea:Officially Support "Coerce to Type"


GCentral
There are only two ways to tell somebody thanks: Kudos and Marked Solutions
Unofficial Forum Rules and Guidelines
"Not that we are sufficient in ourselves to claim anything as coming from us, but our sufficiency is from God" - 2 Corinthians 3:5
0 Kudos
Message 6 of 7
(3,143 Views)