Author Topic: Interupt to trigger a timer  (Read 5902 times)

Pilot

  • Newbie
  • Posts: 4
    • View Profile
    • William Arthur
Interupt to trigger a timer
« on: September 30, 2009, 09:59:48 AM »
I'm trying to use an interupt (INTRDEF) to activate a hs timer.  The timer(s) have been been defined high speed in a custom function executed at the beginning of the program.  Should the interupt custom function be positioned in the same ladder circuit as the timer or in a circuit immediatly before the timer circuit?  I need to eliminate any lag between triggering the input and starting the timer.  Thanks in advance for your insight.

support

  • Global Moderator
  • Hero Member
  • *****
  • Posts: 3171
    • View Profile
    • Internet Programmable PLCs
Re:Interupt to trigger a timer
« Reply #1 on: September 30, 2009, 11:05:08 AM »
It doesn't matter where the custom function is placed. Once you execute the INTRDEF, the moment the interrupt edge occurs, after an interrupt latency (< 2ms)  the interrupt service custom function will be called and in it it you must start the timer using:

  TIMERPV[n]  = xxxx   ' n is the timer #, xxx is the timing value.

When the timer times out its contact will be turned ON and the ladder logic takes over and the timer contact will handled like regular contact in the ladder logic portion.
 
Email: support@triplc.com
Tel: 1-877-TRI-PLCS