StepValue Tag Property
Retrieval generally does not take into account how a value changes. When retrieving data from the archive, Historian will attempt to interpolate it, which may result in an inaccurate representation of the data's real world changes, such as that shown in the following figure.

In order for Historian to know that a tag did not ramp down between reported values, the StepValue tag property must be applied. This tag property is used to indicate that the value in the real world changes in a sharp step instead of a smooth linear interpolation. An example would be a digital signal that quickly goes 0 to 1. Or, a flow rate that goes 5 to 25 when an upstream valve is opened.
- Example: Reporting Step Change
-
Copy and paste the following into an empty CSV file and import the file with the File collector.
[Tags] Tagname,DataType,HiEngineeringUnits,LoEngineeringUnits TAG1,SingleFloat,100,0 [Data] Tagname,TimeStamp,Value,DataQuality tag1,9/19/05 05:15:00,26.41,Good tag1,9/19/05 06:15:00,26.45,Good tag1,9/19/05 07:15:00,26.59,Good tag1,9/19/05 08:15:00,26.58,Good tag1,9/19/05 09:15:00,26.36,Good tag1,9/19/05 10:15:00,10.74,Good tag1,9/19/05 11:15:00,11.00,Good tag1,9/19/05 12:15:00,10.94,Good tag1,9/19/05 13:15:00,11.03,Good
Set the StepValue=TRUE in Historian Administrator. Then, use the following query to retrieve data using Average with a 15 minute interval.
select * from ihrawdata where tagname=TAG1 and timestamp > '9/19/05 09:30:00' and timestamp <= '9/19/05 11:30:00' and calculationmode=average and intervalmilliseconds=15m
You will see the following results, which show two distinct steps:
Value Quality 09:45:00 26.36 10:00:00 26.36 10:15:00 26.36 10:30:00 10.74 10:45:00 10.74 11:00:00 10.74 11:15:00 10.74 11:30:00 11.00 If you set the
StepValue=FALSE
and run the same query, you will see the following results, which reflect interpolated values.Value Quality 09:45:00 22.46 10:00:00 18.55 10:15:00 14.64 10:30:00 10.74 10:45:00 10.80 11:00:00 10.87 11:15:00 10.93 11:30:00 11.00 - Example: No raw sample at start time
-
Copy and paste these lines into an empty CSV file and import the file with the File collector
[Tags] Tagname,DataType,HiEngineeringUnits,LoEngineeringUnits,StepValue TAG2,SingleFloat,100,0,TRUE [Data] Tagname,TimeStamp,Value,DataQuality TAG2,9/19/05 13:59:00.000,22,Good TAG2,9/19/05 14:08:00.000,12,Good TAG2,9/19/05 14:22:00.000,4,Good
Use the following query to retrieve the data using Average with a 30 minute interval
select * from ihrawdata where tagname=tag2 and timestamp > '9/19/05 14:00:00' and timestamp <= '9/19/05 14:30:00' and calculationmode=average and intervalmilliseconds=30m
You will see the following results.
Time Stamp Value Quality 14:30:00 12.53 100.00 The following table is another way to look at the data as values and durations.
Point Value Duration (Seconds) Point 1 22.00 480 (lab sampled at start) Point 3 12 1320 Point 4 4 480 The step value average would be:
((22.00 * 480) + (12 * 840) + (4 * 480)) / (480 + 840 + 480) = 12.53
The percent good is 100 since it was good the whole time.
The interpolated average is 12.24 because the first sample is different.
Point Value Duration (Seconds) Point 1 20.88 480 (lab sampled at start) Point 3 12 1320 Point 4 4 480 The lab average would be:
((20.88 * 480) + (12 * 840) + (4 * 480)) / (480 + 840 + 480) = 12.24
- Example: Raw sample at end time
-
The point of this example is that if you have a raw sample on the interval end time then it is ignored because of the time weighting.
Copy and paste these lines into an empty CSV file and import the file with the File collector.
[Tags] Tagname,DataType,HiEngineeringUnits,LoEngineeringUnits,StepValue TAG5,SingleFloat,100,0,TRUE [Data] Tagname,TimeStamp,Value,DataQuality TAG5,9/19/05 13:10:00.000,22,Good TAG5,9/19/05 14:18:00.000,12,Good TAG5,9/19/05 14:30:00.000,1,Good
Use the following query to retrieve the data using Average with a 30 minute interval.
select * from ihrawdata where tagname=tag5 and timestamp > '9/19/05 14:00:00' and timestamp <= '9/19/05 14:30:00' and calculationmode=average and intervalmilliseconds=30m
You will see the following results.
Time Stamp Value 14:30:0 18.00 See that the last raw sample is ignored
Point Value Duration (Seconds) Point 1 22.00 1080 (lab sampled at start) Point 3 12.00 720 Point 4 1.00 0 The lab sampled average is:
((22.00 * 1080) + (12 * 720) + (1 * 0)) / (1080 + 720) = 18.0
- The interpolated average gives 13.59 because of the different interpolated value at interval start.
- The percent good is 100 since it was good the whole time.
- Example: No raw samples in interval
-
This case shows the biggest difference between averages of step value and non step value tags. In this case we lab sample a value at the start time and that is the average.
Copy and paste these lines into an empty CSV file and import the file with the File collector.
[Tags] Tagname,DataType,HiEngineeringUnits,LoEngineeringUnits,StepValue TAG4,SingleFloat,100,0,TRUE [Data] Tagname,TimeStamp,Value,DataQuality TAG4,9/19/05 13:55:00.000,99,Good TAG4,9/19/05 14:40:00.000,10,Good
Use the following query to retrieve the data using Average.
select * from ihrawdata where tagname=tag4 and timestamp > '9/19/05 14:00:00' and timestamp <= '9/19/05 14:30:00' and calculationmode=average and intervalmilliseconds=30m
You will see the following results.
Time Stamp Value Quality 14:30:00 99 100 Note: The single lab sampled value at interval start time is the average.Retrieving the data when StepVa
lue=FALSE
gives the following:Time Stamp Value Quality 14:30:00 89.11 100 Note: The single interpolated sample at interval start time is the average of the interval.