question

Lucas Braga avatar image
1 Like"
Lucas Braga asked Lucas Braga commented

"Using Global Lookup Table" not working

I have a processor, a queue and a sink. I want the sink to pull a certain quantity of items (that is already written on a Global Table cell) of the queue. I'm using the "Global Lookup Table" option, but even when the cell number is 0, all items go straight to the sink.

So is there some option/code that can do what I'm trying to do (receive/pull a exact quantity of items)? It doesn't necessarily has to be a sink...

FlexSim 7.5.4
global tableglobal lookup table
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
1 Like"
Phil BoBo answered Lucas Braga commented

Please post a model showing the issue. We can't explain what is happening unless we can duplicate the issue.

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

Close your input after you've received a certain number of objects:

2 Likes 2 ·
close-inputs.png (37.4 KiB)
Lucas Braga avatar image Lucas Braga Phil BoBo ♦♦ commented ·

Thank you! :)

0 Likes 0 ·
Lucas Braga avatar image Lucas Braga commented ·

model-global-lookup.fsm Don't understand how the function works, the quantity of items that go to the Sink is the not the same as the number on the table cell.

0 Likes 0 ·
Phil BoBo avatar image Phil BoBo ♦♦ Lucas Braga commented ·

The "By Global Table Lookup" pick option in the Pull Strategy is looking up what port to pull from out of a table. It doesn't control the quantity of items to pull.

The return value of the Pull Strategy is which input port to receive the next item from.

From the User Manual documentation on the Pull Strategy trigger:

"Pull Strategy - This parameter is only visible if "Pull" is checked. This picklist returns the input port number connected to the object that the next flowitem is to be pulled from. This field is evaluated only on reset of the model and when the pulling object becomes ready to receive its next flowitem."

3 Likes 3 ·
Lucas Braga avatar image Lucas Braga commented ·

Oh, got it. Thanks for explaning this pick option :)

So there's some option/code that can do what I'm trying to do (receive/pull a exact quantity of items)? It doesn't necessarily has to be a sink...

0 Likes 0 ·
jing.c avatar image
3 Likes"
jing.c answered Joerg Vogel commented

"the cell number is 0" means Sendtoport trigger of the queue will return 0, while return 0 in this trigger means "First Available", and it still send items to downstream.

If you do not want to send items, you will make the cell number be "-1".

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

Joerg Vogel avatar image Joerg Vogel commented ·

If you set an item to be hold (return -1), you have to release this item explicitly by releaseitem(obj item, port). obj item is a reference to the item to release.

1 Like 1 ·
Lucas Braga avatar image Lucas Braga commented ·

For example, the tablecell is now 2, 4 items were processed at total... but all of them went straight to the Sink. I don't understand

0 Likes 0 ·

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.