Mindy W avatar image
Mindy W asked tannerp commented

Can you search for a flow item based on the value of a label?

Is it possible to search the labels of flow items in a model to determine which flow items have a specific label value or which items have matching label values?

FlexSim 18.0.10
labelsflow itemsflexsim 18.0.10search
· 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.

Jeff Nordgren avatar image Jeff Nordgren commented ·


There is, if you're willing to write the code to do it. And there is probably more than one way to do it. If you could send us your model or a sample model showing what you are trying to do, it would help us in giving you a more specific answer for your needs.


0 Likes 0 ·
Mindy W avatar image Mindy W Jeff Nordgren commented ·

Good Afternoon Jeff (@jeff.nordgren),

Unfortunately I can't upload my actual model, however, I've made a test model to demonstrate what I'm trying to do.

I would like to track the flow item's stay time in the model. The model consist of two types of flow items: part flow items (source 3) and assembly flow items (source 1). I'm setting a label on the part flow item when it exists Queue 4 and calculating the difference between that time and the exit time from MultiProcessor 8 (this is currently resulting in an error due to the issue identified in the next sentence). The issue that I'm finding is that because the model uses a combiner, the start time is saved as a label on a part flow item than the assembly flow item that is exiting MultiProcessor 8.

The part flow items, which have the start time label assigned are processed at MultiProcessor 5 or 6. Because of differing process times, the part flow items can get out of order. Although it doesn't affect the model if the combiner collects part items out of start order, it is important that the part flow item start time label is copied to the assembly flow item in order. To address this issue, I would like to assign an ID label to each part and assembly flow item so the start label can be copied from the part flow item to the assembly flow item when the IDs match.


If additional clarification is needed, please let me know. I am also open to other ways to track stay time throughout the model if a better method exists.

Thank you for your time,


0 Likes 0 ·
test.fsm (34.1 KiB)

1 Answer

Brenton King avatar image
1 Like"
Brenton King answered tannerp commented

@mindy.w There is definitely a way to do this very easily. Just place every flowitem on a list. I like to have a token for every floweitem and then put the tokens on a list but you do not have to do it that way. Say all of your items are in a rack, you could push the item to the list when it enters the rack. Lists allow you to do really cool things, like query how many of a certain type you have, or the item that has been in the rack the longest...really, the capabilities are endless. This is done by the use of a pull operation. The pull operation would use SQL. Let us know if you need any more help with this.

· 8
5 |100000

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

Mindy W avatar image Mindy W commented ·

@brenton.king Sorry for the slow response, I've been playing around with this idea trying to get it to work and I've gotten some of it working, but there is still one step I haven't figured out yet.

I've trying to perform the following steps:

  1. Place flow items in list (with ID label and start time label stored)
  2. Query list to determine which flow item has an ID matching the current processor and has the lowest start time label value
  3. Pull that item from the list
  4. I would then like to assign the start time label value to the flow item currently being processed, but I don't know how to access the value. The code below shows how I tried to assign the value (see line 18), but when I run that code, I get an error: "Retrieving startTime label property on node that does not exist at Model:/Bay3Collector>variables/exittrigger"
  5. Remove remaining flow items from list whose ID match the current processor's stored ID

Steps 1 - 3 and step 5 are all working as expected, but step 4 is not. How do I copy over the start time label once the flow item has been pulled from the list?

Thank you for your help!

0 Likes 0 ·
1599068485029.png (44.8 KiB)
Benjamin W2 avatar image Benjamin W2 Mindy W commented ·

@mindy.w, it looks like Flexsim is not recognizing the pulled item. This means that something if your .pull method is not correct. Can you attach your model or a sample of what you are trying to do so we can help you debug it?

Also, if possible I would recommend that you do this logic in process flow. It is easier to see and debug that way.

0 Likes 0 ·
Mindy W avatar image Mindy W Benjamin W2 commented ·

@benjamin.w2 @brenton.king

Unfortunately I can't share my model, so I created a test model to demonstrate the issue, but the test model is running as expected. Here is the working test model.


I'm still having issues with my model, but if I'm able to determine the problem, I will post a comment with the solution.

Thank you for your help!

0 Likes 0 ·
test.fsm (39.7 KiB)
Show more comments