question

Jorge Toucet avatar image
0 Likes"
Jorge Toucet asked Jorge Toucet commented

Round Robin if Available from a Conveyor DP

Hello, if you have a DP on a conveyor and you would like to send to others conveyors DPs based on a round robin if available logic related to the each conveyor content... what is the best way to accomplish it? Me I've an example? Why this rule isn´t a standard option?

For conveyors I was able to code a Round Robin logic and to code a separate First Available one, but not together.

When all the destinations are full, I need to send a First Available but I don't know how to get that destination port number and store it for using it the next time...

Choose One
round robinusing conveyors
5 |100000

Up to 12 attachments (including images) can be used with a maximum of 23.8 MiB each and 47.7 MiB total.

1 Answer

Sam Stubbs avatar image
0 Likes"
Sam Stubbs answered Jorge Toucet commented

I think I've been able to achieve what you're looking for. So, to answer your question, the reason why "RR if available" is not an option for DPs is because Conveyors are more complicated than your usual port logic. How do you determine if something is Unavailable? With port logic, you just need to check if the port is open, but conveyors send items via conveyor logic, not necessarily through ports. So instead you need another criteria.

So this is what I came up with. I added a "count" label, and a "stopItems" binary label on the DPs. And then I just arbitrarily assigned a count value and some code to some of the DPs checking if the count (or number of items that has passed) reaches a certain point, to set the stopItems label to 1.

Then in the first DP's logic, I just copied the "RR if Available" code from another object, but instead of checking if the Output Ports are open or close, it checks if the stopItems label is 1 or 0. And then it sends the item accordingly.

Here is my example model:

rrifavailableconveyor.fsm


· 1
5 |100000

Up to 12 attachments (including images) can be used with a maximum of 23.8 MiB each and 47.7 MiB total.

Jorge Toucet avatar image Jorge Toucet commented ·

Thank you very much Sam for your help

0 Likes 0 ·