LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Selector for every case

Hi,

 

I've created a case structure where I have a 32-bit integer (coming from an index array) as the selector values.  The selector values range from 0 to 1720.  The input tunnel is a 2-D array of single 32 bit numbers.  I'm performing a simple multiplication by a constant on the 2-D array, inside the structure, and then sending it on its way to the output tunnel of the structure. 

 

I've created several cases and set a default case as well for any selector value that doesn't fall within my specified cases.  I keep getting this error now: Every case in a Case structure must have at least one selector value that selects it.  Firstly, I really can't have a case and just have it not be selected if it's selector value doesn't come up?  Secondly, in the "set" of 32-bit integer selector values that come through, all of the cases are covered!  So, I'm not sure why this error is coming up. Am I missing something?

 

Thanks

 

-James

 


0 Kudos
Message 1 of 13
(3,909 Views)

@JPKelly662 wrote:
The selector values range from 0 to 1720.

 

I've created several cases and set a default case as well for any selector value that doesn't fall within my specified cases.

 



Does your default case actually implement "Default" or did you simply handle every other value from 0 - 1720 that is not explictly handled in another case? The case structure MUST handle every possible value possible from the 32-bit interger. The easiest way to do this is to add an additional case and right click the case structure and choose "Make this the default case".

Charles Chickering
Architecture is art with rules.

...and the rules are more like guidelines
0 Kudos
Message 2 of 13
(3,906 Views)

I actually made an extra case, right clicked, and chose "Make this the default case".

0 Kudos
Message 3 of 13
(3,904 Views)

could you post the code?

Charles Chickering
Architecture is art with rules.

...and the rules are more like guidelines
0 Kudos
Message 4 of 13
(3,902 Views)

I can try.  It's a small section of a much larger, very complex code.  What is the easiest way to post the code?

0 Kudos
Message 5 of 13
(3,897 Views)

Just create a simple copy of the VI you are having troubles with and post that.



Mark Yedinak
Certified LabVIEW Architect
LabVIEW Champion

"Does anyone know where the love of God goes when the waves turn the minutes to hours?"
Wreck of the Edmund Fitzgerald - Gordon Lightfoot
0 Kudos
Message 6 of 13
(3,893 Views)

Attach the VI directly

Charles Chickering
Architecture is art with rules.

...and the rules are more like guidelines
0 Kudos
Message 7 of 13
(3,892 Views)

Unfortunately, I don't think I'm allowed, by my company, to post the entire VI. I will ask.  In the meantime, I've attached the case structure.

0 Kudos
Message 8 of 13
(3,883 Views)

You need a bit more than that. You should at least leave the control that is wired to the selector. A borken wire is pretty useless to see what is going on. However, it is complaining about the empty cases.



Mark Yedinak
Certified LabVIEW Architect
LabVIEW Champion

"Does anyone know where the love of God goes when the waves turn the minutes to hours?"
Wreck of the Edmund Fitzgerald - Gordon Lightfoot
0 Kudos
Message 9 of 13
(3,879 Views)

There were a couple of cases in the structure that didn't have any way to handle them. That is what is causing your problems, you cannot have a case in a case struct that doesn't have a value assigned to it. This code cannot be accessed and LabVIEW won't allow that.

 

Charles

Charles Chickering
Architecture is art with rules.

...and the rules are more like guidelines
0 Kudos
Message 10 of 13
(3,877 Views)