;Loaded as main ; $1 0 $2 0 $3 0 ; set variables 1,2, and 3 to zero. these will be the x, y, and z offsets. G10 P100 X #1 Y #2 Z #3 ; reset work offset 100 to zero. this also selects offset 100. $4 3; Initialize variable 4 to 3 - this is the number of calls to the sub we will do. G10 P100 X #1 Y #2 Z #3 Update and reload work offset 100. /M98 P0 ; call the subroutine. $1 #1 + 10; incriment x offset $4 #4 - 1 ; decrement the loop counter G04 P5.0 ; one second dwell. ?#4 M96 P-5 ; if the loop counter is > 0 jump up 5 lines M30 G10 P10 X #1 Y #2 Z #3