question

Sigmund avatar image
0 Likes"
Sigmund asked Jason Lightfoot edited

Return items in a given rack level

Hi!

I'm trying to build a Vertical Lift Module (VLM). The machine is supposed to collect a tray (all items in a given level) and display them at a bay (a queue). Then the operator can either replenish or pick items from the given tray (items at the queue). In order to fetch the correct tray (all items in the given level) I need to know which items are in the given level, and their position.


I tried to make a code, but it do not work. Any suggestions on how I can do this?


A rack consists of 20 levels, 6 bays and 2 slots per bay. token.item.Rack returns the current rack of the item and token.level returns the level/tray I'm looking for.

skjermbilde-2023-02-17-kl-112414.png

FlexSim 22.1.0
rackrackgetitembybaylevelracklevel
· 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.

Joerg Vogel avatar image Joerg Vogel commented ·
Sorry, You are on the wrong track. Since Flexsim 19.2 we use a complete new environment called Warehouse. It depends on the Flexscript Class Storage and its subclasses. You find in this class two major attributes slots referenced in queries as slot and slotitems referenced in queries just by item. And there are methods to find slots for items entering a rack in your warehouse or to find items stored in slots at racks in your warehouse.

In your scenario you query for items in a slot to get an array of them.

All older rack commands are still available, because someone want to load an older version model without a warehouse. But in a case where you build a new model you should use the Flexscript API to use the actual system.

Please look for other questions about queryitems.

0 Likes 0 ·

1 Answer

·
Joerg Vogel avatar image
0 Likes"
Joerg Vogel answered Jason Lightfoot edited

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

Sigmund avatar image Sigmund commented ·
Thank you for the example!

I'm still struggling to get the content of the level. The function you use returns the items in a given slot, but my racks have 6 bays and 2 slots per bay. So it will only return a maximum 2 items, and not the maximum of 12 which I am looking for. Do you know how to fix this?

Thanks in advance.

0 Likes 0 ·
Jason Lightfoot avatar image Jason Lightfoot ♦ Sigmund commented ·
Storage.system.queryItems("WHERE slot.levelID=2")

for example. That will give you slotItems which you'll need to use to find the item in the rack you can pick. In the example model it's done by casting the array entries as Slot.Item and then using the 'item' property to find the item in the rack.

1 Like 1 ·

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.