User`s guide

Sample Programs
The following program is an example of a robot task working from a moving conveyor belt.
The task consists of the following steps:
1. Wait for a signal that a part is present.
2. Pick up the part.
3. Place the part at a new location on the belt.
4. Return to a rest location to wait for the next part.
CAUTION: These programs are meant only to illustrate programming
techniques useful in typical applications. Moving-line programs are
hardware dependent because of the belt parameters, so care must be
exercised if you attempt to use these programs.
; *** PROGRAM TO RELOCATE PART ON CONVEYOR ***
; Set up belt parameters
ENABLE BELT
PARAMETER BELT.MODE = 0
belt.scale = 0.03067 ;Encoder scale factor
; Define belt twice, for two stations
DEFBELT %b1 = belt, 1, 32, belt.scale
WINDOW %b1 = window.1, window.2, window.error
DEFBELT %b2 = belt, 2, 32, belt.scale
WINDOW %b2 = window.1, window.2, window.error
WHILE TRUE DO ;Loop indefinitely
WAIT part.ready ;Wait for signal that part present
bx = BELT(%b1) ;Read present belt position
SETBELT %b1 = bx ;Set encoder offset for pick-up...
SETBELT %b2 = bx ;... and drop-off stations
APPROS %b1:p1, 50 ;Move to the part and pick it up
MOVES %b1:p1
CLOSEI
DEPARTS 50
APPROS %b2:p2, 50 ;Carry part to drop-off location
MOVES %b2:p2
OPENI
DEPARTS 50
MOVES wait.location ;Return to rest location
END ;Wait for the next part
; *** End of program ***
Sample Programs
(Undefined variable: Primary.Product_Name_V)Language User's Guide, version
17.x
Page 319