question

Nanjana avatar image
0 Likes"
Nanjana asked Nanjana commented

How to assign value to each item stored in the rack?

I have created a model with source and rack with item type and color as a trigger, which stores 3 different color boxes in particular bays. After getting stored in the rack, I want to assign each item's with unique value so that with this value I can retrieve the item. How can I assign unique values to each item for this model?

rack.fsm

FlexSim 19.1.2
rackrack storagestorage
rack.fsm (19.2 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.

Felix Möhlmann avatar image
0 Likes"
Felix Möhlmann answered Nanjana commented

Just assigning some value to an item will not get you a reference to said item in other parts of the model. This sounds like you might want to use a list for this purpose.

https://docs.flexsim.com/en/19.1/ConnectingFlows/Lists/KeyConceptsLists/KeyConceptsLists.html

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

Jason Lightfoot avatar image Jason Lightfoot ♦♦ commented ·

It's probably also worth noting that version 19.2 introduced the Storage System to manage items efficiently and bypassing most needs to have a list. In the most recent versions you can also use a Map of arrays of items.

@Felix Möhlmann I think you comment is an answer - so promoted it.


0 Likes 0 ·
Nanjana avatar image Nanjana commented ·
Thank you @Felix Möhlmann , I have tried using lists but i am finding errors, is there any sample model to refer?
0 Likes 0 ·
Felix Möhlmann avatar image Felix Möhlmann Nanjana commented ·

Here's a simple model that demonstrates using a list. The items are pushed to a list in the "Send to Port" option of the rack. The processors pull items with type 1 or 2 respectively. A process flow pulls any items that are older than 1 minute ("age > 60") and has a forklift move them to a queue.

ListExample.fsm

0 Likes 0 ·
listexample.fsm (34.7 KiB)
Nanjana avatar image Nanjana Felix Möhlmann commented ·
Thank you @Felix Möhlmann I resolved the issue using the lists and the sample model was really helpful
0 Likes 0 ·
Joerg Vogel avatar image
0 Likes"
Joerg Vogel answered Joerg Vogel commented

If you convert the item reference into a number, you have a unique value.
https://docs.flexsim.com/en/19.1/Reference/CodingInFlexSim/CommandReference/Commands.html#tonum

If you convert the value back by

https://docs.flexsim.com/en/19.1/Reference/CodingInFlexSim/CommandReference/Commands.html#tonode

you get a direct reference to the item.

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

Nanjana avatar image Nanjana commented ·
Thank you @Joerg Vogel is there any sample model to refer?
0 Likes 0 ·
Joerg Vogel avatar image Joerg Vogel Nanjana commented ·
Not that I am aware of It. Please try it with events as triggers or in process flow for On Entry, On Exit and perhaps a delay.
0 Likes 0 ·