I agree with Alaric. A float gives you much more data. Just decide how frequently you want to count to trade for resolution for total time. I'd recommend working backward. Overestimate your max time count. Divide your float size by that number to get your smallest interval. Round up - realistically you probably won't need anywhere near that level of precision. That's the advantage of using a float versus a counter that only goes to 999.
Alternatively, you can do this in software with
FactorySQL. You drag a tag into your group and make it an "hour meter". This creates a datetime column in your SQL database table that has a high resolution, high capacity storage. Suppose your group runs every 10 seconds. If the register/tag is "true" (usually = 1, but can be an expression) then 10 seconds will be added.
Additional advantages: Simple to configure for literally hundreds of points (devices). Storing in an SQL database provides easy options for reporting, manipulating, and displaying the data. Persistant storage means the data won't be lost in a power failure, PLC download, etc. Can set warnings/alarms that log or conditionally send emails (text messages).
Disadvantages: Doing it in software means that the computer must be up and talking to the PLC. The SQL database being down isn't important due to cached queries that will run on a reconnect.
You could get by the disadvantage by setting the PLC to accumulate time, then have FactorySQL periodically trigger in a read to the database and reset the values. IMO motor uptime is pretty approximate to justify that.
Alaric said:
Skip the counter and use a real or a dint.
Every 36 seconds add .01 to a floating point number. This will give total hours in hundredths of an hour. Or if you only want tenths of an hour then add .1 ever 360 seconds. If you are only interested in whole hour units then ADD 1 to a DINT once ever hour.