Author Topic: Timers Showing -1  (Read 10984 times)

MarkWater

  • Newbie
  • Posts: 10
  • I'm a llama!
    • View Profile
Timers Showing -1
« on: June 03, 2014, 02:54:20 PM »
When my timer is inactive, or completed it shows a -1 on my HMI. Is there a way to replace this with a 0?

support

  • Global Moderator
  • Hero Member
  • *****
  • Posts: 3174
    • View Profile
    • Internet Programmable PLCs
Re:Timers Showing -1
« Reply #1 on: June 03, 2014, 03:29:16 PM »
Internally the timer present-value uses -1 to indicate to the CPU that it is inactive. If the timer-present value is zero it could also mean time-out which may not be your intention?

If you don't reset the timer, but simply assign it a new PV and clear its contact whenever you want to restart the timer then it will count down to zero from the new value and will never become -1 (except after power on reset).

E.g.   CLRIO Timer1    ' assuming timer is named Timer1
         TIMERPV[1] = 50   ' start a 5 second count down.

Email: support@triplc.com
Tel: 1-877-TRI-PLCS