News:

  • April 16, 2026, 01:36:20 PM

Login with username, password and session length

Author Topic: Handling large integers.  (Read 6835 times)

LOGISTIX

  • Newbie
  • *
  • Posts: 2
Handling large integers.
« on: February 22, 2010, 04:13:31 PM »
Good day - I have been scratching my head on this for a while and everything I try seems way too complicated to be right. There must be a simpler way!
In a nutshell I am trying to count pulses received via a digital input. The pulses come at a rate of about 1 per second and I need to count about 2 weeks worth (machine runs 24/7) - works out to about 1209600 pulses. After that it can roll over to zero and start counting again (reset). My problem is that if I place a CNT box to count the pulses it will only go to 9999. I have tried placing two CNT boxes in the sequence and then adding the values, but i still cannot obtain a result in excess of 9999 (not to mention that this is a clumsy solution).
Any ideas will be most welcome.
With thanks,
Laurence

b_carlton

  • Internal Dev
  • Hero Member
  • ****
  • Posts: 606
    • thePLCguy
Re: Handling large integers.
« Reply #1 on: February 22, 2010, 05:04:37 PM »
Check out the UDC counter. You dont have to use the Down portion. Though remember it uses two V memory locations each for its preset and accumulated values.
An output is a PLC's way of getting its inputs to change.

LOGISTIX

  • Newbie
  • *
  • Posts: 2
Re: Handling large integers.
« Reply #2 on: February 23, 2010, 10:01:45 PM »
Works great! thank you. Exactly the help I was looking for. :)