Cancel
Showing results for 
Search instead for 
Did you mean: 

Event Controller StartStopCtr StartStop Event Method

Pioneer
Pioneer

I want to run a method in an object when the Event Controller Start/Stop button is stopped.  Is there a way to do this?

It is prefered that the method is in the object, not in the event controller (this way I don't need a custom event controller for all models).

 

I found the StartStopCtrl - and made the assumption it was liket he InitCtrl that calls 'init' methods in all the objects.  However, It appears it does not do this.

 

EndSim only runs on the end of the Sim.

 

Thanks.

2 REPLIES

Re: Event Controller StartStopCtr StartStop Event Method

Siemens Phenom Siemens Phenom
Siemens Phenom

Hello,

the explanations of StartStopSt / StartStopCtrl in the documentation are good. Please also check the code example.

Only methods with the names "Reset", "init" and "endSim" are called at the corresponding simulation events.

 

Please note that there is a difference between a method object "init" and the InitCtrl of the eventcontroller:

Generate a model with a WorkerPool and debug both methods. When the InitCtrl is called the Workers are not yet generated. When the Init method is called the worder are generated.

 

It is not recommended to use InitCtrl with the name "init" because it is difficult to debug such a model.

 

Regards,

Peter

 

Re: Event Controller StartStopCtr StartStop Event Method

Pioneer
Pioneer

I guess this means the answer is - No - There is not a 'method' that is triggered on the Start Stop event of the event controller.

 

Back to the drawing board.

 

Thanks.