question

Lucas avatar image
0 Likes"
Lucas asked Jeanette F commented

Conveyor and Decision point

decision-pint-and-when-is-blocked-to-another-one-1 (3).fsmI have created this model but you can see that until the photocell is blocked, some covers enter and I would like the one that blocks the photocell to immediately stop and go the next way, so that no more ones enter until it is released.

FlexSim 24.0.0
photo eye
· 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.

Jeanette F avatar image Jeanette F ♦♦ commented ·

Hi @Lucas, was Kavika F's answer helpful? If so, please click the "Accept" button at the bottom of their answer. Or if you still have questions, add a comment and we'll continue the conversation.

If we haven't heard back from you within 3 business days we'll auto-accept an answer, but you can always comment back to reopen your question.

0 Likes 0 ·

1 Answer

·
Kavika F avatar image
0 Likes"
Kavika F answered

Hey @Lucas, lets take a look at the On Continue trigger you have in your decision point (DP).

1709659658528.png

You have 3 actions right after another to send items to specific photo eyes depending if the others are blocked or not. The last one is to send items to outObjects[1], which is the first lane.

1709659712939.png

The logic it seems you're trying to implement is a "round-robin" kind of logic. You should setup more DPs that can keep track if certain lanes are occupied or not. You can also setup a label on your DP to keep track of which lane it just sent an item to and then switch lanes.

1709660751791.png

So, if you put a label on the DP,

1709660795250.png

then remove your other triggers and add an On Arrival trigger with the following code,

Conveyor.DecisionPoint current = ownerobject(c);
Object item = param(1);
Conveyor conveyor = param(2);
Conveyor.Item conveyorItem = conveyor.itemData[item];

{ //************* PickOption Start *************\\
/***popup:Conveyor_SendItem*/
/**Send Item*/

if (/**\nCondition: *//***tag:condition*//**/true/**/) {
  /**\nDestination: */
  treenode newDest = /***tag:destination*//**/current.outObjects[current.SendToLane]/**/;
  Conveyor.sendItem(item, newDest);
  current.SendToLane = (current.SendToLane + 1) % 4;
  if (current.SendToLane == 0) {
    current.SendToLane += 1;
  }
}
} //******* PickOption End *******\\

you should see the DP send items to lanes in a "Round Robin" fashion.

decision-pint-and-when-is-blocked-to-another-one-1_1.fsm


5 |100000

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

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.