Cancel
Showing results for 
Search instead for 
Did you mean: 

Finally execution

Pioneer
Pioneer

Hello guys. My project in the PS performs the production of parts contained in Table, but when you finish parts from Table, the EventController continues running. How do I stop executing when having made all the parts of my Table?

3 REPLIES

Re: Finally execution

Solution Partner Genius Solution Partner Genius
Solution Partner Genius

If in the Mu selection, 'sequence' is selected, then plant simulation stops automatically once the producesd Mus are processed. If you have any other scanario, you can try using the code as shown

eventcontroller.stop;

The execution point of this line depends on your model.

Re: Finally execution

Pioneer
Pioneer

Thanks, but my pieces are produced by Workers. If I trigger 'EventController.Stop' when my production is over, the workers will still be in their jobs. Must stop the EventController when it's over production and workers have already gone to WorkerPool.

Re: Finally execution

Solution Partner Genius Solution Partner Genius
Solution Partner Genius

Hello Martins,

 

You can use resworking of singleproc to account this. Example Code is as shown.

is
do
   if ?.statnumin=2 then
	?.exitlocked := true;
	waituntil (A.resworking=false and B.resworking=false) prio 1;
	eventController.stop;
    end;
	
end;