ni.com is currently undergoing scheduled maintenance.

Some services may be unavailable at this time. Please contact us for help or try again later.

LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

case structure

Solved!
Go to solution

Hey 

Im having some issues with my case structure. I need it to do one type of calculation if a value is 0 and another if the value is above 0 (below zero isnt possible as it is for humidity control).

 

Added are the two cases i've made.

 

The error message i get is "Case structure 'case structure': selector values are not unique. The details are: A selector value is used by more than one case.  It may be in the middle of a range in one of the cases.

 

Might seem a bit silly but its been a while since ive used the program so any help would be appreciated.

 

Download All
0 Kudos
Message 1 of 6
(3,277 Views)
Solution
Accepted by Tinglev

Hi Tinglev,

 

that's an easy one:

You have two ranges defined: "..0" and "0..". Those ranges are inclusive of limit values so you will have the value "0" in both cases! That's why you get a "not unique" error message!

 

Hints:

- Don't use floating point numbers for case selector input, they get rounded to integers as can be seen by the red dot. It will bite you in the ass sometimes...

- In your case a simple ">0" comparison before the case structure will do what you need...

Best regards,
GerdW


using LV2016/2019/2021 on Win10/11+cRIO, TestStand2016/2019
Message 2 of 6
(3,260 Views)

I'm with GerdW.  You should just use the >0 function for you case selector.



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
Message 3 of 6
(3,253 Views)

You can't assign the same variable status to different selection.

in two png i can see the 0 value in both cases.

0 Kudos
Message 4 of 6
(3,252 Views)

Thanks for the help that solved my problem. 

0 Kudos
Message 5 of 6
(3,245 Views)

All you probably need to do is remove the "..0" from the default case and only leave the word "default" in it. 🙂

 

This scenario is exacly one of the reasons why I was proposing this idea. Please vote for it if you agree. 😄

0 Kudos
Message 6 of 6
(3,240 Views)