Call us! 512-349-0334 or (877) INDUSOFT

Building an Hour Meter in InduSoft Web Studio SCADA Software

Have you ever needed an Hour Meter for a piece of equipment?  Here’s a pre-built Hour Meter Linked Symbol  for InduSoft Web Studio that you can add to your SCADA or HMI application.  The Hour Meter displays elapsed time in 1/100 Hour increments (36 Seconds) up to 99999 Hours (around 11 ½ years) and has an indicator to show when it’s running (Figure 1).

The Hour Meter Symbol is very flexible.  It is designed to be used as a single machine display using a discrete tag for each of the values.  The meter can also be used to show multiple machines, or even to show elapsed time and time since a maintenance reset simply by using a class tag and pointer tags to display the desired values.

The application (Figure 2) demonstrating the meter symbol is designed using an arrayed Class Tag called “HourMeter” of type cHourMeter containing the following members with retention turned on, in order to store the last values so the meter will restart in the same place it was if the application was shut down for any reason (Figure 3).

The Hour Meter timing is controlled by a Change Event in the Scheduler using the system tag “second” in order to initiate the updates. The change event sets the Boolean tag, “bSecondTrigger”.  This condition is tested for in the Script Task, “Hour Meter” (Figure 4).

Using a “Change” event and the system tag “Second” as the trigger ties the “bSecondTrigger” tag change to the OS System Clock (Figure 5).

The symbol has four properties to display the complete information for the Hour Meter and Label.  Replace the placeholders in the symbol with appropriate tags from your application. The demo application uses indirect tags so that multiple meter information can be shown in the symbol (Figure 6).

 

The Meter Selection buttons refresh the indirect tags with the appropriate information (Figure 7).

The Reset button is the final feature in the demo application.  It resets the currently selected meter (Figure 8).

A Final Word about using Retentive Values:

Tags with the “Retentive” property enabled, save their values in a database located in the project folder, updated at the runtime shutdown.  If the machine or the OS should crash for any reason, such as the power going off unexpectedly, so that the current retentive values are not saved correctly, or the hard drive becomes corrupt or unreadable, the last values normally saved in the retentive parameter of the tags database will be lost.

In order to properly create an Hour Meter for any machine or process line using InduSoft Web Studio logic as described in this article, it is prudent to also save the values at regular intervals in an alternate safe location such as a historian. This would be true for any retentive values used within the application, and not just the tags for this single Hour Meter object.

Another and perhaps better scheme for retaining machine hours would be to actually create the values for the machine hours, tenths and hundredths within the PLC logic, and write them to a non-volatile place in the PLC memory, then simply use the HourMeter Linked Symbol to display the information stored in the registers.  Some PLCs already have a built-in provision for calculating and storing machine hours, so it is simply a matter of displaying the appropriate register(s) in the Hour Meter symbol by reading it/them from the PLC and displaying the tags in the symbol.

There is a newer symbol called “HourMeterDisabled.sym” with this added functionality and an extra application that demonstrates it (Figure 9).  Both applications are located in the same zip folder.

In the updated symbol, there is an extra Property included that turns on (unhides) a red light covering the spinning indicator.  Simply use the same “disable” Boolean tag in the timer test line of the script to inhibit the timer from updating (Figure 10).

Additionally, if you don’t like the light, edit the linked symbol and delete the light (an ellipse), and under it is an embedded stationary indicator that also unhides using the same property, which covers the spinning indicator (Figure 11).

Other schemes to show when the meter is disabled can also be implemented if desired using the same Boolean property simply by editing the linked symbol.

Both of the Hour Meter Symbols are available in the InduSoft Store here. The demo applications (single .zip file) can be downloaded here.

Leave a Reply