question

Yue Y avatar image
0 Likes"
Yue Y asked Phil BoBo commented

Behavior of receiveitem() vs open port

When the model is running and I want a basicFR whose input port is closed to start accepting flow items. In the script window, I tried two commands:

1. Model.find("BasicFR1").as(Object).input.open();

2. receiveitem(Model.find("BasicFR1"));

The first command open the port successfully while the second one has no effect on the simulation. What's the reason behind this?

FlexSim 19.1.1
flexscript
· 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.

Phil BoBo avatar image Phil BoBo ♦♦ commented ·

Please post an example model demonstrating the issue so that we can explain what is happening.

We can only guess what is happening without being able to replicate the issue.

0 Likes 0 ·

1 Answer

Joerg Vogel avatar image
0 Likes"
Joerg Vogel answered

Both commands have effects on the events of the FlexSim engine. There is a standard sequence of events that are responsible to transfer items from one object to another. A closed input of an object tells the engine to stop the transfer of items based an the connections in the model. The event to receive items is only suspended but still active. When you open the input, the engine resumes the transfer of items. In cases where the event of receiving items is missing in event list, you force the engine by the command receiveitem to be available to get items into the object, but it won’t actually transfer items.

You must call receiveitem once to get items to an basic fixed resource object on simulation run start or on reset. That is necessary, too, if you control a fixed resource process flow object by process flow.

5 |100000

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