question

Juliette C avatar image
0 Likes"
Juliette C asked Joseph Gillespie commented

Problem with the logic of Storage in a rack

I have a problem with the filling of the rack.

I create a routine for the filling of the rack,

Each rack is defined by a capacity, a bay can be fill with the same product (identify by the item type).

when a bay is full, a token is create, this one deletes when all the products of the bay are used, it's a way to stop the storage inside this rack.

But in my simulation, some products are stored inside a wrong bay with others products and they are identify by bay = 0

Normally in my code, if there is no more place in the rack, the product is sent to a queue named "Type2" but it doesn't work.

I would like to sent those products is the queue that I defined in order to have a correct stock inside my rack.

FlexSim 19.0.3
rackstorage
· 5
5 |100000

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

1 Answer

Joseph Gillespie avatar image
0 Likes"
Joseph Gillespie answered

@Juliette C

The problem with your code here in "Place In Bay":

  1. if (item.Type==1)
  2. moveobject(item,model.find("Type1"));
  3. else
  4. moveobject(item,model.find("Type2"));

is that you are using a transporter to move items into your racks. The "Place In Bay" code gets run before the transporter unloads the items. What happens is that an item is moved into either the "Type1" or "Type2" queue, but then moved back to the rack when the transporter unloads the item.

One solution to this problem would be to add an "On Entry" trigger to all of your racks with this code:

  1. if(item.Bay == 0){
  2. if (item.Type == 1){
  3. moveobject(item,model.find("Type1"));
  4. }
  5. else{
  6. moveobject(item,model.find("Type2"));
  7. }
  8. }

This will move the Bay = 0 items out of the racks.

Let me know if you have any questions on this!

5 |100000

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