06-12-2015 12:15 PM
Hello.
I am having difficulty with making a case structure that if a numerical input is greater than a number it does one thing and less it does another.
Basically how do you work with case structures that aren't boolean, specifically if a number is greater than 38 it reassigns it as 0 (multiplies by zero something like that).
Solved! Go to Solution.
06-12-2015 12:39 PM - edited 06-12-2015 12:41 PM
@Neil_Helsel wrote:
Hello.
I am having difficulty with making a case structure that if a numerical input is greater than a number it does one thing and less it does another.
Basically how do you work with case structures that aren't boolean, specifically if a number is greater than 38 it reassigns it as 0 (multiplies by zero something like that).
You can use range in a case structure selector field. Use 38.. for greater than or equal to 38, ..38 for less than or equal to 38. You need to use integers for this.
EDIT you can also use the greater than operator if you just have 2 possibilities.
Ben64
06-12-2015 12:39 PM
You can type "..38" in the case structure text which mathematically means ]-inf,38]
06-12-2015 12:44 PM
http://zone.ni.com/reference/en-XX/help/371361H-01/lvhowto/case_selector_values/
Or use the boolean logic you are talking about. If you use a greater than on your number and it is greater you will get a true and if it is not greater than it will be false. You could even use the in range function (comparison pallete) to get a true or false.
Or give more information about what you are trying to do. The more info you give, the better answer you will get. Otherwise we have to guess why you are trying to do it the way you are asking when there could be a better way.
06-12-2015 12:49 PM
Use an Integer connected to the case selector. You must have a default case and values such as 36 ... or 0.. 35 and -1, as default. would be less than 0 is default, 0-35 is a case and 36 and greater is a case.
06-12-2015 12:50 PM - edited 06-12-2015 12:50 PM
This is definitely the better way to do whatever it is you want to do. Even though you said no boolean.