I have an application where the robots will use a multi-head tool to pick products sequentially before placing. In the past, I used a “QuickAck” routine which was supplied by ABB for use on the S4C+ controller. Is this routine still valid for IRC5, or is there a new version?
Craig,
There is a version for IRC5 too:
PERS num Cnv1Angle:=0;
PERS num Cnv2Angle:=0;
PERS num Cnv3Angle:=0;
PERS num Cnv4Angle:=0;
PERS num Cnv5Angle:=0;
PERS num Cnv6Angle:=0;
PERS num Cnv1BFdist:=0;
PERS num Cnv2BFdist:=0;
PERS num Cnv3BFdist:=0;
PERS num Cnv4BFdist:=0;
PERS num Cnv5BFdist:=0;
PERS num Cnv6BFdist:=0;
PERS num c1RealPos:=0;
PERS num c2RealPos:=0;
PERS num c3RealPos:=0;
PERS num c4RealPos:=0;
PERS num c5RealPos:=0;
PERS num c6RealPos:=0;
VAR num Xpos;
VAR num Ypos;
!**********************************************************
!
! Function QuickAck
!
! Makes a quick acknowledge. Returns FALSE if is
! wasn’t possible.
!
!***********************************************************
FUNC bool QuickAck(num Index, itmtgt ItemTarget switch Nack)
VAR bool QuickAckOk:=FALSE;
VAR bool AckNack:=TRUE;
IF Present(Nack) THEN
AckNack:=FALSE;
ENDIF
IF IsQuickAckOk(Index) THEN
AckItmTgt ItmSrcData{Index}.ItemSource,ItemTarget,AckNack;
QuickAckOk:=TRUE;
ENDIF
RETURN QuickAckOk;
ENDFUNC
!***********************************************************
!
! Function IsQuickAckOk
!
! Checks if it’s OK to make a fast acknowledge.
!
!***********************************************************
FUNC bool IsQuickAckOk(num Index)
VAR num CnvPos:=0;
VAR num DropDist:=0;
VAR num RealPos:=0;
VAR bool QuickAckOk:=FALSE;
CONST num SafeDist:=200;
CONST num MinDropDist:=2000;
IF ItmSrcData{Index}.Wobj.ufmec = “” THEN
QuickAckOk:=TRUE;
ELSE
IF ItmSrcData{Index}.Wobj.ufmec = “CNV1” THEN
CnvPos:=c1Position1000;
DropDist:=Cnv1BFdist;
ELSEIF ItmSrcData{Index}.Wobj.ufmec = “CNV2” THEN
CnvPos:=c2Position1000;
DropDist:=Cnv2BFdist;
ELSEIF ItmSrcData{Index}.Wobj.ufmec = “CNV3” THEN
CnvPos:=c3Position1000;
DropDist:=Cnv3BFdist;
ELSEIF ItmSrcData{Index}.Wobj.ufmec = “CNV4” THEN
CnvPos:=c4Position1000;
DropDist:=Cnv4BFdist;
ELSEIF ItmSrcData{Index}.Wobj.ufmec = “CNV5” THEN
CnvPos:=c5Position1000;
DropDist:=Cnv5BFdist;
ELSEIF ItmSrcData{Index}.Wobj.ufmec = “CNV6” THEN
CnvPos:=c6Position1000;
DropDist:=Cnv6BFdist;
ENDIF
IF DropDist < MinDropDist THEN
DropDist:=MinDropDist;
ENDIF
IF CnvPos < DropDist-SafeDist THEN
QuickAckOk:=TRUE;
ELSE
QuickAckOk:=FALSE;
ENDIF
ENDIF
RETURN QuickAckOk;
ENDFUNC
!***********************************************************
!
! Procedure ReadCnv
!
! Reads the conveyors base frame distance and angle
!
!***********************************************************
PROC ReadCnv1()
VAR orient CnvOrient:=[1,0,0,0];
VAR pos CnvBFPos;
ReadCfgData “/MOC/SINGLE/CNV1”,“base_frame_orient_u0”,CnvOrient.q1;
ReadCfgData “/MOC/SINGLE/CNV1”,“base_frame_orient_u1”,CnvOrient.q2;
ReadCfgData “/MOC/SINGLE/CNV1”,“base_frame_orient_u2”,CnvOrient.q3;
ReadCfgData “/MOC/SINGLE/CNV1”,“base_frame_orient_u3”,CnvOrient.q4;
Cnv1Angle:=EulerZYX(,CnvOrient);
ReadCfgData “/MOC/SINGLE/CNV1”,“base_frame_pos_x”,CnvBFPos.x; ;
ReadCfgData “/MOC/SINGLE/CNV1”,“base_frame_pos_y”,CnvBFPos.y; ;
IF Abs(CnvBFPos.x) > Abs(CnvBFPos.y) THEN
Cnv1BFdist:=Abs(CnvBFPos.x)*1000;
ELSE
Cnv1BFdist:=Abs(CnvBFPos.y)*1000;
ENDIF
ENDPROC
Good luck!
/Mats
By the way, take the whole utility module: UtilityRS.zip
/Mats
Thank you for the utility module. I am using earlier versions of some of these routines which were given to me years ago. These are much cleaner.
I looked at the SetToolRot procedure because it is also relevant for this application. I don’t see where the value for ItemAngle is set. Should a statement be added to get the ItemIarget rotation, or am I missing something?
Sorry for that, Craig. Must have slipped on the delete key sometime.
Now it’s updated. Try the old link again.
/Mats
Is the Utility Module linked in this Thread above still applicable for a Quick Ack on 3.4x