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.

Note: The StepValue tag property only affects retrieval of Average values in Historian. It does not affect data collection or storage.
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 the 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:

ValueQuality
09:45:0026.36
10:00:0026.36
10:15:0026.36
10:30:0010.74
10:45:0010.74
11:00:0010.74
11:15:0010.74
11:30:0011.00

If you set the StepValue=FALSE and run the same query, you will see the following results, which reflect interpolated values.

ValueQuality
09:45:0022.46
10:00:0018.55
10:15:0014.64
10:30:0010.74
10:45:0010.80
11:00:0010.87
11:15:0010.93
11:30:0011.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 StampValueQuality
14:30:0012.53100.00

The following table is another way to look at the data as values and durations.

PointValueDuration (Seconds)
Point 122.00480 (lab sampled at start)
Point 3121320
Point 44480

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.

PointValueDuration (Seconds)
Point 120.88480 (lab sampled at start)
Point 3121320
Point 44480

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 StampValue
14:30:018.00

See that the last raw sample is ignored

PointValueDuration (Seconds)
Point 122.001080 (lab sampled at start)
Point 312.00720
Point 41.000

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 StampValueQuality
14:30:0099100
Note: The single lab sampled value at interval start time is the average.

Retrieving the data when StepValue=FALSE gives the following:

Time StampValueQuality
14:30:0089.11100
Note: The single interpolated sample at interval start time is the average of the interval.