Cancel
Showing results for 
Search instead for 
Did you mean: 

Method choose MU from line to buffer

Creator
Creator

Hi

 

I currently have a model that looks like the following:

 

CLC Model.png

 

The source produces the following MUs:

MUs.png

 

I am currently struggling with the code which will only choose the color of MU to be added to the corresponding buffer (ex. Red add to RedBuffer etc)

 

I currently have the following code in my Method for the RedBuffer which is set for the sensor closest to that buffer:

is
do
	--if  Line.cont = .MUs.Red then
	Line.cont.move(RedBuffer);
	--end;

end;

So wat do I need: I want the method to only choose the MUs which fits the Buffer (red to redbuffer etc). If the buffer is full the conveyor should keep on rotating the MUs.

 

Please help. Other methods or models suggestions would also be appreciated!!

2 REPLIES

Re: Method choose MU from line to buffer

Gears Esteemed Contributor Gears Esteemed Contributor
Gears Esteemed Contributor

in the sensorcontrol you can access the MU which triggers the sensor with @. @.name is the name of the MU:

 

if @.name="Red" then

  @.move(redBuffer);

end;

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

Re: Method choose MU from line to buffer

Creator
Creator
Thank you very much Steffen! I added the following so the line doesn't stop if the buffer is full:
if @.name = "Red" then
if RedBuffer.NumMU /= 2 then
@.move(RedBuffer);
end;
end;