Setting up variable waypoints

Hello!
I am attempting to consolidate multiple very similar machine tending programs into one program. The only difference between each program is essentially two waypoints. I want to have the program prompt the operator to enter in the part number that will be run on the machine and based on that input the two waypoints are changed through the use of variable inputs. Essentially for example if part = X then the waypoint would be [1, 2, 3, 4, 5, 6] and if the part = Y then the way point would be [1, 2, 7, 4, 5, 6].

Every variable assignment method I try just causes the robot to either move forward as far as it can, move upwards as far as it can etc instead of going to the waypoint position value.

It sounds like you’re on the right track. :slight_smile:

If part = x
Var_Pos := p[0.00,0.01,0.02,0.03,0.04,0.05]
Elseif part = y
Var_Pos := p[0.00,0.01,0.02,0.07,0.04,0.05]

Sounds to me like you’re using the wrong unit in your variable position. The coordinates in variables are in metres. “1” will be 1 meter in the respective axis.
Or you’re using a wrong feature. Make sure to use the correct feature and read the coordinates in that frame.

An alternative way to do it is to make two waypoints in the start of your program, and then just assign them to a variable position.
To keep the robot from executing the waypoints, you can put them in an “if 1 = 2” or similar:

BeforeStart
If 1 = 2
WaypointPartX
WaypointPartY

RobotProgram
If part = x
Var_Pos := WaypointPartX
Elseif part = y
Var_Pos := WaypointPartY

Or even more simple, you can put the “if” where the waypoint actually is and not need variable waypoints:

RobotProgram
‘Program up until the different waypoints’
If part = x
WaypointPartX
Elseif part = y
WaypointPartY

Hope this is useful to you. :slight_smile:

Ah that was my issue, I was putting in the position coords in mm instead of m. Thanks!