05-05-2020 05:15 AM
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
05-05-2020 11:59 AM - edited 05-05-2020 12:03 PM
(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?
05-05-2020 04:32 PM
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
05-05-2020 04:49 PM - edited 05-05-2020 04:52 PM
@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.
05-05-2020 04:49 PM
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.
05-06-2020 04:59 AM
Thank you very much. I was able to solve the problem as there were duplicate values in the case structure.
Thank you every one
05-06-2020 12:35 PM
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.
08-07-2024 10:04 PM
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.
08-08-2024 12:39 AM
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?
08-08-2024 06:12 AM
@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?