question

Darwin S avatar image
0 Likes"
Darwin S asked Matt Long commented

Query Pull and Push with Where Type doesn,t work

Trial_autosave.fsm

I am trying to combine item with the same item type using combiner then i used pull and push from list to try to pull the same type from the list but it doesn't work here is the model

The Pull and Push are in Queue 1 and Queue 2

Thank you

FlexSim 19.0.9
combinerflexsim 19.0.9query pull
trial-autosave.fsm (66.7 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

Matt Long avatar image
1 Like"
Matt Long answered Matt Long commented

First off, somehow your Queue1 Pull Strategy field was set to C++. If you open the code field and click on the S button at the bottom, that will change it back to flexscript.

The next issue has to do with timing. When you reset the model, Queue1 will fire its Pull code and create a backorder on the FanList. (Open the FanList properties and in the General tab and click View Back Orders..) This backorder is waiting for Type 0. You would need the pull from list to not happen until variable1 has been changed. I'm not exactly sure why you're trying to use a list to send the write itemtypes to the combiner. The standard pull requirement of
Specific Label would work better in this case.

And then change Queue2 to use First Available in the Send To Port (which will just notify Queue1 to reevaluate its pull requirement).

Hopefully this helps!


1595087069179.png (66.5 KiB)
1595087297805.png (33.8 KiB)
1595087385601.png (19.1 KiB)
· 2
5 |100000

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

Darwin S avatar image Darwin S commented ·

Trial AutoSave 2.fsm

I Have tried your solution It worked but there is a new problem that arises

Queue1 only pull new Item from Queue2 while the old item( already waiting in Queue2 is left alone causing so many item waiting but ignored)

is there any solution for this problem?

Thank you

0 Likes 0 ·
Matt Long avatar image Matt Long Darwin S commented ·

It looks like you still have code nodes in your model that are toggled as C++. If you toggle those back to Flexscript, you'll stop getting "It is recommended that you Compile First." message when you run the model.

When an item enters Queue2, the pull requirement fires on Queue1, but it only checks the new item. Once an item is pulled, Queue 1 receives the item and then attempts to pull again. This time it starts at the first item and checks each one in Queue2 to find another matching item. Except that Queue 1 only has a max content of 1, so the second set of pulls does not happen.

You can solve this by telling the queue to reevaluate its pull requirement when variable1 is set.In Combiner2's On Entry trigger, change the code to:

if (variable2 != 1) {
    variable1 = value;
    current.inObjects[2].input.close();
    current.inObjects[2].input.open();
}

The process of closing and opening the ports of Queue1 will cause the pull requirement to be fired for every item in Queue2. You'll notice right as the first green item is moved into the combiner, Queue1 immediately pulls the red item that was the first one to arrive in Queue2.

0 Likes 0 ·