Cancel
Showing results for 
Search instead for 
Did you mean: 

discharge vehicle at sensor

Pioneer
Pioneer

Hello,

i want to discharge a vehicle at a sensor point with the following method

(SensorID : integer; Bug : boolean)
is
	TabellenName : object;
do
	TabellenName := (@.name+"_"+to_str(@.id)+"_Bestand");
	
	if SensorID = 1 then
		
		while @.voll = true loop
			@.Inhalt.umlagern(Puffer);
		end;
		
		TabellenName.löschen;
	end;
		
end;

But somehow my vehicle has the same amount of BEs after passing the sensor. Only the table content is deleted.

I tried various methods like leer = false (empty) or AnzahlBEs > 0 (AmoutOfBEs) but then my programm crashes.

 

If i don't use a while-loop only 1 BE is discharged.

 

I hope you guys can help me with my simple question but i don't know why it doesn't work. I know that i can solve this problem with a DismantleStation or a converter (there i don't know where to fit my tablecontent deleting), but i want to solve it with a sensor-method

 

Thanks in advance

 

Carsten

2 REPLIES 2

Re: discharge vehicle at sensor

Gears Esteemed Contributor Gears Esteemed Contributor
Gears Esteemed Contributor

the buffer needs to shift the parts, so you need a little delay between the MUs, if you use the contition
while @.voll = true loop

only one part is moved, then the condition @.voll returns false.

Try this instead:

 

--stop the transporter

@.angehalten:=true;

while @.belegt loop
   @.Inhalt.umlagern(Puffer);

  wait(0.1);

end;

--start the transporter

@.angehalten:=false;

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

Re: discharge vehicle at sensor

Pioneer
Pioneer

Works perfect. Thank you very much.

 

Greetings

Carsten