I am useing a method to fill 11 different buffers with products. A buffer can only be filled with one single product type. I managed to get this part right, I only have a problem when every buffer is full. Then the method should wait until one of the buffers is empty and start filling the empty buffer. So I need a statement for when all the buffers are full, the method has to wait and block everyting in the production process before the machine that calls the method and the process after this machine should continue.
For example part A is in front. buffer1 and 5 are filled with part a but totally full. the rest of the buffers are filled with other parts so part a cannot be put into these buffers. now the movement of part A has to be blocked until a buffer becomes empty. for example buffer10. then part A has to be placed in buffer 10.
I wanted to use the waituntill function and then jump to the top if a buffer becomes empty but that is not possible because I cannot use the or statement in a waituntil (waituntil buffer1.empty = true or buffer2.empty = true until buffer11.empty=true). And i don't know if there is some sort of jump function so that i can jump to the top again?
Does someone has a suggestion on how to solve this?
With kind reagards,
Solved! Go to Solution.
Can you clarify the constraints that are in place: What if a buffer is partially filled? Can incoming products overtake each other?
No they cannot overtake. It is FIFO. So the part has to wait until a buffer becomes totally empty. also, It cannot go into a buffer with the same product type that was totally full but is now getting empty because the products in this buffer are moved to the following machine. then the product that has to be placed in a buffer has to wait until this buffer is totally empty.
I use this method:
is i: integer; ToRow: object; moved: boolean; do moved := false; if @.quality = "Star" then for i:=1 to 11 Loop -- create name of the specific buffer ToRow := "Lairage" + to_str(i); -- if the buffer i is occupied but not full and not unloaded and it contains Star type then move to this buffer if ToRow.occupied = true and ToRow.full = false and ToRow.MU.quality = "Star" and ToRow.ToStunner = false then @.Move(ToRow); moved := true; ExitLoop; end; next; -- if there is no buffer with the given constraints above then look for an empty buffer en move the part to this buffer if moved = False then for i:=1 to 11 loop ToRow := "Lairage" + to_str(i); if ToRow.Empty then @.Move(ToRow); moved := true; ExitLoop; end; next; end; else -- one more part should be added but for now it is star or welfare. the same code as for star is used only now for welfare. for i:=1 to 11 Loop ToRow := "Lairage" + to_str(i); if ToRow.occupied = true and ToRow.full = false and ToRow.MU.quality = "Welfare" and ToRow.ToStunner = false then @.Move(ToRow); moved := true; ExitLoop; end; next; if moved = False then for i:=1 to 11 loop ToRow := "Lairage" + to_str(i); if ToRow.Empty then @.Move(ToRow); moved := true; ExitLoop; end; next; end; end; -- if the part is still not moved it means that the part could not be placed in a buffer. -- now the part should wait until it can be moved but how?? if moved = false then -- ?? end; end;
Thanks in advance!
My impression is that you already make things very complicated!
In essence, you want to keep MUs together by type and perhaps some more criteria. My suggestion is to look at one of the example models: Start page>Example models>Small examples>Discrete Material Flow>Pull control. This is the first step, once you master keeping MUs together, you can work on locking the entrance of the buffers.
If you have more attributes on the MUs, that might help. I could imagine that you have some batch id, which determines which MUs should remain together.
Forget what I said about the Pull-control, the behaviour was changed in V11 so that your case is a bit more complicated.
I have attached a sample that probably does what you need. At the core, the buffers determine when to close down, the supplying processes just try to push their MUs forward. The trick is that you should have a clear picture of the relevant conditions. And then some SimTalk of course...