question

Steven Chen avatar image
0 Likes"
Steven Chen asked Steven Chen commented

Separator can't send items according to ports

Dear everyone,

As you may see in the attached model, items and pallets cannot be sent to the correct ports by the separator.

In the customized code written in the Send To Port function of the separator, Ports are made according to the values of a label called "object", which are 1 for items and 2 for pallets, respectively. In this way, items should be transported to Queue4 while pallets should be sent back to their original queues.

Obviously, the separator did send items and pallets based on the designed code for the first time. After that, however, the transporters did not move and the separator's finished items are never sent anymore.

I am curious what caused this exception. Could anyone tell me how to fix the problem?

test_separator_v21.0.3_v1.fsm

Thank you very much

FlexSim 21.0.3
separatorflexsim 21.0.3send to portcostum code
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

Eric M avatar image
0 Likes"
Eric M answered Steven Chen commented

Hi @steven.chen, the retValue for the for loop should be i+1 since the first port goes to Queue4 which you don't want to include. Also, including a break in the if statement after setting the retValue will put the pallet back in its original queue.

· 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.

Steven Chen avatar image Steven Chen commented ·

Thank you for your explanation and method. The pallets were correctly sent to their original places after I switched the retValue's value to i+1 and added a break.

0 Likes 0 ·