Home› Programming
Discussion
Back to discussions page
sebastianrea
Posts: 11 Apprentice
Assign different values to a variable UR10 |
66 views
|
Answered | |
/ Most recent by sebastianrea
in Programming
|
7 comments |

Hi community
I have made a program for my UR-10 where the operator can enter different values, respectively 44, 46, 48 and 50. This input changes a distance the robot travles in the program. If the operator enters a different values, for an example 40, the robot will not do as attended. However the robot will still run the program.
I need to stop the program if the values 44, 46, 48 or 50 isnt entered at the start up of the program.
i already made an if task that says:
If travel_distance≠active_distances
-stop program
active_distances are my 4 values 44,46,48 and 50, but how do i bind them correctly to the variable.
if i where to write:
active_distances: 44 or 46 or 48 or 50 in the command task
the program stops anyway when i try to start the program with one of the values entered in the start
How can i do this? and is there a better way to do it?
- Sebastian

I have made a program for my UR-10 where the operator can enter different values, respectively 44, 46, 48 and 50. This input changes a distance the robot travles in the program. If the operator enters a different values, for an example 40, the robot will not do as attended. However the robot will still run the program.
I need to stop the program if the values 44, 46, 48 or 50 isnt entered at the start up of the program.
i already made an if task that says:
If travel_distance≠active_distances
-stop program
active_distances are my 4 values 44,46,48 and 50, but how do i bind them correctly to the variable.
if i where to write:
active_distances: 44 or 46 or 48 or 50 in the command task
the program stops anyway when i try to start the program with one of the values entered in the start
How can i do this? and is there a better way to do it?
- Sebastian
Best Answers
-
matthewd92 Founding Pro, Tactile Sensor Beta Testers Posts: 1,267 Handy
-
sebastianrea Posts: 11 Apprentice
matthewd92 said:You can also try length([1,2,3,4]) depending on your version the get_list_length may not be a supported API call.
Matt
And it gives me an error message when it gets to
If value=acitveDistances[i]
What could be wrong? or is it simply because i cant copy it to my CB3
I suppose "if value=distance[i]" is not working because you have to use the equal with the question mark.