cancel
Showing results for 
Search instead for 
Did you mean: 

Buffer method not emptying

i've written a simple method for filling a buffer with MUs and then, with the entrance locked, emptying it without any further entrance until it is fully empty.

 

entrance.png

 

Unfortunately the method is working for the first part of filling the buffer but not in emptying it (see the files attached).

Anybody help for what is missing?

1 REPLY

Re: Buffer method not emptying

Phenom
Phenom

two changes: @ ist only one part, to access the parts in the buffer use ?.cont.

If you move within a loop, you need to wait a little timespan, so the drain can process the parts.

 

is
do
	waituntil ?.Full = true prio 1;
	?.EntranceLocked := true;
	for local i := 1 to ?.NumMU loop
		?.cont.move(Drain);
		wait(0.01);
	next;
	?.EntranceLocked := false;
end;

Steffen Bangsow
freelance simulation specialist  
web: www.bangsow.eu
mail: steffen@bangsow.net