Programming movement based on different product codes

Hello everyone

Currently i’m programming a robotized cell with an Irb6700 and a conveyor. This cells need to manage different types of products and every one has a different grab position.

I was thinking on how i could organize the rapid code in the best way.

The first thing it came up in my mind is to create a function that return a robtarget “generalGrabPose” based on the product code and then use a single instruction MoveL to this robtarget.

Something like:

Pers num serialNumber;

Pers robtarget generalGrabPosition;

Pers robtarget grabPosition1, … , grabPosition10;

Test serialNumber

Case 1

generalGrabPose := grabPosition1;

Case 2

generalGrabPose := grabPosition2;

Case 10

generalGrabPose := grabPosition10;

Endtest

MoveL generalGrabPose, v100, fine, tool0, wobj0;

But on the other side, if i need to adjust an offset for the position with the flexpendant i can’t modify the single moveL instruction, otherwise i would change every position…

I could need a long test-case with different MoveL instruction, so i could change the single offs for every robtarget.

For example:

Test serialNumber

Case 1

MoveL offs(grabPosition1,0,0,0), v100, fine, tool0, wobj0;

Case 2

MoveL offs(grabPosition2,0,0,0), v100, fine, tool0, wobj0;

Case 10

MoveL offs(grabPosition10,0,0,0), v100, fine, tool0, wobj0;

Endtest

In this way, anyone could change the offset value to rapidly adjust a position, but i don’t like pretty much this option.

Is there a better way to organize it? Or some inbuild function to help me?

Thanks.

Hi Simone,

It looks like you can Modify position on the right hand side of the := operator but not the left, so you should be fine with your original plan if you select GrabPosition1 by itself:


If I select the left hand side of the := operator I cannot modify it, but the right hand side as shown here I can.

Does that work for you?

Regards,

Harry

Yes it works.
Thanks for your feedback, i will stick to my first idea.

I know this is a too late response, but I thought I’d share an example of how this is possible to do in a (in my opinion) pretty neat way using GetDataVal and SetDataVal:

MODULE TestMod

PERS robtarget pPickObject_1:=[[100,200,300],[1,0,0,0],[0,0,0,0],[9E9,9E9,9E9,9E9,9E9,9E9]];
PERS robtarget pPickObject_2:=[[100,150,300],[1,0,0,0],[0,0,0,0],[9E9,9E9,9E9,9E9,9E9,9E9]];
PERS robtarget pPickObject_3:=[[150,200,300],[1,0,0,0],[0,0,0,0],[9E9,9E9,9E9,9E9,9E9,9E9]];
PERS robtarget pPickObject_4:=[[180,180,280],[1,0,0,0],[0,0,0,0],[9E9,9E9,9E9,9E9,9E9,9E9]];

VAR robtarget pTempPickObject_VAR;
PERS robtarget pTempPickObject:=[[0,0,0],[1,0,0,0],[0,0,0,0],[9E9,9E9,9E9,9E9,9E9,9E9]];

PERS num nSerialNumber:=2;

PROC PickObject()

!Update temporary robtarget
GetDataVal “pPickObject_”+ValToStr(nSerialNumber),pTempPickObject_VAR;
!Set Persistent data to enable ModPos
pTempPickObject:=pTempPickObject_VAR;

!Move robot to position, this line is possible to select for “Modify Position”
MoveJ pTempPickObject,v100,fine,tool0;

!Write back to the original robtarget in case TempPick was modified
pTempPickObject_VAR:=pTempPickObject;
SetDataVal “pPickObject_”+ValToStr(nSerialNumber),pTempPickObject_VAR;

RETURN ;

ENDPROC
ENDMODULE

Hope this can be helpful to someone!