Example Case for Hybrid Mode

This topic covers an example case of the InterpolatedtoRaw hybrid mode illustrating the switching of data between raw and calculated data.

The following data is used in the example below. You can import this data into Historian if you want to try the example yourself:

Tag1 5/16/2011 15:52:24 1,000.0000000 100.0000000
Tag1 5/16/2011 15:52:25 1,001.0000000 100.0000000
Tag1 5/16/2011 15:52:26 1,002.0000000 100.0000000
Tag1 5/16/2011 15:52:27 1,003.0000000 100.0000000
Tag1 5/16/2011 15:52:28 1,004.0000000 100.0000000
Tag1 5/16/2011 15:52:29 1,005.0000000 100.0000000
Tag1 5/16/2011 15:52:30 1,006.0000000 100.0000000

Case 1:

Use the following query to retrieve data for Tag 1 where it requests for 5 samples using InterpolatedtoRaw mode.

SET starttime= '5/16/2011 15:52:05 PM', endtime= '5/16/2011 15:52:47 PM', numberofsamples = 5, samplingmode= Interpolatedtoraw SELECT * FROM ihrawdata where tagname = "TAG1"

The query will return interpolated data as shown below because the actual number of raw samples (7) is greater than the requested number of samples (5):

tagnametimesstampvaluequalitysamplingmodenumberofsamples
Tag1 5/16/2011 15:52:13 0.0000000 0.0000000 InterpolatedtoRaw 5
Tag15/16/2011 15:52:21 0.00000000.0000000InterpolatedtoRaw5
Tag15/16/2011 15:52:30 1,006.0000000 100.0000000 InterpolatedtoRaw 5
Tag15/16/2011 15:52:38 1,006.0000000100.0000000InterpolatedtoRaw5
Tag15/16/2011 15:52:47 1,006.0000000100.0000000InterpolatedtoRaw5

Case 2:

Use the following query to retrieve data for Tag 1 where it requests for 50 samples using InterpolatedtoRaw mode.

starttime= '5/16/2011 3:52:05 PM', endtime= '5/16/2011 3:52:47 PM', numberofsamples = 50, sampling- mode= Interpolatedtoraw SELECT & FROM ihrawdata where tagname = "TAG1"

The query will return raw data as shown below because the actual sample count(7) is less than the requested sample count (50):

tagnametimesstampvaluequalitysamplingmodenumberofsamples
Tag1 5/16/2011 15:52:24 1,000.0000000100.0000000InterpolatedtoRaw 50
Tag15/16/2011 15:52:25 1,001.0000000100.0000000 InterpolatedtoRaw50
Tag15/16/2011 15:52:26 1,002.0000000100.0000000 InterpolatedtoRaw 50
Tag15/16/2011 15:52:27 1,003.0000000100.0000000InterpolatedtoRaw50
Tag15/16/2011 15:52:28 1,004.0000000100.0000000InterpolatedtoRaw50
Tag15/16/2011 15:52:29 1,005.0000000100.0000000InterpolatedtoRaw50
Tag15/16/2011 15:52:30 1,006.0000000100.0000000InterpolatedtoRaw50

Case 3

Use the following query to retrieve data for Tag 1 where it requests for samples in a time interval (milliseconds), using InterpolatedtoRaw mode.

SET starttime= '5/16/2011 3:52:05 PM', endtime= '5/16/2011 3:52:25 PM', intervalmilliseconds=10s , samplingmode= Interpolatedtoraw
Tag1 5/16/2011 15:52:24 1,000.0000000 100.0000000 
Tag1 5/16/2011 15:52:25 1,001.0000000 100.0000000

The query will return interpolated data as shown below because the actual number of raw samples (7) is greater than the requested number of samples (5):

TagnameTimesstampValueQualitySampling MOde
Tag15/16/2011 15:52:241,000.00000001,000.0000000InterpolatedtoRaw
Tag15/16/2011 15:52:251,001.00000001,000.0000000InterpolatedtoRaw