Hybrid Modes
Hybrid mode is an advanced method of sampling collected data for trending. This mode of sampling has the ability to switch between sampled (like interpolated or trend) and raw data based on the actual and requested number of samples or a specified time interval. The purpose of these modes is to return the minimum number of points to speed and simplify trending .
Hybrid mode is available for Interpolated, Lab, Trend, and Trend2 modes of sampling.
In these hybrid modes, the behavior is as follows
- If the actual number of stored samples is fewer than requested you will receive the raw data samples.
- If the actual number of stored samples is fewer than requested you will receive the raw data samples.
Data for Examples
[Tags]
Tagname,DataType
TagA,DoubleInteger
[Data]
Tagname,Timestamp,Value,Quality
TagA,01/06/2014 12:00:01 PM,40000000,Good
TagA,01/06/2014 12:00:02 PM,30696808,Good
TagA,01/06/2014 12:00:03 PM,1952308224,Good
TagA,01/06/2014 12:00:04 PM,672641664,Good
TagA,01/06/2014 12:00:05 PM,636126336,Good
TagA,01/06/2014 12:00:06 PM,1826624640,Good
TagA,01/06/2014 12:00:07 PM,838753408,Good
TagA,01/06/2014 12:00:08 PM,520660896,Good
TagA,01/06/2014 12:00:09 PM,1293350272,Good
TagA,01/06/2014 12:00:10 PM,1959451264,Good
TagA,01/06/2014 12:00:11 PM,89220576,Good
TagA,01/06/2014 12:00:12 PM,1951745280,Good
TagA,01/06/2014 12:00:13 PM,888276160,Good
TagA,01/06/2014 12:00:14 PM,1031795200,Good
TagA,01/06/2014 12:00:15 PM,1449288960,Good
TagA,01/06/2014 12:00:16 PM,1516603392,Good
TagA,01/06/2014 12:00:17 PM,1843676544,Good
TagA,01/06/2014 12:00:18 PM,1672796672,Good
TagA,01/06/2014 12:00:19 PM,1533833984,Good
TagA,01/06/2014 12:00:20 PM,1697586560,Good
TagA,01/06/2014 12:00:21 PM,1647121280,Good
TagA,01/06/2014 12:00:22 PM,543921472,Good
TagA,01/06/2014 12:00:23 PM,1141920768,Good
TagA,01/06/2014 12:00:24 PM,540008448,Good
TagA,01/06/2014 12:00:25 PM,731087232,Good
TagA,01/06/2014 12:00:26 PM,631079296,Good
TagA,01/06/2014 12:00:27 PM,1160291968,Good
TagA,01/06/2014 12:00:28 PM,1324413696,Good
TagA,01/06/2014 12:00:29 PM,1875167744,Good
TagA,01/06/2014 12:00:30 PM,390197280,Good
TagA,01/06/2014 12:00:31 PM,192162736,Good
TagA,01/06/2014 12:00:32 PM,646106624,Good
TagA,01/06/2014 12:00:33 PM,210439200,Good
TagA,01/06/2014 12:00:34 PM,675144064,Good
TagA,01/06/2014 12:00:35 PM,1421636224,Good
TagA,01/06/2014 12:00:36 PM,537191872,Good
TagA,01/06/2014 12:00:37 PM,492214752,Good
TagA,01/06/2014 12:00:38 PM,1376227840,Good
TagA,01/06/2014 12:00:39 PM,1085046656,Good
TagA,01/06/2014 12:00:40 PM,924105984,Good
TagA,01/06/2014 12:00:41 PM,1294991488,Good
TagA,01/06/2014 12:00:42 PM,1737416960,Good
TagA,01/06/2014 12:00:43 PM,582910848,Good
TagA,01/06/2014 12:00:44 PM,1745973760,Good
TagA,01/06/2014 12:00:45 PM,1607484928,Good
TagA,01/06/2014 12:00:46 PM,2005492352,Good
TagA,01/06/2014 12:00:47 PM,746677184,Good
TagA,01/06/2014 12:00:48 PM,2143539456,Good
TagA,01/06/2014 12:00:49 PM,2009761664,Good
TagA,01/06/2014 12:00:50 PM,640139968,Good
TagA,01/06/2014 12:00:51 PM,990464704,Good
TagA,01/06/2014 12:00:52 PM,109999792,Good
TagA,01/06/2014 12:00:53 PM,1269805568,Good
TagA,01/06/2014 12:00:54 PM,1111627520,Good
TagA,01/06/2014 12:00:55 PM,60175184,Good
TagA,01/06/2014 12:00:56 PM,1407366400,Good
TagA,01/06/2014 12:00:57 PM,928761280,Good
TagA,01/06/2014 12:00:58 PM,1666397696,Good
TagA,01/06/2014 12:00:59 PM,438304832,Good
TagA,01/06/2014 12:01:00 PM,1179844864,Good
TagA,01/07/2014 06:00:01 PM,9000,Good
TagA,01/07/2014 06:00:02 PM,5,Good
TagA,01/07/2014 06:00:03 PM,8,Good
TagA,01/07/2014 06:00:04 PM,-1,Good
TagA,01/07/2014 06:00:05 PM,4,Good
TagA,01/07/2014 06:00:06 PM,485,Good
TagA,01/07/2014 06:00:07 PM,-30000,Good
TagA,01/07/2014 06:00:08 PM,2,Good
TagA,01/07/2014 06:00:09 PM,4,Good
TagA,01/07/2014 06:00:10 PM,-60000,Good
TagA,01/07/2014 06:00:11 PM,60000,Good
TagA,01/07/2014 06:00:12 PM,1,Good
TagA,01/07/2014 06:00:13 PM,1,Good
TagA,01/07/2014 06:00:14 PM,30,Good
TagA,01/07/2014 06:00:15 PM,-70000,Good
TagA,01/07/2014 06:00:16 PM,-70000,Good
TagA,01/07/2014 06:00:17 PM,5,Good
TagA,01/07/2014 06:00:18 PM,1,Good
TagA,01/07/2014 06:00:19 PM,8,Good
TagA,01/07/2014 06:00:20 PM,220,Good
TagA,01/07/2014 06:00:21 PM,45,Good
TagA,01/07/2014 06:00:22 PM,44,Good
TagA,01/07/2014 06:00:23 PM,12,Good
TagA,01/07/2014 06:00:24 PM,13,Good
TagA,01/07/2014 06:00:25 PM,-5600,Good
TagA,01/07/2014 06:00:26 PM,15,Good
TagA,01/07/2014 06:00:27 PM,0,Good
TagA,01/07/2014 06:00:28 PM,25000,Good
TagA,01/08/2014 09:00:01 AM,1400,Good
TagA,01/08/2014 09:00:02 AM,0,Good
TagA,01/08/2014 09:00:03 AM,16,Good
TagA,01/08/2014 09:00:04 AM,-1400,Good
TagA,01/08/2014 09:00:05 AM,-12,Good
TagA,01/08/2014 09:00:06 AM,125,Good
TagA,01/08/2014 09:00:07 AM,150,Good
TagA,01/08/2014 09:00:08 AM,13,Good
TagA,01/08/2014 09:00:09 AM,-56,Good
TagA,01/08/2014 09:00:10 AM,12,Good
TagA,01/08/2014 09:00:11 AM,45,Good
This following examples provide various cases of the InterpolatedtoRaw hybrid mode illustrating the switching of data between raw and calculated data.
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):
tagname | timesstamp | value | quality | samplingmode | numberofsamples |
---|---|---|---|---|---|
Tag1 | 5/16/2011 15:52:13 | 0.0000000 | 0.0000000 | InterpolatedtoRaw | 5 |
Tag1 | 5/16/2011 15:52:21 | 0.0000000 | 0.0000000 | InterpolatedtoRaw | 5 |
Tag1 | 5/16/2011 15:52:30 | 1,006.0000000 | 100.0000000 | InterpolatedtoRaw | 5 |
Tag1 | 5/16/2011 15:52:38 | 1,006.0000000 | 100.0000000 | InterpolatedtoRaw | 5 |
Tag1 | 5/16/2011 15:52:47 | 1,006.0000000 | 100.0000000 | InterpolatedtoRaw | 5 |
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):
tagname | timesstamp | value | quality | samplingmode | numberofsamples |
---|---|---|---|---|---|
Tag1 | 5/16/2011 15:52:24 | 1,000.0000000 | 100.0000000 | InterpolatedtoRaw | 50 |
Tag1 | 5/16/2011 15:52:25 | 1,001.0000000 | 100.0000000 | InterpolatedtoRaw | 50 |
Tag1 | 5/16/2011 15:52:26 | 1,002.0000000 | 100.0000000 | InterpolatedtoRaw | 50 |
Tag1 | 5/16/2011 15:52:27 | 1,003.0000000 | 100.0000000 | InterpolatedtoRaw | 50 |
Tag1 | 5/16/2011 15:52:28 | 1,004.0000000 | 100.0000000 | InterpolatedtoRaw | 50 |
Tag1 | 5/16/2011 15:52:29 | 1,005.0000000 | 100.0000000 | InterpolatedtoRaw | 50 |
Tag1 | 5/16/2011 15:52:30 | 1,006.0000000 | 100.0000000 | InterpolatedtoRaw | 50 |
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):
Tagname | Timestamp | Value | Quality | Sampling MOde |
---|---|---|---|---|
Tag1 | 5/16/2011 15:52:24 | 1,000.0000000 | 1,000.0000000 | InterpolatedtoRaw |
Tag1 | 5/16/2011 15:52:25 | 1,001.0000000 | 1,000.0000000 | InterpolatedtoRaw |