Count Mode

Counts the number of raw samples with good quality in the interval.

Value

The count of raw samples with good quality in the interval. The values of the each sample are ignored. The Count does not include any samples with bad quality, including the start and end of collection markers.

Quality

Percent good is always 100, even if the interval does not contain any raw samples or contains only bad quality samples.

Example: Calculating the count of raw samples

The following example demonstrates that only good samples are counted. Importing the following data ensures that at least one interval has 0 samples.

[Tags]
Tagname,DataType,HiEngineeringUnits,LoEngineeringUnits
COUNTTAG,SingleInteger,100,0
[Data]
Tagname,TimeStamp,Value,DataQuality
COUNTTAG,29-Mar-2002 13:59:00.000,22,Good
COUNTTAG,29-Mar-2002 14:08:00.000,12,Bad
COUNTTAG,29-Mar-2002 14:22:00.000,4,Good

The following query retrieves data with a start time of 14:00 and an end time of 14:30 with a 10-minute interval.

select timestamp, value, quality from ihrawdata where samplingmode=calculated and calculationmode=count and timestamp >='29-Mar-2002 14:00' and timestamp <= '29-Mar-2002 14:30' and tagname = counttag and intervalmilliseconds = 10M
Time StampValueQuality
29-Mar-200214:10:00.0000.00100.00
29-Mar-200214:20:00.0000.00100.00
29-Mar-200214:30:00.0001.00100.00
Note: The bad raw sample at 14:08 is not counted, but the good sample at 14:22 is counted. The 14:11 to 14:20 interval has no raw samples, but still has a percent good of 100 percent.
Anticipated Usage

Count is useful for analyzing the distribution of the raw data samples to determine the effect of compression deadbands. It is also useful to determine which tags are consuming the most archive space.