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.

Table 1. ihTags Table
Column NameData TypeDescription
TagnameVT_BSTRTagname 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.
DescriptionVT_BSTRUser description of the tag.
EngUnitsVT_BSTREngineering units description of the tag.
CommentVT_BSTRUser comment associated with the selected tag.
DataTypeVT_BSTRThe data type of the tag:
  • Scaled
  • SingleFloat
  • DoubleFloat
  • SingleInteger
  • DoubleInteger
  • Quad Integer
  • Unsigned Single Integer
  • Unsigned Double Integer
  • Unsigned Quad Integer
  • Byte
  • Boolean
  • FixedString
  • VariableString
  • BLOB

The data type returned in this column is the data type that you defined in the Historian Administrator application.

FixedStringLengthVT_UI1Zero unless the data type is FixedString. If the data type is FixedString, this number represents the maximum length of the string value.
CollectorNameVT_BSTRName of the collector responsible for collecting data for the specified tag.
SourceAddressVT_BSTRAddress used to identify the tag at the data source. For iFIX systems, this is the NTF (Node.Tag.Field).
CollectionTypeVT_BSTRType of collection used to acquire data for the tag:
  • Unsolicited: The collector accepts data from the source whenever the source presents the data.
  • Polled: The collector acquires data from a source on a periodic schedule determined by the collector.
Note: Not all collectors support unsolicited collection.
CollectionIntervalVT_I4The 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.

CollectionOffsetVT_I4The time shift from midnight, in milliseconds, for collection of data from this tag.
LoadBalancingVT_BOOLIndicates 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.
TimeStampTypeVT_BSTRThe timestamp type applied to data samples at collection time:
  • Source: The source delivers the timestamp along with the data sample.
  • Collector: The collector delivers the timestamp along with the collected data.
HiEngineeringUnitsVT_R8The high end of the engineering units range. Used only for scaled data types and input scaled tags.
LoEngineeringUnitsVT_R8The low end of the engineering units range. Used only for scaled data types and input scaled tags.
InputScalingVT_BOOLIndicates 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 True, the system converts the value to engineering units by scaling the value between the HiScale and LoScale columns. If not enabled, the system assumes the measurement is already converted into engineering units.

HiScaleVT_R8The high-end value of the input scaling range used for the tag.
LoScaleVT_R8The low-end value of the input scaling range used for the tag.
CollectorCompressionVT_BOOLIndicates 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.

CollectorDeadbandPercentRangeVT_R4The current value of the compression deadband.
ArchiveCompressionVT_BOOLIndicates whether archive collector compression is enabled for the tag.
ArchiveDeadbandPercentRangeVT_R4The current value of the archive compression deadband.
CollectorGeneral1VT_BSTRThe general (or spare) configuration fields for the tag.
CollectorGeneral2VT_BSTRThe general (or spare) configuration fields for the tag.
CollectorGeneral3VT_BSTRThe general (or spare) configuration fields for the tag.
CollectorGeneral4VT_BSTRThe general (or spare) configuration fields for the tag.
CollectorGeneral5VT_BSTRThe general (or spare) configuration fields for the tag.
ReadSecurityGroupVT_BSTRThe 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.

WriteSecurityGroupVT_BSTRThe 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.

AdministratorSecurityGroupVT_BSTRThe name of the Windows security group responsible for controlling configuration changes for the tag.
CalculationVT_BSTRThe equation for the calculation performed for the tag.
LastModifiedVT_DBTimeStampThe date and time that the tag configuration was last modified. The time structure includes milliseconds.
LastModifiedUserVT_BSTRThe username of the Windows user who last modified the tag configuration.
CollectorTypeVT_BSTRThe type of collector responsible for collecting data for the tag:
  • Undefined
  • iFIX
  • Simulation
  • OPC
  • File
  • iFIXLabData
  • ManualEntry
  • Simulation
  • Other
StoreMillisecondsVT_BOOLIndicates 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 False. This is the optimum setting for most applications.

Note: StoreMilliseconds returns False in Historian v4.5 and later.
TimeResolutionStringIndicates the timestamp resolution in seconds, milliseconds, or microseconds.
UTCBiasVT_I4The 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).

AverageCollectionTimeVT_I4The average time it takes to execute the calculation tag since you started the Calculation Collector.
CollectionDisabledVT_I4Indicates whether collection is enabled (0) or disabled (1) for the tag. The default setting is enabled (0).
CollectorCompressionTimeoutVT_I4Indicates 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.

ArchiveCompressionTimeoutVT_I4Indicates 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.

TimeZoneVT_BSTRThe type of time zone used:
  • Client
  • Server
  • Explicit bias number (number of minutes from GMT)
DaylightSavingTimeVT_BOOLIndicates whether Daylight Saving Time logic should be applied to timestamps.
RowCountVT_I4Indicates the maximum number of rows that can be returned. A value of 0 indicates there is no limit to the number of rows returned.
InterfaceAbsoluteDeadbandingVT_BOOLIndicates whether absolute collector deadbanding is enabled for this tag.
InterfaceAbsoluteDeadbandVT_R8Indicates the value for absolute collector deadbanding.
ArchiveAbsoluteDeadbandingVT_BOOLIndicates whether absolute archive deadbanding is enabled for this tag.
ArchiveAbsoluteDeadbandVT_R8Indicates the value for absolute archive deadbanding.
SpikeLogicVT_BOOLIndicates whether Spike Logic is enabled for the tag.
SpikeLogicOverrideVT_BOOLIndicates whether the Spike Logic setting for this tag overrides the collector.
StepValueVT_BOOLIndicates whether the StepValue property is enabled for the tag.
EnumeratedSetNameVT_BSTRIndicates the enumerated set name associated with a tag. You can get more information about the set via the ihEnumeratedSet table.
DataStoreNameVT_BSTRIndicates the name of the data store the tag belongs to.
NumberOfElementsVT_I4Indicates whether the tag is an array tag.

If set to -1, the tag is an array tag. If set to 0, the tag is not an array tag. Since the size of the array is dynamic, there is no single number of elements that can be returned.

CalcTypeEnumIndicates whether the tag is an analytical tag or a normal tag.
IsAliasVT_BOOLIndicates 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