Keith's solution is typical in many cases.
It can be used for time-counting as well as event counting.
The problem is, Can the accumulated number be displayed or manipulated by any math function?
If your PLC does not recognize numbers greater than 32xxx (1-word), then you could certainly have a problem trying to do anything with the accumulated number.
For example, if your accumulated value, using two 16-bit words, was 42xxx... that is, word-1 = 1 (32xxx) and word-2 = 10,000, then how can you do any thing with that number?
There certainly are ways to perform any math function on any number, no matter how you have it stored, but you have to go through much effort to make sense of it.
You could go through the effort of keeping track of the numbers in the same way that math does, that is...
x-number of 1's,
x-number of 10's,
x-number of 100's,
x-number of 1,000's,
x-number of 10,000's,
x-number of 100,000's etc.
(where x = 0 to 9)
That makes it much easier to do math on numbers that are larger than your PLC can handle. You can ADD, SUBTRACT, MULTIPLY and DIVIDE these huge numbers.
Using that method will also allow you to display numbers on your HMI that are larger than the HMI recognizes. You simply display individual unit numbers.
x-number of 100,000's,
x-number of 10,000's,
x-number of 1,000's,
COMMA
x-number of 100's,
x-number of 10's,
x-number of 1's
(where x = 0 to 9)
It takes quite a bit of extra code, but it can be done. Even in a dumb ol' AB Micrologix 1000.
Just a "heads-up".