Cancel
Showing results for 
Search instead for 
Did you mean: 

Release from store when buffer empty

Dear community,

 

i've searched in the forum but i haven't found anything useful to solve my problem.

In attach you'll find my model; in the frame ricezioneMerce there is a method called Mat_CNC who loads the MUs contained in the Store to the machine placed in frame CNC.

As soon as the buffer are full the MUs flows through the production line.

The problem are these buffers; when they are empty no MUs from the store goes to them to replenish.

The methcall is not a solution because the production line has different working time.

How can i move MUs from the store to the buffers when they are empty (and just in that moment)?

Thanks a lot.

4 REPLIES

Re: Release from store when buffer empty

Gears Esteemed Contributor Gears Esteemed Contributor
Gears Esteemed Contributor

you could try a observer control for the attribute empty

 

e.g. (not tested !!)

 

if ?.empty=true then
       waituntil 	root.RicezioneMerce.Magazzino_Materiale.numMu >= ?.capacity
       while ?.full=false loop
          root.RicezioneMerce.Magazzino_Materiale.cont.move(?)
          wait 0.01
       end
end
Steffen Bangsow
freelance simulation specialist  
web: www.bangsow.eu
mail: steffen@bangsow.net

Re: Release from store when buffer empty

I'll try as soon as i can but i have another question; why you use these code?

wait 0.01

Thanks.

Re: Release from store when buffer empty

Gears Esteemed Contributor Gears Esteemed Contributor
Gears Esteemed Contributor
the buffer need to "shift" MUs inside the buffer; if you move MUs into a buffer with a loop it happens all at the same simulation time. It doesn't work with the buffer. So you need to wait a short time between the "move" commands, so the buffer has the chance to "proceed" the MUs.
Steffen Bangsow
freelance simulation specialist  
web: www.bangsow.eu
mail: steffen@bangsow.net

Re: Release from store when buffer empty

I've looked at observers and now it's working.
Thank you.