LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Case Structure

Getting back into labview after a long break.  Have a 2D array that just need to index with buttons to show a particular pump info.  This can't be the most efficient way to do this and not sure why the case structure is giving an error?

0 Kudos
Message 1 of 3
(1,874 Views)

The Last Shall Be First.  Did you click the Broken Arrow and look at the list of Errors?  Do you not understand "Case Structure:  No case for some selector values"?

 

Your Selector is a Boolean.  It has two Values.  How many values are in your Case Structure?  [Hint -- the answer is not 2].  Hence an error.  On the other hand, you, at least, are consistent -- all of your Case Structures have the same Error.

 

LabVIEW Is Not Matlab.  LabVIEW is not C (or C++).  There are tutorials shown on the first page of the Forum.

 

I cannot figure out what you are trying to do -- it makes no sense to me.  Maybe spend a little less time developing a fancy Front Panel (with all of the Labels hidden so we have to "hunt around in the dark" to find the variables you are using) and more time with, maybe, a 2D array of integers and work out the logic that way.

 

BOW_Selected should not be a Float -- it is used as an index to an array.  See the coercion dots?  [Those are the little red dots where the orange wire goes into an input that is expecting "something else"].  They are a "hint" that something might be wrong, or at least "illogical".

 

Bob Schor

 

Message 2 of 3
(1,848 Views)

Thank you Bob.  I added the false case and the error went away.  No other programming language I have used requires that so didn't make sense to me.  The code was meant to just simply be a way to scroll through the array with the first, previous, next and last buttons.  Just seemed like a lot work to implement and figured there was a much more efficient way to do this that I wasn't thinking of.   

0 Kudos
Message 3 of 3
(1,800 Views)