# Any suggestions to program two palletizing zones?

**URL:** <https://tech-community.robotics.abb.com/t/any-suggestions-to-program-two-palletizing-zones/8381>\
**Category:** RobotStudio\
**Tags:** developers, robotstudio, rapid, d\
**Created:** [July 21, 2018, 11:48pm UTC](https://tech-community.robotics.abb.com/t/any-suggestions-to-program-two-palletizing-zones/8381 "2018-07-21T23:48:45Z")\
**Posts on this page:** 15\
**Page:** 1

<div class="post-metadata">

**Author:** ![Christopher\_Pp](https://avatars.discourse-cdn.com/v4/letter/c/e47c2d/32.png) [@Christopher\_Pp](https://tech-community.robotics.abb.com/u/Christopher_Pp)\
**Post date:** [July 21, 2018, 11:48pm UTC](https://tech-community.robotics.abb.com/t/any-suggestions-to-program-two-palletizing-zones/8381/1 "2018-07-21T23:48:45Z")

</div>

What about you guys? How are you?

I am looking for suggestions on how to program in RAPID two areas of palletizing (as the image shows). Any way to alternate between both infeeders so that the robot works simultaneously in both zones? I need the product that arrives first, regardless of which side (right or left), leave the second as in queue, then be taken and palletized. (With the powerpac of palletizing it is easy to develop it, but point by point I can not deduce it yet)

I hope I have expressed myself correctly and can understand me.

Best regards, I hope your help … Thank you very much!

 ![image.jpg](https://europe1.discourse-cdn.com/flex005/uploads/robotics1/original/2X/c/c757014cd419467862f9cb722e42c2ae0889a7f6.jpeg)

---

<div class="post-metadata">

**Author:** ![soup](https://dub1.discourse-cdn.com/flex005/user_avatar/tech-community.robotics.abb.com/soup/32/1592_2.png) [@soup](https://tech-community.robotics.abb.com/u/soup)\
**Post date:** [July 23, 2018, 12:48pm UTC](https://tech-community.robotics.abb.com/t/any-suggestions-to-program-two-palletizing-zones/8381/2 "2018-07-23T12:48:39Z")

</div>

No problem.

Some simple conditional logic can decide which infeed to pick from:

WaitUntil diInfeeder1\_PickRequest = 1 OR diInfeeder2\_PickRequest = 1;  
IF diInfeeder1\_PickRequest = 1 THEN  
…call pick routines  
ELSEIF diInfeeder2\_PickRequest = 1 THEN  
…call pick routines  
ENDIF

And if the robot must pass over a half full outfeed to get to the calling infeed use the item count to calculate the offset height of intermid positions:

MoveL Offs(intermid1, 0, 0, (Outfeeder1\_LayerCount \* Outfeeder1\_ProductHeight)+Clearance), vIntermid, zIntermid, Gripper1;

---

<div class="post-metadata">

**Author:** ![DenisFR](https://avatars.discourse-cdn.com/v4/letter/d/dc4da7/32.png) [@DenisFR](https://tech-community.robotics.abb.com/u/DenisFR)\
**Post date:** [July 24, 2018, 9:59am UTC](https://tech-community.robotics.abb.com/t/any-suggestions-to-program-two-palletizing-zones/8381/3 "2018-07-24T09:59:20Z")

</div>

Hello,  
And if you want to check that only one is high you can do like this:

```auto

WaitUntil diInfeeder1_PickRequest <> diInfeeder2_PickRequest;

```

And, for testing DI/DO prefer to use high and low constant than 1 or 0. It’s more readable.

---

<div class="post-metadata">

**Author:** ![lemster68](https://dub1.discourse-cdn.com/flex005/user_avatar/tech-community.robotics.abb.com/lemster68/32/1945_2.png) [@lemster68](https://tech-community.robotics.abb.com/u/lemster68)\
**Post date:** [July 24, 2018, 12:11pm UTC](https://tech-community.robotics.abb.com/t/any-suggestions-to-program-two-palletizing-zones/8381/4 "2018-07-24T12:11:38Z")

</div>

> [@DenisFR](#):
>
> Hello,  
> And if you want to check that only one is high you can do like this:
> 
> ```auto
> 
> WaitUntil diInfeeder1_PickRequest <> diInfeeder2_PickRequest;
> 
> ```
> 
> And, for testing DI/DO prefer to use high and low constant than 1 or 0. It’s more readable.

But if both are on @@DenisFR , then you are stuck forever, right?

---

<div class="post-metadata">

**Author:** ![lemster68](https://dub1.discourse-cdn.com/flex005/user_avatar/tech-community.robotics.abb.com/lemster68/32/1945_2.png) [@lemster68](https://tech-community.robotics.abb.com/u/lemster68)\
**Post date:** [July 24, 2018, 2:14pm UTC](https://tech-community.robotics.abb.com/t/any-suggestions-to-program-two-palletizing-zones/8381/5 "2018-07-24T14:14:33Z")

</div>

Do you have multitasking? As I read your question I understand that you want FIFO, none of the proposed solutions are going to work for that.

---

<div class="post-metadata">

**Author:** ![DenisFR](https://avatars.discourse-cdn.com/v4/letter/d/dc4da7/32.png) [@DenisFR](https://tech-community.robotics.abb.com/u/DenisFR)\
**Post date:** [July 24, 2018, 2:14pm UTC](https://tech-community.robotics.abb.com/t/any-suggestions-to-program-two-palletizing-zones/8381/6 "2018-07-24T14:14:51Z")

</div>

Only waiting for diInfeeder1\_PickRequest = high XOR diInfeeder2\_PickRequest = high.

diInfeeder1\_PickRequest= low and diInfeeder2\_PickRequest = low =\> Still waiting (0=0)

diInfeeder1\_PickRequest= high and diInfeeder2\_PickRequest = high =\> Still waiting (1=1)

diInfeeder1\_PickRequest= high and diInfeeder2\_PickRequest = low=\> Continue (1\<\>0)

diInfeeder1\_PickRequest= low and diInfeeder2\_PickRequest = high =\> Continue (0\<\>1)

---

<div class="post-metadata">

**Author:** ![lemster68](https://dub1.discourse-cdn.com/flex005/user_avatar/tech-community.robotics.abb.com/lemster68/32/1945_2.png) [@lemster68](https://tech-community.robotics.abb.com/u/lemster68)\
**Post date:** [July 24, 2018, 2:20pm UTC](https://tech-community.robotics.abb.com/t/any-suggestions-to-program-two-palletizing-zones/8381/7 "2018-07-24T14:20:21Z")

</div>

Sorry, part of my reply was cut off. Yes, if both are on, then stuck waiting forever.

---

<div class="post-metadata">

**Author:** ![DenisFR](https://avatars.discourse-cdn.com/v4/letter/d/dc4da7/32.png) [@DenisFR](https://tech-community.robotics.abb.com/u/DenisFR)\
**Post date:** [July 24, 2018, 4:18pm UTC](https://tech-community.robotics.abb.com/t/any-suggestions-to-program-two-palletizing-zones/8381/8 "2018-07-24T16:18:24Z")

</div>

> [@DenisFR](#):
>
> And if you want to check that only one is high you can do like this:

… 😉

---

<div class="post-metadata">

**Author:** ![soup](https://dub1.discourse-cdn.com/flex005/user_avatar/tech-community.robotics.abb.com/soup/32/1592_2.png) [@soup](https://tech-community.robotics.abb.com/u/soup)\
**Post date:** [July 24, 2018, 4:29pm UTC](https://tech-community.robotics.abb.com/t/any-suggestions-to-program-two-palletizing-zones/8381/9 "2018-07-24T16:29:01Z")

</div>

@DenisFR Wow! That is a way. :bawling: Similarly, you could probably only allow one trigger signal high at a time with some cross connect logic. (other ways too: conveyor logic could hold up the product, the speed of the line might not make it an issue anyways, use a trap or multitasking to create a queue, etc., etc…)

---

<div class="post-metadata">

**Author:** ![Christopher\_Pp](https://avatars.discourse-cdn.com/v4/letter/c/e47c2d/32.png) [@Christopher\_Pp](https://tech-community.robotics.abb.com/u/Christopher_Pp)\
**Post date:** [July 24, 2018, 7:07pm UTC](https://tech-community.robotics.abb.com/t/any-suggestions-to-program-two-palletizing-zones/8381/10 "2018-07-24T19:07:06Z")

</div>

> [@DenisFR](#):
>
> Only waiting for diInfeeder1\_PickRequest = high XOR diInfeeder2\_PickRequest = high.
> 
> diInfeeder1\_PickRequest= low and diInfeeder2\_PickRequest = low =\> Still waiting (0=0)
> 
> diInfeeder1\_PickRequest= high and diInfeeder2\_PickRequest = high =\> Still waiting (1=1)
> 
> diInfeeder1\_PickRequest= high and diInfeeder2\_PickRequest = low=\> Continue (1\<\>0)
> 
> diInfeeder1\_PickRequest= low and diInfeeder2\_PickRequest = high =\> Continue (0\<\>1)

If both zones are in high status, you must be able to decide for one, and then continue with the next … 🙂

---

<div class="post-metadata">

**Author:** ![Christopher\_Pp](https://avatars.discourse-cdn.com/v4/letter/c/e47c2d/32.png) [@Christopher\_Pp](https://tech-community.robotics.abb.com/u/Christopher_Pp)\
**Post date:** [July 24, 2018, 7:09pm UTC](https://tech-community.robotics.abb.com/t/any-suggestions-to-program-two-palletizing-zones/8381/11 "2018-07-24T19:09:15Z")

</div>

> [@lemster68](#):
>
> Do you have multitasking? As I read your question I understand that you want FIFO, none of the proposed solutions are going to work for that.

No friend of mine, it’s not multitasking …

---

<div class="post-metadata">

**Author:** ![lemster68](https://dub1.discourse-cdn.com/flex005/user_avatar/tech-community.robotics.abb.com/lemster68/32/1945_2.png) [@lemster68](https://tech-community.robotics.abb.com/u/lemster68)\
**Post date:** [July 24, 2018, 7:45pm UTC](https://tech-community.robotics.abb.com/t/any-suggestions-to-program-two-palletizing-zones/8381/12 "2018-07-24T19:45:11Z")

</div>

Too bad, maybe then you could set up some traps to handle the FIFO you asked about initially.

---

<div class="post-metadata">

**Author:** ![soup](https://dub1.discourse-cdn.com/flex005/user_avatar/tech-community.robotics.abb.com/soup/32/1592_2.png) [@soup](https://tech-community.robotics.abb.com/u/soup)\
**Post date:** [July 24, 2018, 8:05pm UTC](https://tech-community.robotics.abb.com/t/any-suggestions-to-program-two-palletizing-zones/8381/13 "2018-07-24T20:05:09Z")

</div>

Or maybe just alternate if both are high – not true first-in-first-out but maybe good enough without messing with traps?

Example:

MODULE examplePal

CONST num Mock\_diInfeeder1\_PickRequest:=1;  
CONST num Mock\_diInfeeder2\_PickRequest:=1;

PERS num PickingFromInfeeder:=1;

PROC exampleBothHigh()  
TPErase;  
WHILE TRUE DO  
WaitUntil Mock\_diInfeeder1\_PickRequest=1 OR Mock\_diInfeeder2\_PickRequest=1;  
IF Mock\_diInfeeder1\_PickRequest=1 AND Mock\_diInfeeder2\_PickRequest=1 THEN  
IF PickingFromInfeeder=1 THEN  
Infeeder2\_Pick;  
ELSEIF PickingFromInfeeder=2 THEN  
Infeeder1\_Pick;  
ENDIF  
ELSEIF Mock\_diInfeeder1\_PickRequest=1 THEN  
Infeeder1\_Pick;  
ELSEIF Mock\_diInfeeder2\_PickRequest=1 THEN  
Infeeder2\_Pick;  
ENDIF  
ENDWHILE  
ENDPROC

PROC Infeeder1\_Pick()  
PickingFromInfeeder:=1;  
TPWrite “Picking from Infeeder1”;  
WaitTime 3;  
ENDPROC

PROC Infeeder2\_Pick()  
PickingFromInfeeder:=2;  
TPWrite “Picking from Infeeder2”;  
WaitTime 3;  
ENDPROC

ENDMODULE

---

<div class="post-metadata">

**Author:** ![Christopher\_Pp](https://avatars.discourse-cdn.com/v4/letter/c/e47c2d/32.png) [@Christopher\_Pp](https://tech-community.robotics.abb.com/u/Christopher_Pp)\
**Post date:** [July 26, 2018, 1:23am UTC](https://tech-community.robotics.abb.com/t/any-suggestions-to-program-two-palletizing-zones/8381/14 "2018-07-26T01:23:31Z")

</div>

Is there a way to save the high state of a signal in a buffer or to set a type of queue?

---

<div class="post-metadata">

**Author:** ![lemster68](https://dub1.discourse-cdn.com/flex005/user_avatar/tech-community.robotics.abb.com/lemster68/32/1945_2.png) [@lemster68](https://tech-community.robotics.abb.com/u/lemster68)\
**Post date:** [July 26, 2018, 11:50am UTC](https://tech-community.robotics.abb.com/t/any-suggestions-to-program-two-palletizing-zones/8381/15 "2018-07-26T11:50:40Z")

</div>

Write some Trap routines for the signals to set a Bool or other variable to queue up your next pick.
