Hour Meter on ControlLogix


Introduction to the Hour Meter on ControlLogix

The advantage of having an hour meter on ControlLogix is for routine maintenance. With this purpose in mind, we use a retentive timer in conjunction with a counter. The counter will keep track of total machine run hours. Likewise, with an hour meter, you could keep track of total machine downtime.

By knowing total machine run hours, you can estimate the remaining life of the equipment. Likewise, you will schedule routine maintenance in the same way you would for an automobile. By scheduling routine maintenance based on run hours, you will prolong the life of your equipment. You might also schedule automatic maintenance, such as a lube system to trigger at regular intervals.

Create the Tags

Our first step is to create the tags. I’m just going to add these to the Controller Tag database. You will need a tag with a “Timer” Data Type. Likewise, create a tag with a “Counter” Data type. In this case, I’m also going to create a tag called “Machine Run” with a bool type. This bit will represent the fact that our equipment is running.

Write the Logic

How that our tags are set up, we will write the logic. Our first step is to write a Retentive timer (RTO) which will keep track of total accumulated time within an hour. Since the preset is in milliseconds, I’ll enter 3600000. This is one hour.

In the next step, add a counter instruction which is triggered by the Done (DN) Bit of the Timer. As a result, the counter’s accumulated value will increase by 1 each time an accumulated hour has passed.

The maximum value of a counter is over 2 Billion, which, in this case, calculates to about a quarter of a million years. Overflowing the counter is not something we need to worry about for an hour meter.

Finally, reset the RTO instruction AFTER the count is made.

Summary

When we set the MachineRun bit, the HourTimer times in Milliseconds. If the MachineRun bit is shut off, the accumulator of this timer retains it’s value. When the MachineRun bit is set again, the RTO will pick up where it left off. After one hour of run time, the Counter’s accumulated value is increased by 1. At this point, the HourTimer resets.

Visit the ControlLogix Category Page for more information on ControlLogix!

— Ricky Bryce

Leave a comment

Your email address will not be published. Required fields are marked *