Cancel
Showing results for 
Search instead for 
Did you mean: 
Highlighted

Moving a specific object from the buffer

Experimenter
Experimenter

Hello,

 

I have a plant that creates 3 types of products. They enter a buffer, and when 4 of the same type are in the buffer, a batch of these products must go to the next process. I have a method that keeps track of how many of each type are in the buffer, but I can't figure out how I can move a specific type to the next process. I only know how to move the first object in the buffer.

 

Thanks in advance for your help

3 REPLIES 3

Re: Moving a specific object from the buffer

Gears Esteemed Contributor Gears Esteemed Contributor
Gears Esteemed Contributor
you can use the method <buffer>.mu(index) to access the parts in the buffer.
The destination should be able to receive a certain number of parts at the same time (e.g. ParallelProc).
Steffen Bangsow
freelance simulation specialist  
web: www.bangsow.eu
mail: steffen@bangsow.net

Re: Moving a specific object from the buffer

Experimenter
Experimenter

How can I specify the type in index? When I use <buffer>.mu(1) it takes the first product in the buffer, and <buffer>.mu(type1) doesn't seem to work.

Re: Moving a specific object from the buffer

Gears Esteemed Contributor Gears Esteemed Contributor
Gears Esteemed Contributor
you pass an index (integer), you need to compare the type to find your MU e.g.

for i:=buffer.numMu downTo 1 loop
if buffer.MU(i).name =yourType then
buffer.MU(i).move(yourDestination)
end
next

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