Host Engineering Forum

General Category => DirectSOFT => Topic started by: LOGISTIX on February 22, 2010, 04:13:31 PM

Title: Handling large integers.
Post by: LOGISTIX 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
Title: Re: Handling large integers.
Post by: b_carlton 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.
Title: Re: Handling large integers.
Post by: LOGISTIX on February 23, 2010, 10:01:45 PM
Works great! thank you. Exactly the help I was looking for. :)