Cancel
Showing results for 
Search instead for 
Did you mean: 

Shift Calendar and EventController.

Creator
Creator

Hello everyone.

Is it possible to automatically end simulation in eventcontroller when my Shift Calendar is active and my model stops working? I mean that without Shift Calendar simulation process ends automatically and gives me results when all MUs are in Drain. But when I add shift calendar, eventcontroller works indefinitely. I dont want to set simulation time, but ends it automatically when all MU's are in drain.

Thank you in advance for any help.

9 REPLIES

Re: Shift Calendar and EventController.

Gears Esteemed Contributor Gears Esteemed Contributor
Gears Esteemed Contributor
look here

https://community.plm.automation.siemens.com/t5/Plant-Simulation-Forum/Simulation-time-won-t-stop-wh...

insert the method as entrance control of the drain
Steffen Bangsow
freelance simulation specialist  
web: www.bangsow.eu
mail: steffen@bangsow.net

Re: Shift Calendar and EventController.

Creator
Creator

Thank You. But i don't understand how "if @.class.numChildren = 1" works. What if I have different MUs? For example I have 100 different MUs in my simulation. I tried:

if drain.nummu=100
	eventController.end:=eventController.simTime+0.1
end;

but it doesn't work. How can I stop a simulation when a certain number of MUs get to the drain?

Re: Shift Calendar and EventController.

Gears Esteemed Contributor Gears Esteemed Contributor
Gears Esteemed Contributor
drain.numMu is 0 or one, you need to check the number of MUs in the entrance statistics

if drain.statNumIn=100 then
...

If you use the class .MUs.Entity for your model, then the class "knows" all its children. This means, if the MU on the drain is the last one, the MU class also "knows" this --> the number of its children is one. This you can use in plant simulation e.g.

if .MUs.Entrity.numChildren= 1 then
--this is the last one
Steffen Bangsow
freelance simulation specialist  
web: www.bangsow.eu
mail: steffen@bangsow.net

Re: Shift Calendar and EventController.

Creator
Creator
Thank you for explanation. It works perfectly.

Re: Shift Calendar and EventController.

Creator
Creator

Hi,

I have the same problem but I can not use Method programing. Can someone help me what I should write there? Below my simulation. I'd like stop simulation when 20 elements "Jacket" go to drain1.

 

ps1.jpgps2.jpg

Re: Shift Calendar and EventController.

Gears Esteemed Contributor Gears Esteemed Contributor
Gears Esteemed Contributor
there are only Jackets in Drain1 ?
Steffen Bangsow
freelance simulation specialist  
web: www.bangsow.eu
mail: steffen@bangsow.net

Re: Shift Calendar and EventController.

Creator
Creator

Yes.

From Assembly Station "Station3D" exit MUs "Jacket" and it is final product.

ps3.jpg

 

Re: Shift Calendar and EventController.

Gears Esteemed Contributor Gears Esteemed Contributor
Gears Esteemed Contributor
then the code in your picture should work as a entrance control of drain1
Steffen Bangsow
freelance simulation specialist  
web: www.bangsow.eu
mail: steffen@bangsow.net

Re: Shift Calendar and EventController.

Creator
Creator

I forgot to put Method in tab controls in Drain1. Now it's working. Thanks!