Learn about the various techniques for resetting hour and event meter counters through the Reset Counter option and database values.

Video recorded using: Ignition 8.1


(open in window)

[00:00] In previous lessons, we looked at how hour and event meters can help us track the behavior of numeric and Boolean group items. As we've established an event meter is counting the number of times a tag becomes true or becomes false depending on its settings. Similarly, we've discussed the retentive property on hour meters, which allow the meters value to be held rather than reset to zero. In both cases, we faced the prospect of a group item that counts up in value forever and never gets reset. In this lesson, we'll be exploring reset functionality in a bit more depth particularly for event meters and retentive hour meters since non retentive hour meters reset on their own. Here we'll be working with the group items from the prior lesson in this series. So we have a Boolean tag and then some hour and event meters configured against it on our other items. Let's say open up my total time off item which is a retentive hour meter that will count up forever. One thing I can do in here is check the reset on condition checkbox, which will allow us to configure a logical check that would reset the counter if it evaluates as true.

[01:09] So here maybe I'll opt to restart the total time off counter if the time on value goes above, let's say five. So if our Boolean tag is set to true for long enough in this case five seconds, we will wipe this counter. What I do here is click that tag icon and then select the time on group item, like so, and then click Okay. And then we'll have our check be greater than five. So setting that number to five will give us the check against time on that we need. So I can include by clicking Okay. Hitting Save, and then testing it out. So with the tag set to false, we'll get our counter going. And then once we set it to true, if we wait five seconds, we can eventually see the total time off item go back to zero. The primary way of resetting a retentive or event meter is using that reset on condition checkbox.

[02:05] It's worth noting though that it is also possible to reset meters by writing to them directly. Of course, the caveat here is that given the unique way that a meter is configured, the only opportunity you typically have to write to a meter item directly is from the database which won't always be feasible or meaningful depending on the group that you have set up. However, in certain situations typically making use of a bi-directional DB wins update mode we could have an hour or event meter that we logged to the database, but also reset via database edits. We could also write to the item from either a success or failure handshake. If we were to pursue either approach one bonus is that we could write any value we want to the counter rather than just zero. So that wraps up the ways we can reset an hour or event meter inside of a transaction group based on a simple logical or numeric check via database edits or using a handshake.

You are editing this transcript.

Make any corrections to improve this transcript. We'll review any changes before posting them.