From Friday, April 19th (11:00 PM CDT) through Saturday, April 20th (2:00 PM CDT), 2024, ni.com will undergo system upgrades that may result in temporary service interruption.

We appreciate your patience as we improve our online experience.

LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

case selector values are not unique

Hello all!

Actually i have state machine. The case selector values are connecting to type definition enum.
Now when i add new state to type definition enum ("Close all" for example), and i want add new case to Case Structure, name of new case don't appear automatically.
If i write it manually, i get next error: "Case: selector values are not uneque".
Any suggestions?
0 Kudos
Message 1 of 12
(6,450 Views)
Are you using any range definitions in the case structure? For example, say you have an enum with five states:

state_1
state_2
state_3
state_4
state_5

and you wanted the same code to be executed for the middle 3 states, you could define one state of your case structure as "state_2..state4". In other words, any enumerated value from state_2 to state_4.

If you now created a state_3a that fell between state_3 and state_4 and tried to create a seperate case for it you would get exactly the error you gave because state_3a is between state_2 and state_4 AND it has it's own case.

You could also see this effect if you had cases defined like "..state_3" or "state_4.." and created a new enumerated value at the end of the type.

Mike...

Certified Professional Instructor
Certified LabVIEW Architect
LabVIEW Champion

"... after all, He's not a tame lion..."

For help with grief and grieving.
0 Kudos
Message 2 of 12
(6,450 Views)
hai,

i had the same problem. i added a state behind the "xxx.." value and got the same error message. for me it worked to replace the case with a sequence and then replace the sequence with a case. after reconnecting the selector everything was fine.

i hope this helps.
cu
Message 3 of 12
(6,450 Views)
Hello

If you've connected a enum control (type definition) to the case selector and you add a new state [Open Type Def.>>add new state>>apply changes and save control (File menu)]. After that you can right click on the Case structure and select "Add Case For Every Value". It will then automatically create a case for every value in the enum control/constant.

Hope this is what you want.

Luca
Regards,
Luca
0 Kudos
Message 4 of 12
(6,450 Views)
hai,

"add case for every value" did'nt worked correct for me. it created all cases but produced the error.

cu
0 Kudos
Message 5 of 12
(6,450 Views)
I'm not sure if this is it, but have you checked that all your enum constants are correctly linked to the typedef?
0 Kudos
Message 6 of 12
(6,450 Views)
yes, all correct.
0 Kudos
Message 7 of 12
(6,450 Views)

After 13 long years, your comment is still valid.  I hope you are still alive to read this.

Message 8 of 12
(4,890 Views)

I want to know if it has been solved after 14 years as I am encountering this problem in 2017.

0 Kudos
Message 9 of 12
(4,628 Views)

@tomsze wrote:

[...] as I am encountering this problem in 2017.


Can you post your VI (and the type def) to show the issue?

Norbert
----------------------------------------------------------------------------------------------------
CEO: What exactly is stopping us from doing this?
Expert: Geometry
Marketing Manager: Just ignore it.
0 Kudos
Message 10 of 12
(4,626 Views)