.PROGRAM Palletizer() ; this program will create a stacked pallet of parts, 4L x 5W x 3H MOVE #home ; stat at this precision point Reset ; all outputs off Closei ; default position of the gripper PC=0 ; initialize PC parts counter A=0 ; reset z-loop 40 B=0 ; reset y-loop 30 C=0 ; reset x-loop 20 SET sdrop = SHIFT(drop by a*50,b*60,c*40) CALL sub.motion() PC=PC+1 ; increment parts counter Type /C20, /X15, "Number of parts moved: ", PC, /C20 C=C+1 ; increment phantom position If C<4 goto 20 ; loop if x row not filled B=B+1 ; increment phantom position If B<5 goto 30 ; loop if y row not filled A=A+1 ; increment phantom position If A<3 goto 40 ; loop if z row now filled MOVE #home ; end program at this point .END .PROGRAM sub.motion() APPRO pick, 30 SPEED 20 MOVES pick BREAK OPENI ; grab the part DEPARTS 50 APPRO sdrop, 50 SPEED 20 MOVES sdrop BREAK CLOSEI ; release the part DEPARTS 60 RETURN .END