You mean whenever the subroutine is called you want to use the current position of robot at the time of the call and then apply the move down and move up logic?
Or do you just want 3 motion statements and a Set Binary Output statement…
The first option. I would like to use the current position of the robot at the time the subroutine is called, and move up a set distance (20 mm) from there.
The simulation calls the subroutine ~50 times in 50 different locations, so writing it out by hand is very tedious.