# Item Offset Does Nothing  \[PickMaster 5\]

**URL:** <https://tech-community.robotics.abb.com/t/item-offset-does-nothing-pickmaster-5/3884>\
**Category:** PickMaster\
**Created:** [October 28, 2010, 3:51am UTC](https://tech-community.robotics.abb.com/t/item-offset-does-nothing-pickmaster-5/3884 "2010-10-28T03:51:14Z")\
**Posts on this page:** 17\
**Page:** 1

<div class="post-metadata">

**Author:** ![JohnV](https://avatars.discourse-cdn.com/v4/letter/j/e47774/32.png) [@JohnV](https://tech-community.robotics.abb.com/u/JohnV)\
**Post date:** [October 28, 2010, 3:51am UTC](https://tech-community.robotics.abb.com/t/item-offset-does-nothing-pickmaster-5/3884/1 "2010-10-28T03:51:14Z")

</div>

When adjusting Item Offset, the tool is not changing the drop off position. We are palletizing bags, and due to the inconsistencies of the bags, different layers need different item offsets. I have a feeling it has to do with some MinZ and MaxZ formulas shown below.

webwiz/3040/MoveInterMid-Custom.zip

IF (FromRobTgt.trans.z\<ToRobTgt.trans.z) AND (MinZ\<ToRobTgt.trans.z) THEN  
MinZ:=ToRobTgt.trans.z;  
ELSEIF (ToRobTgt.trans.z\<FromRobTgt.trans.z) AND (MinZ\<FromRobTgt.trans.z) THEN  
MinZ:=FromRobTgt.trans.z;  
ENDIF  
IF MaxZLimit\<MinZ THEN  
MinZ:=MaxZLimit;  
ENDIF

---

<div class="post-metadata">

**Author:** ![Mats\_W](https://avatars.discourse-cdn.com/v4/letter/m/df705f/32.png) [@Mats\_W](https://tech-community.robotics.abb.com/u/Mats_W)\
**Post date:** [October 28, 2010, 5:34am UTC](https://tech-community.robotics.abb.com/t/item-offset-does-nothing-pickmaster-5/3884/2 "2010-10-28T05:34:20Z")

</div>

Hi John

The code you are referring to is only handling the intermediate path.  
That has nothing to do with the drop off position.

BR  
/Mats

---

<div class="post-metadata">

**Author:** ![JohnV](https://avatars.discourse-cdn.com/v4/letter/j/e47774/32.png) [@JohnV](https://tech-community.robotics.abb.com/u/JohnV)\
**Post date:** [October 28, 2010, 1:27pm UTC](https://tech-community.robotics.abb.com/t/item-offset-does-nothing-pickmaster-5/3884/3 "2010-10-28T13:27:32Z")

</div>

What else could be keeping the item offset from not working? It works on some products, but others, it does not change anything at all. We have even tried large numbers such as 500mm and no change.

Is there any other way to change this?

---

<div class="post-metadata">

**Author:** ![AndersL](https://avatars.discourse-cdn.com/v4/letter/a/8baadc/32.png) [@AndersL](https://tech-community.robotics.abb.com/u/AndersL)\
**Post date:** [November 2, 2010, 1:55pm UTC](https://tech-community.robotics.abb.com/t/item-offset-does-nothing-pickmaster-5/3884/4 "2010-11-02T13:55:45Z")

</div>

Hi John,  
the Item Offset for a layer in a pallet pattern operation set does not affect the pick/place location. It just modifies the approach height when the robot shall place items (general offset). There is currently no built-in runtime function to explicitly modify the pick/place location for individual layers. However, you can achieve a similar result by tuning the item heights. You can also modify the the place height for different layers by modifications in Rapid. I have no example code though to show you.

best regards,  
Anders

---

<div class="post-metadata">

**Author:** ![JohnV](https://avatars.discourse-cdn.com/v4/letter/j/e47774/32.png) [@JohnV](https://tech-community.robotics.abb.com/u/JohnV)\
**Post date:** [November 16, 2010, 11:23pm UTC](https://tech-community.robotics.abb.com/t/item-offset-does-nothing-pickmaster-5/3884/5 "2010-11-16T23:23:42Z")

</div>

Do you know where in the rapid this could be done? I am thinking about making a variable number that can come from the PLC so we can modify this from the touchscreen.

If we tune the item height, that tunes the pick also.

---

<div class="post-metadata">

**Author:** ![JohnV](https://avatars.discourse-cdn.com/v4/letter/j/e47774/32.png) [@JohnV](https://tech-community.robotics.abb.com/u/JohnV)\
**Post date:** [November 23, 2010, 5:41pm UTC](https://tech-community.robotics.abb.com/t/item-offset-does-nothing-pickmaster-5/3884/6 "2010-11-23T17:41:38Z")

</div>

We are continuing to have problems and need someway to modify the drop position. Should we re-write the program all in rapid to fix this?

---

<div class="post-metadata">

**Author:** ![Mats\_W](https://avatars.discourse-cdn.com/v4/letter/m/df705f/32.png) [@Mats\_W](https://tech-community.robotics.abb.com/u/Mats_W)\
**Post date:** [November 23, 2010, 6:36pm UTC](https://tech-community.robotics.abb.com/t/item-offset-does-nothing-pickmaster-5/3884/7 "2010-11-23T18:36:49Z")

</div>

Hi John

An idea would be to write some custom code manipulating the target when fetched out to rapid.  
After the execution of PmGetTgtAction, the rapid has full control of the robtarget (Act.RobTgt). You can then add an offset to the Z value, as a product of a tune value and the layer number.  
Example:

WHILE PmGetTgtAction(WorkArea, Tgt.TargetHandle,Act) DO  
PmCalcArmConf Act.RobTgt,Tgt.TargetTool,Tgt.TargetWobjcf6MaxAngle:=MaxToolAngleMinAngle:=MinToolAngle;  
**Act.RobTgt.trans.z:=Act.RobTgt.trans.z+TuneZ\*Tgt.LayerNumber;**  
IF FirstTgtInOp AND (NOT MultiOperation) THEN  
MoveInterMid WorkArea,Tgt,Act,PmSafetyOffsetZMaxAngle:=MaxToolAngleMinAngle:=MinToolAngle;  
FirstTgtInOp:=FALSE;  
ENDIF  
PmDoAction WorkArea,Tgt,Act;  
SetLastPos WorkArea,Tgt,Act;  
ENDWHILE

---

<div class="post-metadata">

**Author:** ![JohnV](https://avatars.discourse-cdn.com/v4/letter/j/e47774/32.png) [@JohnV](https://tech-community.robotics.abb.com/u/JohnV)\
**Post date:** [November 23, 2010, 7:52pm UTC](https://tech-community.robotics.abb.com/t/item-offset-does-nothing-pickmaster-5/3884/8 "2010-11-23T19:52:23Z")

</div>

Mats-

Thanks. I want to make this a variable that the PLC can send to the robot. I can let the PLC keep track of what layer we are on so I do not need to multiply by Tgt.LayerNumber. This will allow independent control of each layer.  
Will this work for X & Y offset too of the drop position?(See below)

WHILE PmGetTgtAction(WorkArea, Tgt.TargetHandle,Act) DO  
PmCalcArmConf Act.RobTgt,Tgt.TargetTool,Tgt.TargetWobjcf6MaxAngle:=MaxToolAngleMinAngle:=MinToolAngle;  
**Act.RobTgt.trans.x:=Act.RobTgt.trans.x+VarXFromPLC;**

**Act.RobTgt.trans.y:=Act.RobTgt.trans.y+VarYFromPLC;**

**Act.RobTgt.trans.z:=Act.RobTgt.trans.z+VarZFromPLC;**  
IF FirstTgtInOp AND (NOT MultiOperation) THEN  
MoveInterMid WorkArea,Tgt,Act,PmSafetyOffsetZMaxAngle:=MaxToolAngleMinAngle:=MinToolAngle;  
FirstTgtInOp:=FALSE;  
ENDIF  
PmDoAction WorkArea,Tgt,Act;  
SetLastPos WorkArea,Tgt,Act;  
ENDWHILE

---

<div class="post-metadata">

**Author:** ![Mats\_W](https://avatars.discourse-cdn.com/v4/letter/m/df705f/32.png) [@Mats\_W](https://tech-community.robotics.abb.com/u/Mats_W)\
**Post date:** [November 23, 2010, 8:02pm UTC](https://tech-community.robotics.abb.com/t/item-offset-does-nothing-pickmaster-5/3884/9 "2010-11-23T20:02:57Z")

</div>

Sure, it’s the freedom of rapid!

---

<div class="post-metadata">

**Author:** ![JohnV](https://avatars.discourse-cdn.com/v4/letter/j/e47774/32.png) [@JohnV](https://tech-community.robotics.abb.com/u/JohnV)\
**Post date:** [January 7, 2011, 2:15am UTC](https://tech-community.robotics.abb.com/t/item-offset-does-nothing-pickmaster-5/3884/10 "2011-01-07T02:15:38Z")

</div>

With the below statement, what coordinate system does this use? Is it the base or tool we would be adjusting?

Can we transfer variables in integer format via Ethernet fieldbus adapter?

WHILE PmGetTgtAction(WorkArea, Tgt.TargetHandle,Act) DO  
PmCalcArmConf Act.RobTgt,Tgt.TargetTool,Tgt.TargetWobjcf6MaxAngle:=MaxToolAngleMinAngle:=MinToolAngle;  
**Act.RobTgt.trans.x:=Act.RobTgt.trans.x+VarXFromPLC;**

**Act.RobTgt.trans.y:=Act.RobTgt.trans.y+VarYFromPLC;**

**Act.RobTgt.trans.z:=Act.RobTgt.trans.z+VarZFromPLC;**

---

<div class="post-metadata">

**Author:** ![Mats\_W](https://avatars.discourse-cdn.com/v4/letter/m/df705f/32.png) [@Mats\_W](https://tech-community.robotics.abb.com/u/Mats_W)\
**Post date:** [January 10, 2011, 4:26pm UTC](https://tech-community.robotics.abb.com/t/item-offset-does-nothing-pickmaster-5/3884/11 "2011-01-10T16:26:24Z")

</div>

It’s the Wobj, or other pending on frame offsets in PickMaster.

If you declare I/O-groups in the EIP unit, it will probably work.

/M

---

<div class="post-metadata">

**Author:** ![JohnV](https://avatars.discourse-cdn.com/v4/letter/j/e47774/32.png) [@JohnV](https://tech-community.robotics.abb.com/u/JohnV)\
**Post date:** [January 29, 2011, 12:09am UTC](https://tech-community.robotics.abb.com/t/item-offset-does-nothing-pickmaster-5/3884/12 "2011-01-29T00:09:03Z")

</div>

Mats-

This offset worked, however it affects every work area (infeeder, slipsheet, outfeeder, etc). What is the easiest way to only have this work on outfeeder? I did something along the lines of:  
sWAName := PmGetWaName (WorkArea);  
nOutfeeder1 := StrMatch(sWAName, 1, “Outfeeder1\_Conveyor”);

IF nOutfeed1Found = 1 THEN  
IF Act.Type = PM\_TARGET\_POS THEN  
Act.RobTgt.trans.z:=Act.RobTgt.trans.z+VAR\_PLC\_Z;  
ENDIF  
This was done in

---

<div class="post-metadata">

**Author:** ![Mats\_W](https://avatars.discourse-cdn.com/v4/letter/m/df705f/32.png) [@Mats\_W](https://tech-community.robotics.abb.com/u/Mats_W)\
**Post date:** [January 31, 2011, 1:18pm UTC](https://tech-community.robotics.abb.com/t/item-offset-does-nothing-pickmaster-5/3884/13 "2011-01-31T13:18:08Z")

</div>

Yes, your code isolates the tune to tha certain workarea.  
Another way is to set an offset on the object frame of the workobject used at the workarea in question.

/M

---

<div class="post-metadata">

**Author:** ![JohnV](https://avatars.discourse-cdn.com/v4/letter/j/e47774/32.png) [@JohnV](https://tech-community.robotics.abb.com/u/JohnV)\
**Post date:** [February 1, 2011, 5:18pm UTC](https://tech-community.robotics.abb.com/t/item-offset-does-nothing-pickmaster-5/3884/14 "2011-02-01T17:18:14Z")

</div>

Mats-

See below. The black text is what exists. The red is what I am looking at adding. Can you help confirm if this will work?

!\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*

!

! Procedure Operate

!

! This routine executes one operation. It pops one

! operation and execute all its targets and actions.

! Before moving towards every first target in the

! operation, the robot will go to a intermediate position.

!

! Arguments:

! IN:

! pm\_wadescr WorkArea

!

!\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*

PROC Operate(VAR pm\_wadescr WorkArea)

VAR pm\_operationdata Op;

VAR pm\_targetdata Tgt;

VAR pm\_actiondata Act;

VAR bool FirstTgtInOp:=TRUE;

VAR string sWAName;

VAR num nPallet1Found;

VAR num nInfeeder1Found;

VAR num nOutfeeder1Found;

VAR num nOffsetXFromPLC;

VAR num nOffsetYFromPLC;

VAR num nOffsetZFromPLC;

! check which work area

sWAName := PmGetWaName (WorkArea);

! defines pallet as current work area

nPallet1Found := StrMatch(sWAName, 1, “Pallet1”);

! defines infeeder as current work area

nInfeeder1Found := StrMatch(sWAName, 1, “Infeeder1”);

PmGetOperation WorkArea, Op;

WHILE PmGetTarget(WorkAreaOpHandle:=Op.OpHandle,Tgt) DO

! closes up tool when work area is pallet

IF nPallet1Found = 1 THEN

SetGo pmGripper1\_goActivators, 103;

ENDIF

! opens tool when approaching infeeder

!IF nInfeeder1Found = 1 THEN

! SetDO doPalletHooksOpen, 0;

! SetDO doPalletHooksClose, 1;

! SetGO SDelay := 1, pmGripper1\_goActivators, 31;

!ENDIF

WHILE PmGetTgtAction(WorkArea, Tgt.TargetHandle,Act) DO

!!Sets the offset from a group input

nOffsetXFromPLC:=giOffsettXPLC\_IO;

nOffsetYFromPLC:=giOffsettYPLC\_IO;

nOffsetZFromPLC:=giOffsettZPLC\_IO;

PmCalcArmConf Act.RobTgt,Tgt.TargetTool,Tgt.TargetWobjcf6MaxAngle:=MaxToolAngleMinAngle:=MinToolAngle;

IF nOutfeeder1Found = 1 THEN

Act.RobTgt.trans.x:=Act.RobTgt.trans.x+nOffsetXFromPLC;

Act.RobTgt.trans.y:=Act.RobTgt.trans.y+nOffsetYFromPLC;

Act.RobTgt.trans.z:=Act.RobTgt.trans.z+nOffsetZFromPLC;

ENDIF

IF FirstTgtInOp AND (NOT MultiOperation) THEN

MoveInterMid WorkArea,Tgt,Act,PmSafetyOffsetZMaxAngle:=MaxToolAngleMinAngle:=MinToolAngle;

FirstTgtInOp:=FALSE;

ENDIF

PmDoAction WorkArea,Tgt,Act;

SetLastPos WorkArea,Tgt,Act;

ENDWHILE

ENDWHILE

MultiOperation:=FALSE;

ERROR

TEST ERRNO

CASE PM\_ERR\_PALLET\_REDUCED:

RAISE;

CASE PM\_ERR\_PALLET\_EMPTY:

RAISE;

ENDTEST

ENDPROC

ENDMODULE

---

<div class="post-metadata">

**Author:** ![Mats\_W](https://avatars.discourse-cdn.com/v4/letter/m/df705f/32.png) [@Mats\_W](https://tech-community.robotics.abb.com/u/Mats_W)\
**Post date:** [February 2, 2011, 9:19am UTC](https://tech-community.robotics.abb.com/t/item-offset-does-nothing-pickmaster-5/3884/15 "2011-02-02T09:19:24Z")

</div>

I would prefer that you put the last red section above the PmCalcArmConf call, just to take the right position in consideration when the arm configuration is calculated.

---

<div class="post-metadata">

**Author:** ![JohnV](https://avatars.discourse-cdn.com/v4/letter/j/e47774/32.png) [@JohnV](https://tech-community.robotics.abb.com/u/JohnV)\
**Post date:** [February 16, 2011, 2:20am UTC](https://tech-community.robotics.abb.com/t/item-offset-does-nothing-pickmaster-5/3884/16 "2011-02-16T02:20:37Z")

</div>

Everything is great, but we cant pass negative numbers via this method. How do you suggest doing that if we need a negative 50 in one direction?

---

<div class="post-metadata">

**Author:** ![Mats\_W](https://avatars.discourse-cdn.com/v4/letter/m/df705f/32.png) [@Mats\_W](https://tech-community.robotics.abb.com/u/Mats_W)\
**Post date:** [February 16, 2011, 7:56pm UTC](https://tech-community.robotics.abb.com/t/item-offset-does-nothing-pickmaster-5/3884/17 "2011-02-16T19:56:39Z")

</div>

Ahh, a traditionally unsigned/signed problem.  
Add another bit for the sign.
