question

Sean B avatar image
0 Likes"
Sean B asked Nip J commented

How to send an item to different elevators based on type?

I have pallets coming into the system every 10 seconds in a particular order and getting randomly distributed to the top or bottom conveyor. They then reach a decision point based on their type and rotate 90 degrees before being transported to their designated outbound conveyor by the elevator. One problem I am running into is I can't get both elevators to be selected on the ExitTransfer of the conveyors. Because of this, half of the items on the top or bottom can't be transferred to their correct lanes. Is there something I am overlooking on how to get two separate elevators to operate through one ExitTransfer? 20C25M06R02.fsm

FlexSim 21.1.4
elevatorflexsim 21.1.4sorting
20c25m06r02.fsm (115.0 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

·
Felix Möhlmann avatar image
0 Likes"
Felix Möhlmann answered Nip J commented

The "Send Item" option of the decition points only works for directly connected conveyors. If port connections are involved, "Send Item" should specify which exit transfer the item uses. In the exit transfer itself you set the port an item should be send to from there. "Port by Case" works well for that in your case.

Similarly to the "Port by Case" option of "Send to Port", you can choose which elevator should be used. Either connect them as center objects to the exit transfer and choose "Center Port by Case" or return the correct elevator directly in code.

Example:

if(item.Type == 4)
{
    return Model.find("Elevator6");
}
else
{
    return Model.find("Elevator2");
}

I applied these changes to the lower conveyor in your model and disconnected the upper one for the time being.

20c25m06r02_1.fsm


20c25m06r02-1.fsm (115.5 KiB)
· 4
5 |100000

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

Sean B avatar image Sean B commented ·

Ah thank you Felix! That is very helpful.

0 Likes 0 ·
Nip J avatar image Nip J commented ·

Hello @Felix Möhlmann,

I had a very similar question: in my case, I already have chosen to return a specific object. But it seems like that the exittransfer does not accept an object as a return value but integers, only (i.e. outputport[number])?Might you please have a look at my file? Custom Code is in the exit transfer. Thanks a lot.

sendbycase_dummy.fsm.

0 Likes 0 ·
Felix Möhlmann avatar image Felix Möhlmann Nip J commented ·

You are correct, the "Send to Port" option expects an integer as return value (whereas the "Send Item" and "Use Transport" options require an object to be returned).

If you want to use an object reference to send the item, you could loop through all output connections until you find the correct rank and return that.

for(int rank = 1; rank <= current.outObjects.length; rank++)
{
    if(current.outObjects[rank] == destobj)
    {
        return rank;
    }
}

Or you instead assign the "destobj" to a label and have the processors pull the items with the requirement that the label has to be equal to themselves.

sendbycase-dummy_1.fsm

0 Likes 0 ·
Nip J avatar image Nip J Nip J commented ·

Thanks for the quick respond: idea no.1 is a nice approach/ workaround that works flawlessly

0 Likes 0 ·

Write an Answer

Hint: Notify or tag a user in this post by typing @username.

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