question

Kadircan T avatar image
0 Likes"
Kadircan T asked Kadircan T commented

How can I send items to loop while chutes' inports are unable to receive item?

Hello,

I try to develop a loop sorter model which includes +200 chutes. To send items to exit transfer, I use custom code Send Item on Conveyor

Queues can collect x number of items (10 in this example), when reach item on queues reach 10, an operator will carry these items to another place. (I used delay for now)

What I want to do is, when chutes reach 10 items, upcoming items on conveyor should be sent to loop.

My model sends items to exit transfer but when batched items delay, upcoming items stop at exit transfer.


testparcelWIP.fsm

FlexSim 22.2.2
loopsorterchute
testparcelwip.fsm (59.3 KiB)
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

Jacob W2 avatar image
1 Like"
Jacob W2 answered Kadircan T commented

Hi @Kadircan T,

I have made some edits to your model that will now cause items to loop. Instead of sending the items using process flow I used decision points instead. I added some custom code on the decision points that checks the current content of the nearest queue, if it is less than 10 the item is sent there, if not it is sent down the conveyor. Once it reaches the next decision point the process is repeated. If none of the queues have space, the items are then sent around the conveyor again. Below is the code I used.

if (current.centerObjects[1].subnodes.length < 10) {
/**\nDestination: */
treenode newDest = /***tag:destination*//**/current.centerObjects[2]/**/;
Conveyor.sendItem(item, newDest);
}
else{
treenode newDest = Model.find("StartPoint");
Conveyor.sendItem(item, newDest);
}

Some important things to note with this model.

1. You have to have enough space between the decision point and the exit transfer to allow the item to be sent, or the item will route around the conveyor again.

2. The center port connections make the code easier to use for any decision point, just make sure that they are set in the correct order.

TestLoop_JW.fsm



testloop-jw.fsm (58.9 KiB)
· 3
5 |100000

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

Kadircan T avatar image Kadircan T commented ·

Thank you @Jacob W2,

What if I want to sort items according to their type? I mean type 1 should be sorted queue1, type 2 should be sorted queue2 and so on

0 Likes 0 ·
Jacob W2 avatar image Jacob W2 ♦ Kadircan T commented ·

@Kadircan T,

You could do this by adding another check in the if statement that checks if a label set on the item is equal to the value of a label on the decision point.

if (current.centerObjects[1].subnodes.length < 10 && item.Type == current.Type) {
/**\nDestination: */
treenode newDest = /***tag:destination*//**/current.centerObjects[2]/**/;
Conveyor.sendItem(item, newDest);
}
else{
treenode newDest = Model.find("StartPoint");
Conveyor.sendItem(item, newDest);
}

I've updated the model I shared to do this.

TestLoop_JW.fsm

0 Likes 0 ·
testloop-jw.fsm (59.0 KiB)
Kadircan T avatar image Kadircan T commented ·

Thank you @Jacob W2,

This is exactly what I need.

0 Likes 0 ·