question

mary avatar image
0 Likes"
mary asked Jeanette F commented

Find empty slot space in many racks

Hi all,

I have attached a model, where pallet with part arrive at the conveyor. The robot has to pick from conveyor and drop in any of the available slot of any 4 racks. How to find empty slot space and assign that particular slot to the arrived item from the conveyor?

please do help!


Rack_storage_post.fsm

FlexSim 20.0.10
rack
· 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 @mary, 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 unaccept and comment back to reopen your question.

0 Likes 0 ·

1 Answer

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

See the following link (and other Storage-classes in the manual pages above the linked one) for information about how to query the storage system.

https://docs.flexsim.com/en/20.0/Reference/CodingInFlexSim/FlexScriptAPIReference/Warehousing/Storage.System.html

A simple way to achieve your goal is to do the following:

Connect the conveyor to the racks with port-connections. Connect the robot and set the Exit Transfer to use it as transport.

In the Send to Port code of the Exit Transfer

- use the findSlot method to search for an empty slot (number of assigned items can be accessed through slot.slotItems.length) (to get a random slot, you can use ORDER BY RAND() in the query)
- if a slot was found, get a reference to the rack it belongs to (see Storage.Slot class)
- assign the item to the slot (see Storage.Item class)
- get the correct output port rank via the ipopno() command
- return that port rank so the item is send there
- if no slot is found, return 0, so the item is send to the first available rack

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

mary avatar image mary commented ·

Hi @Felix Möhlmann , I have tried with send to port code but not following the exact commands. It will be helpful if you can give an example model.

0 Likes 0 ·
Felix Möhlmann avatar image Felix Möhlmann mary commented ·

The code would look like this:

// Query for an empty slot
Storage.Slot slot = Storage.system.findSlot("WHERE slot.slotItems.length = 0 ORDER BY RAND()", 0); if(slot) {     // If a slot was found, assign the item to it, get the port rank and send the item there     Object rack = slot.storageObject;     Storage.Item storeItem = Storage.Item(item);     storeItem.assignedSlot = slot;     return ipopno(rack, 1); } // If no slot is found, do "First Available" return 0;
0 Likes 0 ·

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.