ihTags Table
The ihTags table contains the set of tag names and the properties of each tag. This data is mostly the information that the administrator enters through the Tag Maintenance screen in the Historian Administrator application. Each row in the table represents one tag. The following table describes the columns of the ihTags table.
Column Name | Data Type | Description |
---|---|---|
Tagname | VT_BSTR | Tagname property of the tag.Note: There is no length limit for Historian tag names in the Data Archiver. However, different client applications may have their own limits. |
Description | VT_BSTR | User description of the tag. |
EngUnits | VT_BSTR | Engineering units description of the tag. |
Comment | VT_BSTR | User comment associated with the selected tag. |
DataType | VT_BSTR | The data type of the tag:
The data type returned in this column is the data type that you defined in the Historian Administrator application. |
FixedStringLength | VT_UI1 | Zero unless the data type is FixedString . If the data type is FixedString , this number represents the maximum length of the string value. |
CollectorName | VT_BSTR | Name of the collector responsible for collecting data for the specified tag. |
SourceAddress | VT_BSTR | Address used to identify the tag at the data source. For iFIX systems, this is the NTF (Node.Tag.Field ). |
CollectionType | VT_BSTR | Type of collection used to acquire data for the tag:
Note: Not all collectors support unsolicited collection. |
CollectionInterval | VT_I4 | The time interval, in milliseconds, between readings of data from this tag. For polled collection, this field represents the time between samples. For unsolicited collection, this field represents the minimum time allowed between samples. |
CollectionOffset | VT_I4 | The time shift from midnight, in milliseconds, for collection of data from this tag. |
LoadBalancing | VT_BOOL | Indicates whether the data collector should automatically shift the phase of sampling to distribute the activity of the processor evenly over the polling cycle. This is sometimes called phase shifting. |
TimeStampType | VT_BSTR | The timestamp type applied to data samples at collection time:
|
HiEngineeringUnits | VT_R8 | The high end of the engineering units range. Used only for scaled data types and input scaled tags. |
LoEngineeringUnits | VT_R8 | The low end of the engineering units range. Used only for scaled data types and input scaled tags. |
InputScaling | VT_BOOL | Indicates whether the measurement should be converted to an engineering units value. When set to False , the measurement is interpreted as a raw measurement. When set to |
HiScale | VT_R8 | The high-end value of the input scaling range used for the tag. |
LoScale | VT_R8 | The low-end value of the input scaling range used for the tag. |
CollectorCompression | VT_BOOL | Indicates whether collector compression is enabled for the tag. Collector compression applies a smoothing filter to incoming data by ignoring incremental changes in values that fall within a deadband centered around the last collected value. The collector passes (to the archiver) any new value that falls outside the deadband and then centers the deadband around the new value. |
CollectorDeadbandPercentRange | VT_R4 | The current value of the compression deadband. |
ArchiveCompression | VT_BOOL | Indicates whether archive collector compression is enabled for the tag. |
ArchiveDeadbandPercentRange | VT_R4 | The current value of the archive compression deadband. |
CollectorGeneral1 | VT_BSTR | The general (or spare) configuration fields for the tag. |
CollectorGeneral2 | VT_BSTR | The general (or spare) configuration fields for the tag. |
CollectorGeneral3 | VT_BSTR | The general (or spare) configuration fields for the tag. |
CollectorGeneral4 | VT_BSTR | The general (or spare) configuration fields for the tag. |
CollectorGeneral5 | VT_BSTR | The general (or spare) configuration fields for the tag. |
ReadSecurityGroup | VT_BSTR | The name of the Windows security group that controls the reading of data for the tag. Refer to "Implementing Historian Security" in the Getting Started with Historian manual for definitions of the various security levels and groups. |
WriteSecurityGroup | VT_BSTR | The name of the Windows security group that controls the writing of data for the tag. Refer to "Implementing Historian Security" in the Getting Started with Historian manual for definitions of the various security levels and groups. |
AdministratorSecurityGroup | VT_BSTR | The name of the Windows security group responsible for controlling configuration changes for the tag. |
Calculation | VT_BSTR | The equation for the calculation performed for the tag. |
LastModified | VT_DBTimeStamp | The date and time that the tag configuration was last modified. The time structure includes milliseconds. |
LastModifiedUser | VT_BSTR | The username of the Windows user who last modified the tag configuration. |
CollectorType | VT_BSTR | The type of collector responsible for collecting data for the tag:
|
StoreMilliseconds | VT_BOOL | Indicates whether milliseconds are recorded in timestamps. If not enabled, the time resolution is in seconds instead of milliseconds. Maximum data compression is achieved when this option is set to Note: StoreMilliseconds returns False in Historian v4.5 and later. |
TimeResolution | String | Indicates the timestamp resolution in seconds, milliseconds, or microseconds. |
UTCBias | VT_I4 | The time zone bias for the tag. Time zone bias is used to indicate the natural time zone of the tag expressed as an offset from UTC (Universal Time Coordinated) in minutes. UTC is the international time standard, the current term for what was commonly referred to as Greenwich Mean Time (GMT). |
AverageCollectionTime | VT_I4 | The average time it takes to execute the calculation tag since you started the Calculation Collector. |
CollectionDisabled | VT_I4 | Indicates whether collection is enabled (0 ) or disabled (1 ) for the tag. The default setting is enabled (0 ). |
CollectorCompressionTimeout | VT_I4 | Indicates the maximum amount of time the collector will wait between sending samples to the archiver. This time is kept per tag, as different tags report to the archiver at different times. This value should be in increments of your collection interval, and not less. Ideally, this field is used for polled data values. It can be used with unsolicited data, but when you do so, you are dependent on the data source for the value to change. With unsolicited data, since Historian only records the value when it changes, the actual time before the timeout might exceed the compression timeout. |
ArchiveCompressionTimeout | VT_I4 | Indicates the maximum amount of time from the last stored point before another point is stored, if the value does not exceed the archive compression deadband. The data archiver treats the incoming sample after the timeout occurs as if it exceeded compression. It then stores the pending sample. |
TimeZone | VT_BSTR | The type of time zone used:
|
DaylightSavingTime | VT_BOOL | Indicates whether Daylight Saving Time logic should be applied to timestamps. |
RowCount | VT_I4 | Indicates the maximum number of rows that can be returned. A value of 0 indicates there is no limit to the number of rows returned. |
InterfaceAbsoluteDeadbanding | VT_BOOL | Indicates whether absolute collector deadbanding is enabled for this tag. |
InterfaceAbsoluteDeadband | VT_R8 | Indicates the value for absolute collector deadbanding. |
ArchiveAbsoluteDeadbanding | VT_BOOL | Indicates whether absolute archive deadbanding is enabled for this tag. |
ArchiveAbsoluteDeadband | VT_R8 | Indicates the value for absolute archive deadbanding. |
SpikeLogic | VT_BOOL | Indicates whether Spike Logic is enabled for the tag. |
SpikeLogicOverride | VT_BOOL | Indicates whether the Spike Logic setting for this tag overrides the collector. |
StepValue | VT_BOOL | Indicates whether the StepValue property is enabled for the tag. |
EnumeratedSetName | VT_BSTR | Indicates the enumerated set name associated with a tag. You can get more information about the set via the ihEnumeratedSet table. |
DataStoreName | VT_BSTR | Indicates the name of the data store the tag belongs to. |
NumberOfElements | VT_I4 | Indicates whether the tag is an array tag. If set to |
CalcType | Enum | Indicates whether the tag is an analytical tag or a normal tag. |
IsAlias | VT_BOOL | Indicates whether the tag has an alias or not. |
ihTags Examples
Tasks that you might want to perform on the ihTags table are outlined in the following examples.
Example 1: Find All Tags That Belong to a Specific Collector
SELECT * FROM ihtags WHERE collectorname=MYCOMPUTER_Simulation ORDER BY tagname
Example 2: Find All Tags With a Specific Poll Rate, a Range of Poll Rates, or Polling Disabled
SELECT * FROM ihtags WHERE CollectionInterval=500
OR (CollectionInterval>=1000 AND CollectionInterval<=1200)
OR CollectionInterval=0
Example 3: Retrieve All Tags Collected by Each Collector
SELECT collectorname, tagname FROM ihTags ORDER BY collectorname
Example 4: Retrieve All Tags With a Specific Poll Rate
SELECT tagname FROM ihtags WHERE collectioninterval=1000
Example 5: Retrieve All Tags With Subsecond Collection
SELECT tagname FROM ihtags
WHERE collectioninterval BETWEEN 1 AND 999
Example 6: Retrieve All Tags with Polling Disabled
SELECT tagname, collectioninterval FROM ihtags
WHERE collectioninterval=0
Example 7: Count the Number of Tags and Group by Collector Name
SELECT collectorname, COUNT(*) FROM ihTags GROUP BY collectorname
Example 8: Count the Number of Tags and Group by Collector Type
SELECT ihCollectors.collectortype, COUNT(*)
FROM ihTags INNER JOIN ihCollectors
WHERE ihTags.collectorname=ihCollectors.collectorname
GROUP BY ihcollectors.collectortype
Example 9: Retrieve Tags Associated With a Specific Enumerated Set
SELECT * FROM ihtags
WHERE EnumeratedSetName='ExampleSet