Periodic Timers - how to prevent autostart?

A forum devoted to the discussion of all topics having to do with scripting and other advanced programming using iX Developer.
Post Reply
smolenak
Posts: 22
Joined: Tue Nov 20, 2012 3:06 am

Periodic Timers - how to prevent autostart?

Post by smolenak »

I have tried this example:
http://ixtalk.beijerelectronics.us/view ... hp?f=9&t=5

But my question is, how could I prevent the timer from starting right after when the application is started? Now it starts counting automatically, and that's why I cannot use it properly.

Thanks in advance!

User avatar
Edmund
Posts: 92
Joined: Thu Nov 29, 2012 2:27 pm

Re: Periodic Timers - how to prevent autostart?

Post by Edmund »

Remove

Code: Select all

timer1.Enabled = true;    

timer2.Enabled = true;     

From the constructor.

So it looks like this

Code: Select all

 static TimerScript()
      {
         timer1 = new Timer();
         timer1.Tick += new EventHandler(TimeOut1);
         timer1.Interval = 1000;
         
         
         timer2 = new Timer();
         timer2.Tick += new EventHandler(TimeOut2);
         timer2.Interval = 250;
         
      }
Edmund Andersson

AITECH AB

Part of Beijer Integrator Group

smolenak
Posts: 22
Joined: Tue Nov 20, 2012 3:06 am

Re: Periodic Timers - how to prevent autostart?

Post by smolenak »

That's it - thanks a lot, Edmund!! :)

Post Reply