question

chia725 avatar image
0 Likes"
chia725 asked Jeanette F commented

Problem Concerning Query and List Expression

Hello,

I have encounter some problem when using pull from list-Query. What I am trying to do is I want the Agv to grab the product type base on the one stated in the fromto global table. I use the trigger in 3D model to label the item. Then I create a List expression to record it like this.

圖片1.png

I registered all the information on the token.

1710174959547.png

But there comes up with some problem when i use the Query.

1710174875510.png

I am wondering if there's anything that need to be fixed with the syntax or any suggestion. My model is attached as below, thank you very much for any of your help!

my model:demo1-0312.fsm

FlexSim 23.1.4
queryprocesss flowglobaltable
圖片1.png (894.2 KiB)
1710174875510.png (12.3 KiB)
1710174959547.png (9.2 KiB)
demo1-0312.fsm (66.4 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.

Jeanette F avatar image Jeanette F ♦♦ commented ·

Hi @chia725, was Felix Möhlmann'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 comment back to reopen your question.

0 Likes 0 ·

1 Answer

·
Felix Möhlmann avatar image
1 Like"
Felix Möhlmann answered Felix Möhlmann commented

"item" isn't a valid variable in a list expression. To access the value on the list use value. If all you want to do is read a label of the value then you can use a label field instead of an expression.

The item list actually comes with a field for the "Type" label by default.

1710178248899.png


1710178248899.png (5.7 KiB)
· 4
5 |100000

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

chia725 avatar image chia725 commented ·

Thank you for your help! The list works well based on your suggestion! But I found that after I modify the syntax the Query did no work as expected. Like all the token will stuck at the pull from list activity. I am wondering if there's a need to do some modify to the Query of Pull from list. Thank you so much for your help!

demo1-03122.fsm

0 Likes 0 ·
demo1-03122.fsm (66.7 KiB)
Felix Möhlmann avatar image Felix Möhlmann chia725 commented ·

Apart from how the list expression was defined your query was fine, why did you change it.

I don't really know what the new query is supposed to accomplish.

1710226850609.png

Even if a number was a valid parameter for the "find" method (it is not, the passed in value must be a string), why would the type be equal to some object in the model?

Further down you try to pull an item from a list partitioned by the TE. I don't see a point in the model where items would be pushed to that list.

And finally, instead of keeping names in the token labels and using model.find() everywhere, you could also just use model.find() directly when creating the labels.

1710227044787.png

0 Likes 0 ·
1710226850609.png (4.0 KiB)
1710227044787.png (10.8 KiB)
chia725 avatar image chia725 Felix Möhlmann commented ·

Thank you for your clarify! The reason I changed my Query is because when I use the old query nothing is pulled out from the list. I'll keep my old version, thank you. Since the toload activity is pulled from the list which register the item when it enters query. And there's already a lot of items in the list but nothing be pulled out.

1710228650602.png

So I was wondering why it did not work. Thank you!

modified0312.fsm

0 Likes 0 ·
1710228650602.png (5.7 KiB)
modified0312.fsm (67.9 KiB)
Show more comments

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.