User`s guide
; Create the local reference frame "pallet.frame"
SET pallet.frame = FRAME(loc.origin, loc.x.axis,loc.pos.y, loc.origin)
cell.space = 50 ;Spacing of cells on pallet
; Remove the palletized items
FOR i = 0 TO 3
FOR J = 0 TO 2
APPRO pallet.frame:TRANS(i*cell.space, j*cell.space), 25
MOVE pallet.frame:TRANS(i*cell.space, j*cell.space)
BREAK ;Settle robot
CLOSEI ;Grab the part
DEPART 25 ;MOVE to the drop off location
END
END
In the above example, the code that teaches the pallet frame must run only when the pallet
location changes.
If you are building an assembly that does not have regularly spaced locations like the above
example, the following code teaches individual locations relative to the frame:
; Get the locations to define the pallet frame
DETACH () ;Release robot for use by the MCP
PROMPT "Place robot at assembly origin. ", $ans
HERE loc.origin ;Record the frame origin
PROMPT "Place robot at point on the assm. x-axis. ", $ans
HERE loc.x.axis ;Record point on x-axis
PROMPT "Place robot at point in positive y direction. ", $ans
HERE loc.pos.y ;Record positive y direction
; Create the local reference frame "assm.frame"
SET assm.frame = FRAME(loc.origin, loc.x.axis, loc.pos.y, loc.origin)
; Teach the locations on the assembly
PROMPT "Place the robot in the first location. ", $ans
HERE assm.frame:loc.1 ;Record the first location
PROMPT "Place the robot in the second location. ", $ans
HERE assm.frame:loc.2 ;Record the second location
; etc.
; Move to the locations on the assembly
ATTACH () ;Reattach the robot
Creating and Altering Location Variables
V+Language User's Guide, v17.0
Page 178










