question

Simpson S2 avatar image
0 Likes"
Simpson S2 asked Ryan Clark commented

Pull flowitem from list ordered by ascending number

Hi

test_model.fsm

I want to pull flowitems from list ordered by ascending number and then place them from Queue 1 to Queue 2 by Operator.

1645964856134.png

When flowitem arrive Queue1, it will be assigned a random number as label "Type" and then push to list. 1645964908069.png

1645965060549.png

When the amount in Queue 1 reach to certain number, a token is fired to pull flowitems from list ordered by Type number. I am using query "SELECT item ORDER BY Type ASC" but it is not working. Could anyone help me? Thank you so much! 1645965031139.png

FlexSim 20.1.3
pull from listordering
1645964856134.png (61.9 KiB)
1645964908069.png (29.1 KiB)
1645965031139.png (39.5 KiB)
1645965060549.png (46.3 KiB)
test-model.fsm (61.1 KiB)
· 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.

Ryan Clark avatar image Ryan Clark commented ·

Hi @Simpson S2, was Joerg Vogel'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 unaccept and comment back to reopen your question.

0 Likes 0 ·

1 Answer

Joerg Vogel avatar image
0 Likes"
Joerg Vogel answered Jason Lightfoot commented

Please don't be too smart. Just use a given picklist Option and adjust it. You don't need SELECT nor a value. You need only a field name of entry in your list.

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

Simpson S2 avatar image Simpson S2 commented ·

Hi Joerg,

Thanks for you comment! Do you mean this? But I got another error in "Load" process flow.

1645966094504.png

1645966076535.png


0 Likes 0 ·
1645966076535.png (12.9 KiB)
1645966094504.png (38.7 KiB)
Jason Lightfoot avatar image Jason Lightfoot ♦♦ Simpson S2 commented ·

You are referencing item on the token - but I expect you want the items in the queue.


This is a common mistake when using lists - you push the token to the list when it would have been better to push the item to the list. Then when you pull from the list you've got a reference to the token and not the item. Furthermore the issue is that the token is released from the push and often gets destroyed meaning if you don't take the information off it immediately you will lose it. Think about what will persist in the model and what are transient objects and try to dispose of the transients as soon as possible (they're just tools to trigger stuff).

So in your load you could try changing it to token.pulled.item but it would be better to change your model to push the item to the list and then pull it directly from the list. I would also change the assignment to label your token with 'item' instead of 'pulled'.

1645971488844.pngPush the item

1645971461799.pngPull the item


1 Like 1 ·
1645971461799.png (13.3 KiB)
1645971488844.png (10.5 KiB)