LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

enum constants

Hi

 

I'm in need of a little help using enum constants.

In my VI i'm using a case structure that is controlled by an enum constant. In my case named "85-94" i need a third option, which is change the case to "0-20 (Start)", if the slide goes below 21.

I've tried several thing, but i cannot figure out how i can do it. 

Anyone got a hint?

 

Thanks

0 Kudos
Message 1 of 2
(2,672 Views)

Here's a slightly different idea -- you have a slider (type DBL) that goes from 0 to 100, and you want to make decision based on the integer values of the slider.  Instead of using an Enum named "0-20 (Start)" as the input to your Case statement, why not take the integers 0 .. 20 as the first Case value?  Recall that a Case statement needs discrete (such as Integers or Booleans, with Enums being "sort-of" integers) values as inputs, and needs to be defined for all possible inputs (hence the first Case might be "0 .. 20, Default", without the Quotes).  So you could either make the Slider an Integer (I32, U32, I8, U8, it hardly matters) or leave it as a DBL and convert it to an integer before wiring it to the Case input.  You'd then simply list the Case elements you want (such as 21 .. 34, 35 .. 44, etc.).  No need for comparisons, Select functions, etc.  [I'm not sure I understand your logic, anyway -- I'm assuming you want to "light the correct light" as the slider changes, right?].

 

Bob Schor
 

0 Kudos
Message 2 of 2
(2,653 Views)