TIME Functions - TIMEGT(x), TIMELT(x), TIMEEQ(x)
The time functions retrieve all records for the tags and then accumulates the time the value matches the criteria. It "holds last value" and data does not need to be logged every minute.
WARNING: The TIMEGT(x), TIMELT(x), TIMEEQ(x) DO NOT SUPPORT Filtering. Any entries in the Filter Data section are ignored when the Statistic is TIMEGT(x), TIMELT(x), TIMEEQ(x).
Example #1: Calculate Number of minutes Pump1_Status was > 24. Data is logged when the tag value changes.
TIMEEQ(24) returns 139.0667
Example 2: Import the Number of minutes Pump1_On was = 1. Data is logged every 5 minutes
TimeEQ(1) returns 60 for 9/23/2014:
TWA Function - Time Weighted Average Function
Typically, this function is used when data is logged on change (not on a fixed frequency).
WARNING: TWA does not support “Filter Tag” option due to how Ignition only writes values when changed.
Example #1: Calculate the time weighted average for the FIT_I_FLOW tag. The units of the tag are "GPH", therefore no scaling is required.
TWA returns 18.43556 for the midnight to 1AM hour.
Explanation of calculation.
1st calculate the amount of seconds that the value was 10 in the hour:
910 (15 minutes * 60 + 10)
Multiply the number of seconds with the value 10 = 9100
2nd calculate the number of seconds the value was 20 in the hour:
1823 (30 minutes * 60 + 33)
Multiply the number of seconds with the value 20 = 36460
3rd calculate the number of seconds the value was 24 in the hour:
867 (14 minutes * 60 + 27)
Multiply the number of seconds with the value 24 = 20808
Sum the totals
66368 (9100 + 36460 + 20808)
Divide the sum with the number of seconds in the hour
18.43556 (66368 / 3600 seconds in hour)