Hello ,
I have a project with 3 infeeder conveyors, with the 3 workareas.
I’d like to pick always the first Item that is closer to the exit point comparing the 3 work areas.
Any suggestion?
Best Regards
Oscar
Hello ,
I have a project with 3 infeeder conveyors, with the 3 workareas.
I’d like to pick always the first Item that is closer to the exit point comparing the 3 work areas.
Any suggestion?
Best Regards
Oscar
Hi Oscar,
The idea that comes to my mind is to pop all the itemsources with GetitmTgt and a timeout to retrive all the itemtargets. Then check all the itemtargets’ position in the world coordinate system by calling GetWorldPos in the attached utility module. After that you have to make your decision on which to go for. All the other itemtargets must be returned with AckItmTgt …,…,FALSE;
Good Luck!
/Mats
Ok, Thanks
Oscar
Hello Oscar,
Here is a piece of code I wrote for another installation. It is for two workareas but it can easily be modified to check the x value for three areas.
PROC PickPlaceSeq()
VAR bool to1;
VAR bool to2;
VAR num x1;
VAR num x2;
Coordinated;
GetItmTgt ItmSrcData{PickIndex{1}}.ItemSource,PickTargetMaxTime:=0.05TimeFlag:=to1;
IF to1 THEN
x1:=-9000;
ELSE
x1:=GetRealPos(PickIndex{1}, PickTarget);
AckItmTgt ItmSrcData{PickIndex{1}}.ItemSource,PickTarget,FALSE;
ENDIF
GetItmTgt ItmSrcData{PickIndex{2}}.ItemSource,PickTargetMaxTime:=0.05TimeFlag:=to2;
IF to2 THEN
x2:=-10000;
ELSE
x2:=GetRealPos(PickIndex{2}, PickTarget);
AckItmTgt ItmSrcData{PickIndex{2}}.ItemSource,PickTarget,FALSE;
ENDIF
IF x1 >= x2 THEN
IF to1=FALSE THEN
Pick PickIndex{1};
ENDIF
ELSE
IF to2=FALSE THEN
Pick PickIndex{2};
ENDIF
ENDIF
IF to1=TRUE AND to2=TRUE THEN
WaitTime 0.1;
ELSE
Place PlaceIndex{1};
ENDIF
ENDPROC
/Roger.