question

Talia Z avatar image
0 Likes"
Talia Z asked Joerg Vogel commented

Can I make the separator pull from two different queues using conditions?

bottle-unloader-process.fsm

I am creating this simulation for a school project and have attached the FlexSim file. How can I make the separator pull from Yard_Bottles only when there is a supply of caps in the cap storage queue? Otherwise it should pull from the Yard_Caps. In other words, my aim is for the separator to pull primarily from Yard_Bottles, but ensure there is a constant supply of caps in the "Cap storage" queue by pulling from Yard_Caps when this queue is near empty. This will be simulating the need for bottle and cap storage on a bottle filling line. Please let me know if you have any questions, I really appreciate your help!

FlexSim 17.2.5
queueseparatorstrategy
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

·
Joshua S avatar image
1 Like"
Joshua S answered Joerg Vogel commented

One way of doing this is closing an opening the Separators ports based off the supply caps storage amount. You can do a check every time an item enters the cap storage or leaves using the objects triggers. The code to check how many items are in an object is just see how many subnodes are in that object. For instance to return how many items are in cap storage you can use

model().find("Cap storage").subnodes.length
· 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.

Talia Z avatar image Talia Z commented ·

Thank you Joshua! Being a new simulation and FlexSim user, would you be able to elaborate a bit? I am trying to add this code to the separator's input pull strategy. I know what I want to say logically but am not well-versed in this language. I would appreciate any and all help.

Object current = ownerobject(c);
Object item = param(1);
int port = param(2);
model().find("Cap storage").subnodes.length
if(("Cap storage") >0)
{
	port==1;
}
	else {port==2};
return value;
0 Likes 0 ·
Joerg Vogel avatar image Joerg Vogel Talia Z commented ·

You use the Pull option under the Flow tab of the Separator.

1 Like 1 ·
Joerg Vogel avatar image Joerg Vogel Joerg Vogel commented ·

If you use this, you need an attribute to decide where the separated items go in the Send To Port function of the separator. Unfortunately you called the pallets on the truck the same. Perhaps you can add a label named the same at the truck and the pallets, then you can set a value different at each of this container items to distribute them at different output ports at the separator. An obvious function would be then "port by case". The case function should point to your added label "item.yourLabelName". Or the direct approach "by expression" if the label values match with the output ports of the separator.

item.yourLabelName 
1 Like 1 ·

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.