Advertising

Picking from a cart of parts

Some years past I was working at an integrator that was building two, entirely separate, but more or less identical truck building lines. The area in which I was working, there was a robot which needed to pick parts from a cart which held the same parts, in rows and layers. Someone brought me the program that had been written in the other assembly line. They told me that we should use that program so that the lines were the same. I looked at that code and just could not bring myself to use it. This is that program:


MODULE pPickPart

!******************************* ROBOT INFORMATION ****************************

! ROBOT = R16

! PLANT = DS Warren Truck

! LINE = Underbody

! STATION = S14

!******************************************************************************

!***********************************NumData************************************

!Pick Locations

PERS num PickX := 0 ;

PERS num PickZ := 0;

!Distance Between one row To the next

CONST num zToPart := 96;

!Distance from one column to the next

CONST num xToPart := -127;

!Current Column and Row

PERS num Column := 0;

PERS num Row := 0;

!Top of Cart for Top Position Routine

CONST num zTopOfCart := 600;

!********************************** ROBTARGET DATA ****************************

PERS robtarget NextPosition := [[235.36,1586.27,600],[0.0165765,-0.702627,0.0018002,-0.711367],[0,0,-2,0],[9E+09,9E+09,9E+09,9E+09,9E+09,9E+09]];

CONST robtarget r16_Pick_2 := [[228.25,-1736.21,225.19],[0.0146328,-0.704661,-0.00109994,-0.709395],[-1,-1,1,0],[9E+09,9E+09,9E+09,9E+09,9E+09,9E+09]];

CONST robtarget r16_Pick_1 := [[235.34,1586.22,214.18],[0.0165612,-0.702638,0.00178684,-0.711356],[0,0,-2,0],[9E+09,9E+09,9E+09,9E+09,9E+09,9E+09]];

CONST robtarget r16DropPnce:=[[1576.03,208.24,2175.59],[0.424202,-0.00692811,-0.902036,0.0796257],[0,-1,-1,0],[9E+09,9E+09,9E+09,9E+09,9E+09,9E+09]];

CONST robtarget r16_Pnce_1:=[[294.73,1586.20,549.29],[0.0165225,-0.702659,0.00178433,-0.711336],[0,0,-2,0],[9E+09,9E+09,9E+09,9E+09,9E+09,9E+09]];

CONST robtarget r16_Pnce_2:=[[355.76,-1700.37,422.18],[0.0146491,-0.704672,-0.00109864,-0.709385],[-1,-1,1,0],[9E+09,9E+09,9E+09,9E+09,9E+09,9E+09]];

CONST robtarget r26:=[[1296.93,-868.62,1449.57],[0.372952,-0.34158,-0.578832,-0.639678],[-1,-1,0,0],[9E+09,9E+09,9E+09,9E+09,9E+09,9E+09]];

CONST robtarget r36:=[[1296.92,-868.62,1449.57],[0.372951,-0.341582,-0.578832,-0.639678],[-1,-1,0,0],[9E+09,9E+09,9E+09,9E+09,9E+09,9E+09]];

!Used for error handling

VAR num NumTries :=0;

PROC PickPart()

IF (UserInput6 = 1) xor (UseDryCycle = 1) THEN

TPErase;

TPWrite "*********************************************************";

TPWrite "*********** Resetting Rack ******************";

TPWrite "*********************************************************";

ResetRack;

ENDIF

WaitUntil GetPickupResult()>=1 OR GetPickupResult()<=3;

TEST GetPickupResult()

CASE Pickup_1:

TPErase;

TPWrite "*********************************************************";

TPWrite "*********** Picking From Left Cart ******************";

TPWrite "*********************************************************";

UBY_R16_Pick_1;

CASE Pickup_2:

TPErase;

TPWrite "*********************************************************";

TPWrite "*********** Picking From Right Cart******************";

TPWrite "*********************************************************";

UBY_R16_Pick_2;

DEFAULT:

TPErase;

TPWrite "*********************************************************";

TPWrite "*********** Wrong Part Position Sent ******************";

TPWrite "*********************************************************";

Stop;

ENDTEST

ENDPROC

PROC UBY_R16_Pick_1()

!Check Part Presents And Grippers For Pickup

PrepareToGrip\V1;

!Request Enter To Pickup

EnterPickup PICKUP_1;

!Set Robot At Pounce Off

SetDO RobotAtPounce,0;

SetDO ClrOfPickup1, low;

!Reset error counter

NumTries := 0;

!Move the robot to Right Cart Pounce Position

MoveJ r16_Pnce_1,vmax,z200,Toolgrip_DS;

rNextTry:

TPWrite "*************************************";

TPWrite "Picking from Row:="\num:=Row;

TPWrite "Picking from Column:="\num:=Column;

TPWrite "*************************************";

!Pounce to Before Pick Location

MoveL Offs(r16_Pick_1,PickX + 40,0,-PickZ - 10), v500, Fine, Toolgrip_DS;

!Check for part present

IF (Part1Present = 1 AND Part2Present = 1) XOR (UseDryCycle = 1 and Part1Present = 0 AND Part2Present = 0)THEN

MoveL Offs(r16_Pick_1, PickX ,0,-PickZ - 10), v50, z10, Toolgrip_DS;

MoveL Offs(r16_Pick_1, PickX ,0,-PickZ), v10, fine, Toolgrip_DS;

!Set Robot At Pickup 1

SetDO AtPickup1,1;

!Close Grippers

GripPart\V1;

VerifyPartPres\V1;

GripLoad load_ds;

!Wait For PLC OK To Exit;

ExitPickup PICKUP_1;

!Move Straight Above Cart

GetTopLocation;

MoveL NextPosition,v500,z100,Toolgrip_DS;

!Set Clear of Pickup 1

SetDO ClrOfPickup1, 1;

MoveJ r16_Pnce_1,vmax,z200,Toolgrip_DS;

IF UseDryCycle = 0 THEN

!Index part register

IndexPart;

ENDIF

!Move to Common Pounce Drop Location

MoveJ r16DropPnce,vmax,z200,Toolgrip_DS;

Else

!Back Out from Part

MoveL Offs(r16_Pick_1,PickX + 40,0,-PickZ - 10), v500, z100, Toolgrip_DS;

IF NumTries = 3 THEN

TPWrite "Part unable to be located";

MoveJ Offs(r16_Pnce_1,0,0,200), vmax, z200, Toolgrip_DS;

Break;

ELSE

NumTries := Numtries +1;

IndexPart;

GOTO rNextTry;

ENDIF

ENDIF

ENDPROC

PROC UBY_R16_Pick_2()

!Check Part Presents And Grippers For Pickup

PrepareToGrip\V1;

!Request Enter To Pickup

EnterPickup PICKUP_2;

!Set Robot At Pounce Off

SetDO RobotAtPounce,0;

!Move to pickup location

SetDO ClrOfPickup2, low;

!Reset error counter

NumTries := 0;

!Move the robot to Right Cart Pounce Position

MoveJ r16_Pnce_2,vmax,z200,Toolgrip_DS;

rNextTry:

TPWrite "*************************************";

TPWrite "Picking from Row:="\num:=Row;

TPWrite "Picking from Column:="\num:=Column;

TPWrite "*************************************";

!Pounce to Before Pick Location

MoveL Offs(r16_Pick_2,PickX + 40,0,-PickZ - 10), v500, Fine, Toolgrip_DS;

!Check for part present

IF (Part1Present = 1 AND Part2Present = 1) XOR (UseDryCycle = 1 and Part1Present = 0 AND Part2Present = 0)THEN

MoveL Offs(r16_Pick_2, PickX ,0,-PickZ - 10), v50, z10, Toolgrip_DS;

MoveL Offs(r16_Pick_2, PickX ,0,-PickZ), v10, fine, Toolgrip_DS;

!Set Robot At Pickup 1

SetDO AtPickup2,1;

!Close Grippers

GripPart\V1;

VerifyPartPres\V1;

GripLoad load_ds;

!Wait For PLC OK To Exit;

ExitPickup PICKUP_2;

!Move Straight Above Cart

GetTopLocation;

MoveL NextPosition,v500,z100,Toolgrip_DS;

!Set Clear of Pickup 1

SetDO ClrOfPickup2, 1;

MoveJ r16_Pnce_2,vmax,z200,Toolgrip_DS;

IF UseDryCycle = 0 THEN

!Index part register

IndexPart;

ENDIF

!Move to Common Pounce Drop Location

MoveJ r36, vmax, z200, Toolgrip_DS;

MoveJ r16DropPnce,vmax,z200,Toolgrip_DS;

Else

!Back Out from Part

MoveL Offs(r16_Pick_2,PickX + 40,0,-PickZ - 10), v500, z100, Toolgrip_DS;

IF NumTries = 3 THEN

TPWrite "Part unable to be located";

MoveJ Offs(r16_Pnce_2,0,0,200), vmax, z200, Toolgrip_DS;

Break;

ELSE

NumTries := Numtries +1;

IndexPart;

GOTO rNextTry;

ENDIF

ENDIF

ENDPROC

PROC IndexPart()

!Gets Current Part Location and Indexes Position to next part

!Find out if last row is being picked

IF Row = 6 THEN

PickZ := 0;

IF Column <= 11 THEN

PickX := xtopart * 1;

ENDIF

Row := 0;

Column := Column + 1;

ELSE

PickZ := Row * zToPart;

Row := Row + 1;

ENDIF

ENDPROC

PROC TeachPick_2()

MoveL r16_Pick_2, v10, fine, Toolgrip_DS;

ENDPROC

PROC TeachLeftPick()

!Procedure for teaching the Left pick position

MoveL r16_Pick_1, v10, fine, Toolgrip_DS;

ENDPROC

PROC ResetRack()

!This Procedure will Reset all offsets for the Rack to 0

Row := 0;

Column := 0;

PickX := 0;

PickZ := 0;

ENDPROC

Proc GetTopLocation()

!This routine Sets NextPosition above cart

NextPosition := CRobT();

NextPosition.trans.z := zTopOfCart;

ENDPROC

ENDMODULE


I thought to myself, "I can do better than this". So I came up with this:


%%%

VERSION:1

LANGUAGE:ENGLISH

%%%

MODULE pPickPart_Lee

!******************************* ROBOT INFORMATION ****************************

! ROBOT = R16

! PLANT = DS Warren Truck

! LINE = Underbody

! STATION = S14

!******************************************************************************

!***********************************NumData************************************

!Pick Locations

!Distance Between one row To the next

!Distance from one column to the next

!Current Column and Row

LOCAL CONST num zToPart:=96;

LOCAL CONST num xToPart:=127;

PERS num nColumn_1:=2;

PERS num nRow_1:=5;

PERS num nColumn_2:=1;

PERS num nRow_2:=1;

PERS bool bLastPick_1:=FALSE;

PERS bool bLastPick_2:=FALSE;

PERS robtarget pPickCart_1{12,6}:=[[[[235.34,1586.22,214.18],[0.0165612,-0.702638,0.00178684,-0.711356],[0,0,-2,0],[9E+09,9E+09,9E+09,9E+09,9E+09,9E+09]],[[235.34,1586.2,118.18],[0.0165209,-0.702659,0.00178609,-0.711336],[0,0,-2,0],[9E+09,9E+09,9E+09,9E+09,9E+09,9E+09]],[[235.34,1586.2,22.18],[0.0165209,-0.702659,0.00178609,-0.711336],[0,0,-2,0],[9E+09,9E+09,9E+09,9E+09,9E+09,9E+09]],[[235.34,1586.2,-73.82],[0.0165209,-0.702659,0.00178609,-0.711336],[0,0,-2,0],[9E+09,9E+09,9E+09,9E+09,9E+09,9E+09]],[[235.34,1586.2,-169.82],[0.0165209,-0.702659,0.00178609,-0.711336],[0,0,-2,0],[9E+09,9E+09,9E+09,9E+09,9E+09,9E+09]],[[235.34,1586.2,-265.82],[0.0165209,-0.702659,0.00178609,-0.711336],[0,0,-2,0],[9E+09,9E+09,9E+09,9E+09,9E+09,9E+09]]],[[[108.34,1586.2,214.18],[0.0165209,-0.702659,0.00178609,-0.711336],[0,0,-2,0],[9E+09,9E+09,9E+09,9E+09,9E+09,9E+09]],[[108.34,1586.2,118.18],[0.0165209,-0.702659,0.00178609,-0.711336],[0,0,-2,0],[9E+09,9E+09,9E+09,9E+09,9E+09,9E+09]],[[108.34,1586.2,22.18],[0.0165209,-0.702659,0.00178609,-0.711336],[0,0,-2,0],[9E+09,9E+09,9E+09,9E+09,9E+09,9E+09]],[[108.34,1586.2,-73.82],[0.0165209,-0.702659,0.00178609,-0.711336],[0,0,-2,0],[9E+09,9E+09,9E+09,9E+09,9E+09,9E+09]],[[108.34,1586.2,-169.82],[0.0165209,-0.702659,0.00178609,-0.711336],[0,0,-2,0],[9E+09,9E+09,9E+09,9E+09,9E+09,9E+09]],[[108.34,1586.2,-265.82],[0.0165209,-0.702659,0.00178609,-0.711336],[0,0,-2,0],[9E+09,9E+09,9E+09,9E+09,9E+09,9E+09]]],[[[-18.66,1586.2,214.18],[0.0165209,-0.702659,0.00178609,-0.711336],[0,0,-2,0],[9E+09,9E+09,9E+09,9E+09,9E+09,9E+09]],[[-18.66,1586.2,118.18],[0.0165209,-0.702659,0.00178609,-0.711336],[0,0,-2,0],[9E+09,9E+09,9E+09,9E+09,9E+09,9E+09]],[[-18.66,1586.2,22.18],[0.0165209,-0.702659,0.00178609,-0.711336],[0,0,-2,0],[9E+09,9E+09,9E+09,9E+09,9E+09,9E+09]],[[-18.66,1586.2,-73.82],[0.0165209,-0.702659,0.00178609,-0.711336],[0,0,-2,0],[9E+09,9E+09,9E+09,9E+09,9E+09,9E+09]],[[-18.66,1586.2,-169.82],[0.0165209,-0.702659,0.00178609,-0.711336],[0,0,-2,0],[9E+09,9E+09,9E+09,9E+09,9E+09,9E+09]],[[-18.66,1586.2,-265.82],[0.0165209,-0.702659,0.00178609,-0.711336],[0,0,-2,0],[9E+09,9E+09,9E+09,9E+09,9E+09,9E+09]]],[[[-145.66,1586.2,214.18],[0.0165209,-0.702659,0.00178609,-0.711336],[0,0,-2,0],[9E+09,9E+09,9E+09,9E+09,9E+09,9E+09]],[[-145.66,1586.2,118.18],[0.0165209,-0.702659,0.00178609,-0.711336],[0,0,-2,0],[9E+09,9E+09,9E+09,9E+09,9E+09,9E+09]],[[-145.66,1586.2,22.18],[0.0165209,-0.702659,0.00178609,-0.711336],[0,0,-2,0],[9E+09,9E+09,9E+09,9E+09,9E+09,9E+09]],[[-145.66,1586.2,-73.82],[0.0165209,-0.702659,0.00178609,-0.711336],[0,0,-2,0],[9E+09,9E+09,9E+09,9E+09,9E+09,9E+09]],[[-145.66,1586.2,-169.82],[0.0165209,-0.702659,0.00178609,-0.711336],[0,0,-2,0],[9E+09,9E+09,9E+09,9E+09,9E+09,9E+09]],[[-145.66,1586.2,-265.82],[0.0165209,-0.702659,0.00178609,-0.711336],[0,0,-2,0],[9E+09,9E+09,9E+09,9E+09,9E+09,9E+09]]],[[[-272.66,1586.2,214.18],[0.0165209,-0.702659,0.00178609,-0.711336],[0,0,-2,0],[9E+09,9E+09,9E+09,9E+09,9E+09,9E+09]],[[-272.66,1586.2,118.18],[0.0165209,-0.702659,0.00178609,-0.711336],[0,0,-2,0],[9E+09,9E+09,9E+09,9E+09,9E+09,9E+09]],[[-272.66,1586.2,22.18],[0.0165209,-0.702659,0.00178609,-0.711336],[0,0,-2,0],[9E+09,9E+09,9E+09,9E+09,9E+09,9E+09]],[[-272.66,1586.2,-73.82],[0.0165209,-0.702659,0.00178609,-0.711336],[0,0,-2,0],[9E+09,9E+09,9E+09,9E+09,9E+09,9E+09]],[[-272.66,1586.2,-169.82],[0.0165209,-0.702659,0.00178609,-0.711336],[0,0,-2,0],[9E+09,9E+09,9E+09,9E+09,9E+09,9E+09]],[[-272.66,1586.2,-265.82],[0.0165209,-0.702659,0.00178609,-0.711336],[0,0,-2,0],[9E+09,9E+09,9E+09,9E+09,9E+09,9E+09]]],[[[-399.66,1586.2,214.18],[0.0165209,-0.702659,0.00178609,-0.711336],[0,0,-2,0],[9E+09,9E+09,9E+09,9E+09,9E+09,9E+09]],[[-399.66,1586.2,118.18],[0.0165209,-0.702659,0.00178609,-0.711336],[0,0,-2,0],[9E+09,9E+09,9E+09,9E+09,9E+09,9E+09]],[[-399.66,1586.2,22.18],[0.0165209,-0.702659,0.00178609,-0.711336],[0,0,-2,0],[9E+09,9E+09,9E+09,9E+09,9E+09,9E+09]],[[-399.66,1586.2,-73.82],[0.0165209,-0.702659,0.00178609,-0.711336],[0,0,-2,0],[9E+09,9E+09,9E+09,9E+09,9E+09,9E+09]],[[-399.66,1586.2,-169.82],[0.0165209,-0.702659,0.00178609,-0.711336],[0,0,-2,0],[9E+09,9E+09,9E+09,9E+09,9E+09,9E+09]],[[-399.66,1586.2,-265.82],[0.0165209,-0.702659,0.00178609,-0.711336],[0,0,-2,0],[9E+09,9E+09,9E+09,9E+09,9E+09,9E+09]]],[[[-526.66,1586.2,214.18],[0.0165209,-0.702659,0.00178609,-0.711336],[0,0,-2,0],[9E+09,9E+09,9E+09,9E+09,9E+09,9E+09]],[[-526.66,1586.2,118.18],[0.0165209,-0.702659,0.00178609,-0.711336],[0,0,-2,0],[9E+09,9E+09,9E+09,9E+09,9E+09,9E+09]],[[-526.66,1586.2,22.18],[0.0165209,-0.702659,0.00178609,-0.711336],[0,0,-2,0],[9E+09,9E+09,9E+09,9E+09,9E+09,9E+09]],[[-526.66,1586.2,-73.82],[0.0165209,-0.702659,0.00178609,-0.711336],[0,0,-2,0],[9E+09,9E+09,9E+09,9E+09,9E+09,9E+09]],[[-526.66,1586.2,-169.82],[0.0165209,-0.702659,0.00178609,-0.711336],[0,0,-2,0],[9E+09,9E+09,9E+09,9E+09,9E+09,9E+09]],[[-526.66,1586.2,-265.82],[0.0165209,-0.702659,0.00178609,-0.711336],[0,0,-2,0],[9E+09,9E+09,9E+09,9E+09,9E+09,9E+09]]],[[[-653.66,1586.2,214.18],[0.0165209,-0.702659,0.00178609,-0.711336],[0,0,-2,0],[9E+09,9E+09,9E+09,9E+09,9E+09,9E+09]],[[-653.66,1586.2,118.18],[0.0165209,-0.702659,0.00178609,-0.711336],[0,0,-2,0],[9E+09,9E+09,9E+09,9E+09,9E+09,9E+09]],[[-653.66,1586.2,22.18],[0.0165209,-0.702659,0.00178609,-0.711336],[0,0,-2,0],[9E+09,9E+09,9E+09,9E+09,9E+09,9E+09]],[[-653.66,1586.2,-73.82],[0.0165209,-0.702659,0.00178609,-0.711336],[0,0,-2,0],[9E+09,9E+09,9E+09,9E+09,9E+09,9E+09]],[[-653.66,1586.2,-169.82],[0.0165209,-0.702659,0.00178609,-0.711336],[0,0,-2,0],[9E+09,9E+09,9E+09,9E+09,9E+09,9E+09]],[[-653.66,1586.2,-265.82],[0.0165209,-0.702659,0.00178609,-0.711336],[0,0,-2,0],[9E+09,9E+09,9E+09,9E+09,9E+09,9E+09]]],[[[-780.66,1586.2,214.18],[0.0165209,-0.702659,0.00178609,-0.711336],[0,0,-2,0],[9E+09,9E+09,9E+09,9E+09,9E+09,9E+09]],[[-780.66,1586.2,118.18],[0.0165209,-0.702659,0.00178609,-0.711336],[0,0,-2,0],[9E+09,9E+09,9E+09,9E+09,9E+09,9E+09]],[[-780.66,1586.2,22.18],[0.0165209,-0.702659,0.00178609,-0.711336],[0,0,-2,0],[9E+09,9E+09,9E+09,9E+09,9E+09,9E+09]],[[-780.66,1586.2,-73.82],[0.0165209,-0.702659,0.00178609,-0.711336],[0,0,-2,0],[9E+09,9E+09,9E+09,9E+09,9E+09,9E+09]],[[-780.66,1586.2,-169.82],[0.0165209,-0.702659,0.00178609,-0.711336],[0,0,-2,0],[9E+09,9E+09,9E+09,9E+09,9E+09,9E+09]],[[-780.66,1586.2,-265.82],[0.0165209,-0.702659,0.00178609,-0.711336],[0,0,-2,0],[9E+09,9E+09,9E+09,9E+09,9E+09,9E+09]]],[[[-907.66,1586.2,214.18],[0.0165209,-0.702659,0.00178609,-0.711336],[0,0,-2,0],[9E+09,9E+09,9E+09,9E+09,9E+09,9E+09]],[[-907.66,1586.2,118.18],[0.0165209,-0.702659,0.00178609,-0.711336],[0,0,-2,0],[9E+09,9E+09,9E+09,9E+09,9E+09,9E+09]],[[-907.66,1586.2,22.18],[0.0165209,-0.702659,0.00178609,-0.711336],[0,0,-2,0],[9E+09,9E+09,9E+09,9E+09,9E+09,9E+09]],[[-907.66,1586.2,-73.82],[0.0165209,-0.702659,0.00178609,-0.711336],[0,0,-2,0],[9E+09,9E+09,9E+09,9E+09,9E+09,9E+09]],[[-907.66,1586.2,-169.82],[0.0165209,-0.702659,0.00178609,-0.711336],[0,0,-2,0],[9E+09,9E+09,9E+09,9E+09,9E+09,9E+09]],[[-907.66,1586.2,-265.82],[0.0165209,-0.702659,0.00178609,-0.711336],[0,0,-2,0],[9E+09,9E+09,9E+09,9E+09,9E+09,9E+09]]],[[[-1034.66,1586.2,214.18],[0.0165209,-0.702659,0.00178609,-0.711336],[0,0,-2,0],[9E+09,9E+09,9E+09,9E+09,9E+09,9E+09]],[[-1034.66,1586.2,118.18],[0.0165209,-0.702659,0.00178609,-0.711336],[0,0,-2,0],[9E+09,9E+09,9E+09,9E+09,9E+09,9E+09]],[[-1034.66,1586.2,22.18],[0.0165209,-0.702659,0.00178609,-0.711336],[0,0,-2,0],[9E+09,9E+09,9E+09,9E+09,9E+09,9E+09]],[[-1034.66,1586.2,-73.82],[0.0165209,-0.702659,0.00178609,-0.711336],[0,0,-2,0],[9E+09,9E+09,9E+09,9E+09,9E+09,9E+09]],[[-1034.66,1586.2,-169.82],[0.0165209,-0.702659,0.00178609,-0.711336],[0,0,-2,0],[9E+09,9E+09,9E+09,9E+09,9E+09,9E+09]],[[-1034.66,1586.2,-265.82],[0.0165209,-0.702659,0.00178609,-0.711336],[0,0,-2,0],[9E+09,9E+09,9E+09,9E+09,9E+09,9E+09]]],[[[-1161.66,1586.2,214.18],[0.0165209,-0.702659,0.00178609,-0.711336],[0,0,-2,0],[9E+09,9E+09,9E+09,9E+09,9E+09,9E+09]],[[-1161.66,1586.2,118.18],[0.0165209,-0.702659,0.00178609,-0.711336],[0,0,-2,0],[9E+09,9E+09,9E+09,9E+09,9E+09,9E+09]],[[-1161.66,1586.2,22.18],[0.0165209,-0.702659,0.00178609,-0.711336],[0,0,-2,0],[9E+09,9E+09,9E+09,9E+09,9E+09,9E+09]],[[-1161.66,1586.2,-73.82],[0.0165209,-0.702659,0.00178609,-0.711336],[0,0,-2,0],[9E+09,9E+09,9E+09,9E+09,9E+09,9E+09]],[[-1161.66,1586.2,-169.82],[0.0165209,-0.702659,0.00178609,-0.711336],[0,0,-2,0],[9E+09,9E+09,9E+09,9E+09,9E+09,9E+09]],[[-1161.66,1586.2,-265.82],[0.0165209,-0.702659,0.00178609,-0.711336],[0,0,-2,0],[9E+09,9E+09,9E+09,9E+09,9E+09,9E+09]]]];

PERS robtarget pPickCart_2{12,6}:=[[[[235.34,1586.22,214.18],[0.0165612,-0.702638,0.00178684,-0.711356],[0,0,-2,0],[9E+09,9E+09,9E+09,9E+09,9E+09,9E+09]],[[294.74,1586.2,549.29],[0.0165209,-0.702659,0.00178609,-0.711336],[0,0,-2,0],[9E+09,9E+09,9E+09,9E+09,9E+09,9E+09]],[[294.74,1586.2,549.29],[0.0165209,-0.702659,0.00178609,-0.711336],[0,0,-2,0],[9E+09,9E+09,9E+09,9E+09,9E+09,9E+09]],[[294.74,1586.2,549.29],[0.0165209,-0.702659,0.00178609,-0.711336],[0,0,-2,0],[9E+09,9E+09,9E+09,9E+09,9E+09,9E+09]],[[294.74,1586.2,549.29],[0.0165209,-0.702659,0.00178609,-0.711336],[0,0,-2,0],[9E+09,9E+09,9E+09,9E+09,9E+09,9E+09]],[[294.74,1586.2,549.29],[0.0165209,-0.702659,0.00178609,-0.711336],[0,0,-2,0],[9E+09,9E+09,9E+09,9E+09,9E+09,9E+09]]],[[[294.74,1586.2,549.29],[0.0165209,-0.702659,0.00178609,-0.711336],[0,0,-2,0],[9E+09,9E+09,9E+09,9E+09,9E+09,9E+09]],[[294.74,1586.2,549.29],[0.0165209,-0.702659,0.00178609,-0.711336],[0,0,-2,0],[9E+09,9E+09,9E+09,9E+09,9E+09,9E+09]],[[294.74,1586.2,549.29],[0.0165209,-0.702659,0.00178609,-0.711336],[0,0,-2,0],[9E+09,9E+09,9E+09,9E+09,9E+09,9E+09]],[[294.74,1586.2,549.29],[0.0165209,-0.702659,0.00178609,-0.711336],[0,0,-2,0],[9E+09,9E+09,9E+09,9E+09,9E+09,9E+09]],[[294.74,1586.2,549.29],[0.0165209,-0.702659,0.00178609,-0.711336],[0,0,-2,0],[9E+09,9E+09,9E+09,9E+09,9E+09,9E+09]],[[294.74,1586.2,549.29],[0.0165209,-0.702659,0.00178609,-0.711336],[0,0,-2,0],[9E+09,9E+09,9E+09,9E+09,9E+09,9E+09]]],[[[294.74,1586.2,549.29],[0.0165209,-0.702659,0.00178609,-0.711336],[0,0,-2,0],[9E+09,9E+09,9E+09,9E+09,9E+09,9E+09]],[[294.74,1586.2,549.29],[0.0165209,-0.702659,0.00178609,-0.711336],[0,0,-2,0],[9E+09,9E+09,9E+09,9E+09,9E+09,9E+09]],[[294.74,1586.2,549.29],[0.0165209,-0.702659,0.00178609,-0.711336],[0,0,-2,0],[9E+09,9E+09,9E+09,9E+09,9E+09,9E+09]],[[294.74,1586.2,549.29],[0.0165209,-0.702659,0.00178609,-0.711336],[0,0,-2,0],[9E+09,9E+09,9E+09,9E+09,9E+09,9E+09]],[[294.74,1586.2,549.29],[0.0165209,-0.702659,0.00178609,-0.711336],[0,0,-2,0],[9E+09,9E+09,9E+09,9E+09,9E+09,9E+09]],[[294.74,1586.2,549.29],[0.0165209,-0.702659,0.00178609,-0.711336],[0,0,-2,0],[9E+09,9E+09,9E+09,9E+09,9E+09,9E+09]]],[[[294.74,1586.2,549.29],[0.0165209,-0.702659,0.00178609,-0.711336],[0,0,-2,0],[9E+09,9E+09,9E+09,9E+09,9E+09,9E+09]],[[294.74,1586.2,549.29],[0.0165209,-0.702659,0.00178609,-0.711336],[0,0,-2,0],[9E+09,9E+09,9E+09,9E+09,9E+09,9E+09]],[[294.74,1586.2,549.29],[0.0165209,-0.702659,0.00178609,-0.711336],[0,0,-2,0],[9E+09,9E+09,9E+09,9E+09,9E+09,9E+09]],[[294.74,1586.2,549.29],[0.0165209,-0.702659,0.00178609,-0.711336],[0,0,-2,0],[9E+09,9E+09,9E+09,9E+09,9E+09,9E+09]],[[294.74,1586.2,549.29],[0.0165209,-0.702659,0.00178609,-0.711336],[0,0,-2,0],[9E+09,9E+09,9E+09,9E+09,9E+09,9E+09]],[[294.74,1586.2,549.29],[0.0165209,-0.702659,0.00178609,-0.711336],[0,0,-2,0],[9E+09,9E+09,9E+09,9E+09,9E+09,9E+09]]],[[[294.74,1586.2,549.29],[0.0165209,-0.702659,0.00178609,-0.711336],[0,0,-2,0],[9E+09,9E+09,9E+09,9E+09,9E+09,9E+09]],[[294.74,1586.2,549.29],[0.0165209,-0.702659,0.00178609,-0.711336],[0,0,-2,0],[9E+09,9E+09,9E+09,9E+09,9E+09,9E+09]],[[294.74,1586.2,549.29],[0.0165209,-0.702659,0.00178609,-0.711336],[0,0,-2,0],[9E+09,9E+09,9E+09,9E+09,9E+09,9E+09]],[[294.74,1586.2,549.29],[0.0165209,-0.702659,0.00178609,-0.711336],[0,0,-2,0],[9E+09,9E+09,9E+09,9E+09,9E+09,9E+09]],[[294.74,1586.2,549.29],[0.0165209,-0.702659,0.00178609,-0.711336],[0,0,-2,0],[9E+09,9E+09,9E+09,9E+09,9E+09,9E+09]],[[294.74,1586.2,549.29],[0.0165209,-0.702659,0.00178609,-0.711336],[0,0,-2,0],[9E+09,9E+09,9E+09,9E+09,9E+09,9E+09]]],[[[294.74,1586.2,549.29],[0.0165209,-0.702659,0.00178609,-0.711336],[0,0,-2,0],[9E+09,9E+09,9E+09,9E+09,9E+09,9E+09]],[[294.74,1586.2,549.29],[0.0165209,-0.702659,0.00178609,-0.711336],[0,0,-2,0],[9E+09,9E+09,9E+09,9E+09,9E+09,9E+09]],[[294.74,1586.2,549.29],[0.0165209,-0.702659,0.00178609,-0.711336],[0,0,-2,0],[9E+09,9E+09,9E+09,9E+09,9E+09,9E+09]],[[294.74,1586.2,549.29],[0.0165209,-0.702659,0.00178609,-0.711336],[0,0,-2,0],[9E+09,9E+09,9E+09,9E+09,9E+09,9E+09]],[[294.74,1586.2,549.29],[0.0165209,-0.702659,0.00178609,-0.711336],[0,0,-2,0],[9E+09,9E+09,9E+09,9E+09,9E+09,9E+09]],[[294.74,1586.2,549.29],[0.0165209,-0.702659,0.00178609,-0.711336],[0,0,-2,0],[9E+09,9E+09,9E+09,9E+09,9E+09,9E+09]]],[[[294.74,1586.2,549.29],[0.0165209,-0.702659,0.00178609,-0.711336],[0,0,-2,0],[9E+09,9E+09,9E+09,9E+09,9E+09,9E+09]],[[294.74,1586.2,549.29],[0.0165209,-0.702659,0.00178609,-0.711336],[0,0,-2,0],[9E+09,9E+09,9E+09,9E+09,9E+09,9E+09]],[[294.74,1586.2,549.29],[0.0165209,-0.702659,0.00178609,-0.711336],[0,0,-2,0],[9E+09,9E+09,9E+09,9E+09,9E+09,9E+09]],[[294.74,1586.2,549.29],[0.0165209,-0.702659,0.00178609,-0.711336],[0,0,-2,0],[9E+09,9E+09,9E+09,9E+09,9E+09,9E+09]],[[294.74,1586.2,549.29],[0.0165209,-0.702659,0.00178609,-0.711336],[0,0,-2,0],[9E+09,9E+09,9E+09,9E+09,9E+09,9E+09]],[[294.74,1586.2,549.29],[0.0165209,-0.702659,0.00178609,-0.711336],[0,0,-2,0],[9E+09,9E+09,9E+09,9E+09,9E+09,9E+09]]],[[[294.74,1586.2,549.29],[0.0165209,-0.702659,0.00178609,-0.711336],[0,0,-2,0],[9E+09,9E+09,9E+09,9E+09,9E+09,9E+09]],[[294.74,1586.2,549.29],[0.0165209,-0.702659,0.00178609,-0.711336],[0,0,-2,0],[9E+09,9E+09,9E+09,9E+09,9E+09,9E+09]],[[294.74,1586.2,549.29],[0.0165209,-0.702659,0.00178609,-0.711336],[0,0,-2,0],[9E+09,9E+09,9E+09,9E+09,9E+09,9E+09]],[[294.74,1586.2,549.29],[0.0165209,-0.702659,0.00178609,-0.711336],[0,0,-2,0],[9E+09,9E+09,9E+09,9E+09,9E+09,9E+09]],[[294.74,1586.2,549.29],[0.0165209,-0.702659,0.00178609,-0.711336],[0,0,-2,0],[9E+09,9E+09,9E+09,9E+09,9E+09,9E+09]],[[294.74,1586.2,549.29],[0.0165209,-0.702659,0.00178609,-0.711336],[0,0,-2,0],[9E+09,9E+09,9E+09,9E+09,9E+09,9E+09]]],[[[294.74,1586.2,549.29],[0.0165209,-0.702659,0.00178609,-0.711336],[0,0,-2,0],[9E+09,9E+09,9E+09,9E+09,9E+09,9E+09]],[[294.74,1586.2,549.29],[0.0165209,-0.702659,0.00178609,-0.711336],[0,0,-2,0],[9E+09,9E+09,9E+09,9E+09,9E+09,9E+09]],[[294.74,1586.2,549.29],[0.0165209,-0.702659,0.00178609,-0.711336],[0,0,-2,0],[9E+09,9E+09,9E+09,9E+09,9E+09,9E+09]],[[294.74,1586.2,549.29],[0.0165209,-0.702659,0.00178609,-0.711336],[0,0,-2,0],[9E+09,9E+09,9E+09,9E+09,9E+09,9E+09]],[[294.74,1586.2,549.29],[0.0165209,-0.702659,0.00178609,-0.711336],[0,0,-2,0],[9E+09,9E+09,9E+09,9E+09,9E+09,9E+09]],[[294.74,1586.2,549.29],[0.0165209,-0.702659,0.00178609,-0.711336],[0,0,-2,0],[9E+09,9E+09,9E+09,9E+09,9E+09,9E+09]]],[[[294.74,1586.2,549.29],[0.0165209,-0.702659,0.00178609,-0.711336],[0,0,-2,0],[9E+09,9E+09,9E+09,9E+09,9E+09,9E+09]],[[294.74,1586.2,549.29],[0.0165209,-0.702659,0.00178609,-0.711336],[0,0,-2,0],[9E+09,9E+09,9E+09,9E+09,9E+09,9E+09]],[[294.74,1586.2,549.29],[0.0165209,-0.702659,0.00178609,-0.711336],[0,0,-2,0],[9E+09,9E+09,9E+09,9E+09,9E+09,9E+09]],[[294.74,1586.2,549.29],[0.0165209,-0.702659,0.00178609,-0.711336],[0,0,-2,0],[9E+09,9E+09,9E+09,9E+09,9E+09,9E+09]],[[294.74,1586.2,549.29],[0.0165209,-0.702659,0.00178609,-0.711336],[0,0,-2,0],[9E+09,9E+09,9E+09,9E+09,9E+09,9E+09]],[[294.74,1586.2,549.29],[0.0165209,-0.702659,0.00178609,-0.711336],[0,0,-2,0],[9E+09,9E+09,9E+09,9E+09,9E+09,9E+09]]],[[[294.74,1586.2,549.29],[0.0165209,-0.702659,0.00178609,-0.711336],[0,0,-2,0],[9E+09,9E+09,9E+09,9E+09,9E+09,9E+09]],[[294.74,1586.2,549.29],[0.0165209,-0.702659,0.00178609,-0.711336],[0,0,-2,0],[9E+09,9E+09,9E+09,9E+09,9E+09,9E+09]],[[294.74,1586.2,549.29],[0.0165209,-0.702659,0.00178609,-0.711336],[0,0,-2,0],[9E+09,9E+09,9E+09,9E+09,9E+09,9E+09]],[[294.74,1586.2,549.29],[0.0165209,-0.702659,0.00178609,-0.711336],[0,0,-2,0],[9E+09,9E+09,9E+09,9E+09,9E+09,9E+09]],[[294.74,1586.2,549.29],[0.0165209,-0.702659,0.00178609,-0.711336],[0,0,-2,0],[9E+09,9E+09,9E+09,9E+09,9E+09,9E+09]],[[294.74,1586.2,549.29],[0.0165209,-0.702659,0.00178609,-0.711336],[0,0,-2,0],[9E+09,9E+09,9E+09,9E+09,9E+09,9E+09]]],[[[294.74,1586.2,549.29],[0.0165209,-0.702659,0.00178609,-0.711336],[0,0,-2,0],[9E+09,9E+09,9E+09,9E+09,9E+09,9E+09]],[[294.74,1586.2,549.29],[0.0165209,-0.702659,0.00178609,-0.711336],[0,0,-2,0],[9E+09,9E+09,9E+09,9E+09,9E+09,9E+09]],[[294.74,1586.2,549.29],[0.0165209,-0.702659,0.00178609,-0.711336],[0,0,-2,0],[9E+09,9E+09,9E+09,9E+09,9E+09,9E+09]],[[294.74,1586.2,549.29],[0.0165209,-0.702659,0.00178609,-0.711336],[0,0,-2,0],[9E+09,9E+09,9E+09,9E+09,9E+09,9E+09]],[[294.74,1586.2,549.29],[0.0165209,-0.702659,0.00178609,-0.711336],[0,0,-2,0],[9E+09,9E+09,9E+09,9E+09,9E+09,9E+09]],[[294.74,1586.2,549.29],[0.0165209,-0.702659,0.00178609,-0.711336],[0,0,-2,0],[9E+09,9E+09,9E+09,9E+09,9E+09,9E+09]]]];

PROC rPickPart()

IF (UserInput6=1) XOR (UseDryCycle=1) THEN

TPErase;

TPWrite "*********************************************************";

TPWrite "*********** Resetting Rack ******************";

TPWrite "*********************************************************";

ResetRack;

ENDIF

WaitUntil GetPickupResult()>=1 OR GetPickupResult()<=3;

TEST GetPickupResult()

CASE Pickup_1:

TPErase;

TPWrite "*********************************************************";

TPWrite "*********** Picking From Left Cart ******************";

TPWrite "*********************************************************";

UBY_R16_Pick_1;

CASE Pickup_2:

TPErase;

TPWrite "*********************************************************";

TPWrite "*********** Picking From Right Cart******************";

TPWrite "*********************************************************";

UBY_R16_Pick_2;

DEFAULT:

TPErase;

TPWrite "*********************************************************";

TPWrite "*********** Wrong Part Position Sent ******************";

TPWrite "*********************************************************";

Stop;

ENDTEST

ENDPROC

PROC rUBY_R16_Pick_1()

!Check Part Presents And Grippers For Pickup

PrepareToGrip\V1;

!Request Enter To Pickup

EnterPickup Pickup_1;

!Set Robot At Pounce Off

SetDO RobotAtPounce,0;

!Reset error counter

NumTries:=0;

!Move the robot to Right Cart Pounce Position

MoveJ r16_Pnce_1,vmax,z200,Toolgrip_DS;

lblNextTry:

TPWrite "*************************************";

TPWrite "Picking from Row:="\Num:=nRow_1;

TPWrite "Picking from Column:="\Num:=nColumn_1;

TPWrite "*************************************";

!Pounce to Before Pick Location

MoveL Offs(pPickCart_1{nRow_1,1},0,0,200),v500,fine,Toolgrip_DS;

!Check for part present

IF (Part1Present=1 AND Part2Present=1) XOR (UseDryCycle=1 AND Part1Present=0 AND Part2Present=0) THEN

MoveL Offs(pPickCart_1{nRow_1,nColumn_1},0,0,50),v150,z1,Toolgrip_DS;

MoveL pPickCart_1{nRow_1,nColumn_1},v10,fine,Toolgrip_DS;

!Set Robot At Pickup 1

SetDO AtPickup1,1;

!Close Grippers

GripPart\V1;

GripLoad load_ds;

!Wait For PLC OK To Exit;

ExitPickup Pickup_1;

!Move Straight Above Cart

MoveL Offs(pPickCart_1{nRow_1,1},0,0,250), v200, z1, Toolgrip_DS;

VerifyPartPres\V1;

!Set Clear of Pickup 1

SetDO ClrOfPickup1,1;

MoveJ r16_Pnce_1,vmax,z200,Toolgrip_DS;

IndexPart_1;

!Move to Common Pounce Drop Location

MoveJ r16DropPnce,vmax,z200,Toolgrip_DS;

ELSE

!Back Out from Part

MoveL Offs(pPickCart_1{nRow_1,1},0,0,150),v150,z1,Toolgrip_DS;

IF NumTries=3 THEN

TPWrite "Part unable to be located";

MoveL Offs(pPickCart_1{nRow_1,1},0,0,200),v500,z200,Toolgrip_DS;

rRack_1_Man_Set;

NumTries:=0;

GOTO lblNextTry;

ELSE

Incr NumTries;

IndexPart_1;

GOTO lblNextTry;

ENDIF

ENDIF

ENDPROC

PROC rUBY_R16_Pick_2()

!Check Part Presents And Grippers For Pickup

PrepareToGrip\V1;

!Request Enter To Pickup

EnterPickup Pickup_2;

!Set Robot At Pounce Off

SetDO RobotAtPounce,0;

!Move to pickup location

SetDO ClrOfPickup2,low;

!Reset error counter

NumTries:=0;

!Move the robot to Right Cart Pounce Position

MoveJ r16_Pnce_2,vmax,z200,Toolgrip_DS;

lblNextTry:

TPWrite "*************************************";

TPWrite "Picking from Row:="\Num:=Row;

TPWrite "Picking from Column:="\Num:=Column;

TPWrite "*************************************";

!Pounce to Before Pick Location

MoveL Offs(r16_Pick_2,PickX+40,0,-PickZ-10),v500,fine,Toolgrip_DS;

!Check for part present

IF (Part1Present=1 AND Part2Present=1) XOR (UseDryCycle=1 AND Part1Present=0 AND Part2Present=0) THEN

MoveL Offs(r16_Pick_2,PickX,0,-PickZ-10),v50,z10,Toolgrip_DS;

MoveL Offs(r16_Pick_2,PickX,0,-PickZ),v10,fine,Toolgrip_DS;

!Set Robot At Pickup 1

SetDO AtPickup2,1;

!Close Grippers

GripPart\V1;

VerifyPartPres\V1;

GripLoad load_ds;

!Wait For PLC OK To Exit;

ExitPickup Pickup_2;

!Move Straight Above Cart

GetTopLocation;

MoveL NextPosition,v500,z100,Toolgrip_DS;

!Set Clear of Pickup 1

SetDO ClrOfPickup2,1;

MoveJ r16_Pnce_2,vmax,z200,Toolgrip_DS;

IF UseDryCycle=0 THEN

!Index part register

IndexPart_2;

ENDIF

!Move to Common Pounce Drop Location

MoveJ r36,vmax,z200,Toolgrip_DS;

MoveJ r16DropPnce,vmax,z200,Toolgrip_DS;

ELSE

!Back Out from Part

MoveL Offs(r16_Pick_2,PickX+40,0,-PickZ-10),v500,z100,Toolgrip_DS;

IF NumTries=3 THEN

TPWrite "Part unable to be located";

MoveJ Offs(r16_Pnce_2,0,0,200),vmax,z200,Toolgrip_DS;

Break;

ELSE

Incr NumTries;

IndexPart_2;

GOTO lblNextTry;

ENDIF

ENDIF

ENDPROC

PROC IndexPart_1()

!Gets Current Part Location and Indexes Position to next part

!Find out if last row is being picked

IF bLastPick_1 THEN

ResetRack_1;

bLastPick_1:=FALSE;

ELSEIF nRow_1<=12 AND nColumn_1<6 THEN

Incr nColumn_1;

ELSEIF nRow_1<=11 AND nColumn_1=6 THEN

Incr nRow_1;

nColumn_1:=1;

ENDIF

IF nRow_1>=12 AND nColumn_1>=6 bLastPick_1:=TRUE;

ENDPROC

PROC IndexPart_2()

!Gets Current Part Location and Indexes Position to next part

!Find out if last row is being picked

IF bLastPick_2 THEN

ResetRack_2;

bLastPick_2:=FALSE;

ELSEIF nRow_2<=12 AND nColumn_2<6 THEN

Incr nColumn_2;

ELSEIF nRow_2<=11 AND nColumn_2=6 THEN

Incr nRow_2;

nColumn_2:=1;

ENDIF

IF nRow_2>=12 AND nColumn_2>=6 bLastPick_2:=TRUE;

ENDPROC

PROC rTeachLeftPick()

VAR num nDummy := 0;

!Procedure for teaching the Left pick position

MoveJ pPickCart_1{1,1}, v100, fine, Toolgrip_DS;

TPReadFK nDummy, "Do you wish to apply this position modification to all subsequent positions?", "YES", stEmpty, stEmpty, stEmpty, "NO";

TEST nDummy

CASE 1:

FOR i FROM 1 TO 12 DO

FOR j FROM 1 TO 6 DO

pPickCart_1{i,j}.trans.z:=pPickCart_1{1,1} .trans.z-((j-1)*zToPart);

ENDFOR

ENDFOR

FOR i FROM 1 TO 12 DO

FOR j FROM 1 TO 6 DO

pPickCart_1{i,j}.trans.x:=pPickCart_1{1,1} .trans.x-((i-1)*xToPart);

ENDFOR

ENDFOR

DEFAULT:

! Do nothing. All other positions in the array go unchanged.

ENDTEST

ENDPROC

PROC rTeachRightPick()

VAR num nDummy := 0;

!Procedure for teaching the Right pick position

MoveJ pPickCart_2{1,1}, v100, fine, Toolgrip_DS;

TPReadFK nDummy, "Do you wish to apply this position modification to all subsequent positions?", "YES", stEmpty, stEmpty, stEmpty, "NO";

TEST nDummy

CASE 1:

FOR i FROM 1 TO 12 DO

FOR j FROM 1 TO 6 DO

pPickCart_2{i,j}.trans.z:=pPickCart_2{1,1} .trans.z-((j-1)*zToPart);

ENDFOR

ENDFOR

FOR i FROM 1 TO 12 DO

FOR j FROM 1 TO 6 DO

pPickCart_2{i,j}.trans.x:=pPickCart_2{1,1} .trans.x-((i-1)*xToPart);

ENDFOR

ENDFOR

DEFAULT:

! Do nothing. All other positions in the array go unchanged.

ENDTEST

ENDPROC

PROC ResetRack_1()

!This Procedure will Reset all offsets for the Rack to 0

nRow_1:=1;

nColumn_1:=1;

ENDPROC

PROC ResetRack_2()

!This Procedure will Reset all offsets for the Rack to 0

nRow_2:=1;

nColumn_2:=1;

ENDPROC

PROC rRack_1_Man_Set()

VAR num nDummy := 0;

TPReadFK nDummy, "Would you like to choose the start position?", "YES", stEmpty, stEmpty, stEmpty, "NO";

TEST nDummy

CASE 1:

lblRetryRow:

TPReadNum nDummy, "Please enter row 1-12 on keypad.";

TEST nDummy

CASE 1,2,3,4,5,6,7,8,9,10,11,12:

nRow_1 := nDummy;

DEFAULT:

TPWrite "I'm sorry, that response is not valid.";

GOTO lblRetryRow;

ENDTEST

lblRetryColumn:

TPReadNum nDummy, "Please enter column 1-6 on keypad.";

TEST nDummy

CASE 1,2,3,4,5,6:

nColumn_1 := nDummy;

DEFAULT:

TPWrite "I'm sorry, that response is not valid.";

GOTO lblRetryColumn;

ENDTEST

DEFAULT:

MoveL Offs(pPickCart_1{nRow_1,1},0,0,250), v200, z1, Toolgrip_DS;

MoveJ r16_Pnce_1, v3000, z200, Toolgrip_DS;

ExitCycle;

ENDTEST

ENDPROC

ENDMODULE


Now we should all know that there are often times several different was to program and achieve the same result. Some are clean, others less so. I am not saying that the first method is wrong, it just did not fit my style. He/she programmed the math necessary to modify the X and Z to move though the cart. I preferred to have the robtarget array on which I did the math to adjust all the positions in the array. Here I am thinking that leaves flexibility to teach some individual points which maybe are problematic, the math just doesn't make it work. Maybe some positions become different due to wear or damage, who knows? Whichever your programming style, I hope you can take away some useful knowledge from both of these examples.


Next up, I later used the same program, somewhat improved, to pick parts from trays.