/ This program communicates with a PLC. The PLC controls a / motorized conveyor and an automatic loading hopper to refill / the robot loader chute. Main program: J P[1:safe] 100% FINE / home location out of workcell RO[1]=ON / default position for gripper J PR[1] 100% FINE / teach original drop location L PR[2] 100mm/sec CNT50 / teach original above-drop location J P[1:safe] 100% FINE / retreat to safe location DO[3]=ON / set "working" output when ready for pallet LBL[40] / begin palletizing routine WAIT DI[5]=ON / wait for pallet to land in position PR[3]=PR[1] PR[4]=PR[2] R[6]=0 LBL[30] R[5]=0 PR[3,1]=PR[1,1] PR[4,1]=PR[2,1] LBL[20] PR[3,2]=PR[1,2] PR[4,2]=PR[2,2] R[3]=0 R[4]=0 LBL[10] Call SUB-MOTION / load one part into pallet PR[3,2]=PR[1,2]+49 / positional values for drop PR[4,2]=PR[2,2]+49 R[3]=R[3]+1 R[4]=R[4]+1 If R[3]<5, Jmp LBL[10] PR[3,1]=PR[1,1]-59 / positional values for drop PR[4,1]=PR[2,1]-59 R[5]=R[5]+1 If R[5]<4, Jmp LBL[20] PR[3,3]=PR[1,3]+38 / positional values for drop PR[4,3]=PR[2,3]+38 R[6]=R[6]+1 If R[6]<3, Jmp LBL[30] J P[1:safe] 100% CNT50 / retreat to safe location when done DO[3]=OFF / clear working output, PLC removes the full pallet JMP LBL[40] / loop and do it again [END] Subroutine: SUB-MOTION If DI[2]=OFF call SUB-NOPARTS / call sub if loader empty J P[1:appro-pick] 100% CNT15 / approach pick location L P[2:pick] 85mm/sec FINE / move to pick RO[1]=OFF / grab part L P[1:appro-pick] 100mm/sec FINE / depart from pick J P[3:middlea] 100% CNT50 / middle position J P[4:middleb] 100% CNT50 / middle position J PR[3] 100% CNT15 / approach phantom drop location L PR[4] 85mm/sec FINE / move to phantom drop RO[1]=ON / release part L PR[3] 100mm/sec FINE / depart from phantom drop J P[4:middleb] 100% CNT50 / middle position J P[3:middlea] 100% CNT50 / middle position END [END] Subroutine: SUB-NOPARTS J P[1:safe] 100% FINE / move to safe position for loading DO[4]=ON / parts autoloader signal to PLC WAIT DI[2]=ON / wait for additional parts to load WAIT DI[3]=ON / wait for loader full signal DO[4]=OFF WAIT 2sec / wait for autoloader to stop END [END]