LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Case structure:Selector values are not unique

Error.PNG

Hi Everyone,

I am sai and currently working on a project with LabVIEW. I have come across an error that says "A selector value is used by more than one case. It may be in the middle of a range in one of the cases".

 

I am working with a vi that controls the motion of the controllers, there are two controllers one for the x-axis and another for the y-axis. There are around 20 cases in the vi, I am unable to detect the error because when I run the project, it redirects to the error in whichever case I am working with.

 

Any help would be highly appreciated.

 

Thank you

0 Kudos
Message 1 of 10
(2,807 Views)

(This is a LabVIEW programming question, and does not belong in the motion-control forum. I'll move it).

 

The error message is very clear. You have overlapping ranges in a case structures. Are you saying that the VI is originally not broken and that the error only occurs at runtime? (Not sure what you mean by "run the project").

 

If you double-click the error, which case structure is highlighted?

 

An example of overlap would be if one case is "1..6" and another case is "5". Now "5" belongs to two different cases at once, which is not allowed.

 

Can you attach your VI?

Message 2 of 10
(2,768 Views)

Thank you for your reply. 

When I double click on the error, the whole Vi is being highlighted, for instance, if I am working with case 2, and if I double click on the error it redirects case 2, same with case 3,4...20. The error always redirects to the case I am currently on.

 

I have created this Vi in my PC and it does not show any error and It shows the error once I connect it to the motor/driver (even if I run the project or do not run the project)

 

I am trying to move the x-axis and y-axis sequentially(using a flat sequence) with a single command(button). Is this error because of this? 

 

 

Thank you

 

0 Kudos
Message 3 of 10
(2,731 Views)

@sai.jee wrote:

Thank you for your reply. 

When I double click on the error, the whole Vi is being highlighted, for instance, if I am working with case 2, and if I double click on the error it redirects case 2, same with case 3,4...20. The error always redirects to the case I am currently on.

 

I have created this Vi in my PC and it does not show any error and It shows the error once I connect it to the motor/driver (even if I run the project or do not run the project)

 

I am trying to move the x-axis and y-axis sequentially(using a flat sequence) with a single command(button). Is this error because of this? 

 

 

Thank you

 


You're going to have to be ultra-focused and find out where the values overlap.  With twenty or so cases, you're going to have to be very diligent to find the case(s) where the values overlap.

 

I'm afraid I don't understand something here.  This particular error cannot be there sometimes and sometimes not.  Not unless you are editing the values.  If that's what's happening, I don't think anyone can help you.  You will just have to be careful that your edits are valid.

Bill
CLD
(Mid-Level minion.)
My support system ensures that I don't look totally incompetent.
Proud to say that I've progressed beyond knowing just enough to be dangerous. I now know enough to know that I have no clue about anything at all.
Humble author of the CLAD Nugget.
Message 4 of 10
(2,714 Views)

No.  A flat sequence is not going to cause this problem.

 

Look at the drop down of all your cases.  Somewhere you have a value that is duplicated between them.  It may not be obvious.

 

If you attach your VI, even if it is only a VI with that case structure in it, I bet we'll find it in a minute.

Message 5 of 10
(2,713 Views)

Thank you very much. I was able to solve the problem as there were duplicate values in the case structure.

 

Thank you every one

0 Kudos
Message 6 of 10
(2,672 Views)

You stuck with it and found the overlap.  Sometimes you just have to make yourself sit there and stare at it until you finally figure out where your overlap was.  It's not easy.  I've fought this battle many, many times, myself.

Bill
CLD
(Mid-Level minion.)
My support system ensures that I don't look totally incompetent.
Proud to say that I've progressed beyond knowing just enough to be dangerous. I now know enough to know that I have no clue about anything at all.
Humble author of the CLAD Nugget.
0 Kudos
Message 7 of 10
(2,639 Views)

I am facing this same issue and was wondering how you managed to resolve this error. As it is saying my selector values are not unique and I just added case after 2 times to get a total of 3 cases.

0 Kudos
Message 8 of 10
(377 Views)

Hi Prantheman,

 


@Prantheman wrote:

I am facing this same issue and was wondering how you managed to resolve this error. As it is saying my selector values are not unique and I just added case after 2 times to get a total of 3 cases.


Simple solution: remove this 3rd case that you created to resolve this error!

 

You do the same error as the OP: you don't provide any code so we cannot tell you what you did wrong!

 

What are the selector values for your 3 cases?

Best regards,
GerdW


using LV2016/2019/2021 on Win10/11+cRIO, TestStand2016/2019
0 Kudos
Message 9 of 10
(369 Views)

@Prantheman wrote:

I am facing this same issue and was wondering how you managed to resolve this error. As it is saying my selector values are not unique and I just added case after 2 times to get a total of 3 cases.


So what's your Case definitions?

G# - Award winning reference based OOP for LV, for free! - Qestit VIPM GitHub

Qestit Systems
Certified-LabVIEW-Developer
0 Kudos
Message 10 of 10
(352 Views)