Skip to main content

6.3. Bin Picking JOB file

6.3. Bin Picking JOB file

 

The following shows the entire example of the bin picking JOB file described in Chapter 4. Refer to Chapter 4 for the detailed description. Considering that depending on the type of the gripper or the characteristics of the work, other commands can be used to write a JOB file, refer to this for other applications.

 

Program File Format Version: 1.6 MechType: 127(HA020-03) TotalAxis: 6 AuxAxis: 0

     '_

     '_Pick-it Mode

     DIM liStatusErr AS Integer

     DIM liRunMode AS Integer

     DIM liIdleMode AS Integer

     DIM liCalibMode AS Integer

     '_Pick-it Status

     DIM liFCPOK AS Integer

     DIM liFCPFail AS Integer

     DIM liObjFound AS Integer

     DIM liNoObj AS Integer

     DIM liNoImgCap AS Integer

     DIM liCFGOK AS Integer

     DIM liCFGFail AS Integer

     DIM liSVSOK AS Integer

     DIM liSVSFail AS Integer

     '_Pick-it Type

     DIM liSquare AS Integer

     DIM liRectangle AS Integer

     DIM liCircle AS Integer

     DIM liEllipse AS Integer

     DIM liCylinder AS Integer

     DIM liSphere AS Integer

     DIM liPointCloud AS Integer

     DIM liBlob AS Integer

     '_

     liStatusErr=-1

     liRunMode=0

     liIdleMode=1

     liCalibMode=2

     '_

     liFCPOK=10

     liFCPFail=11

     liObjFound=20

     liNoObj=21

     liNoImgCap=21

     liCFGOK=40

     liCFGFail=41

     liSVSOK=50

     liSVSFail=51

     '_

     liSquare=21

     liRectangle=22

     liCircle=23

     liEllipse=24

     liCylinder=32

     liSphere=33

     liPointCloud=35

     liBlob=50

     '_

     'Ethernet setting

     ENET1.IP="192.168.1.11"

     ENET1.RPORT=5001

     ENET1.LPORT=5001

     ENET1.OPEN 1

     CLR_RBUF ENET1

     '_

     'Pick-it setting

     PICKIT.ITF ENET1,CNX=1,WAIT=3

     PICKIT.CHK

     IF PICKIT.STATUS=liRunMode THEN 1 ELSE 99

   1 PICKIT.CFG SETUP=12,PROD=19

     PRINT #0,PICKIT.STATUS

     DELAY 0.5

     IF PICKIT.STATUS=liCFGOK THEN 11 ELSE 99

     '_

     'First picking work

  11 PICKIT.LFO P1

     IF PICKIT.STATUS=liObjFound THEN 12 ELSE 99

  12 P2=P1

     P2.Z=P1.Z+300

S1   MOVE P,P2,S=50%,A=3,T=0 'Moves the workpiece upwards

     P2.Z=P1.Z

S2   MOVE P,P2,S=50%,A=3,T=0 'Workpiece picking position

     DELAY 0.5

     DO1=1 'Digital control of the gripper

     P2.Z=P1.Z+300 'Picks the workpiece and then moves vertically

S3   MOVE P,P3,S=50%,A=3,T=0 'Workpiece loading position

     DELAY 0.5

     DO1=0 'Digital control of the gripper

     '_

     'Picking work yet to be performed

     IF PICKIT.REMAIN>0 THEN 21 ELSE 99

  21 FOR V1!=1 TO PICKIT.REMAIN STEP 1

     PICKIT.NXT P1 'Workpiece pose stored in the Pick-it memory

     P2=P1

     P2.Z=P1.Z+300

S4   MOVE P,P2,S=50%,A=3,T=0 'Moves the workpiece upwards

     P2.Z=P1.Z

S5   MOVE P,P2,S=50%,A=3,T=0 'Workpiece picking position

     DELAY 0.5

     DO1=1 'Digital control of the gripper

     P2.Z=P1.Z+300 'Picks the workpiece and moves vertically

S6   MOVE P,P3,S=50%,A=3,T=0 'Workpiece loading position

     DELAY 0.5

     DO1=0 'Digital control of the gripper

     NEXT 'Ending of the FOR statement

     '_

  99 'Setting of the ending

S7   MOVE P,P4,S=50%,A=3,T=0 'Move to the pose

     PICKIT.ITF ENET1,CNX=0,WAIT=3

     ENET1.OPEN 0

     END