Data Types
Historian uses the following data types.
Data Type | Size | Description |
---|---|---|
Single Float | 4 bytes | The single float data type stores decimal values up to 6 places. Valid ranges for the single float data type are 1.175494351e-38F to 3.402823466e+38F |
Double Float | 8 bytes | The double float data type stores decimal values up to 15 places. Valid values for the double float data type are 2.2250738585072014e-308 to 1.7976931348623158e+308 |
Single Integer | 2 bytes | The single integer data type stores whole numbers, without decimal places. Valid values for the single integer data type are -32767 to +32767. |
Double Integer | 4 bytes | The double integer data type stores whole numbers, without decimal places. Valid values for the double integer data type are - 2147483648 to +2147483648. |
Quad Integer | 8 bytes | The quad integer data type stores whole numbers without decimal places. Valid values for the quad integer data type are -9,223,372,036,854,775,808 (negative 9 quintillion) to +9,223,372,036,854,775,807 (positive 9 quintillion). |
Unsigned Single Integer | 2 bytes | The unsigned single integer data type stores whole numbers without decimal places. Valid values for the unsigned single integer data type are 0 to 65535. |
Unsigned Double Integer | 4 bytes | The unsigned double integer data type stores whole numbers without decimal places. Valid values for the unsigned double integer data type are 0 to 4,294,967, 295 (4.2 billion). |
Unsigned Quad Integer | 8 bytes | The unsigned quad integer data type stores whole numbers without decimal places. Valid values for the unsigned quad integer data type are 0 to 18,446,744,073,709,551,615 (19 quintillion). |
Byte | 1 byte | The Byte data type stores integer values. Valid values for the byte data type are -128 to +127. |
Boolean | 1 byte | The Boolean data type stores boolean values. Valid values for the boolean data type are 0=FALSE and 1=TRUE. If the user sends zero, the value is taken as zero; any value other than zero is treated as one. |
Fixed String | Configured by user | The fixed string data type stores string data of a fixed size. Valid values are between 0 and 255 bytes. See Fixed String Data Types for more information. |
Variable String | No fixed size | The variable string data type stores string values of undetermined size. This data type is useful if you cannot rely on a constant string length from your data source. |
Binary Object | No fixed size | The binary object data type stores binary data. This is useful for capturing data that can not be classified by any other data type. |
Scaled | 2 bytes | The scaled data type lets you store a 4 byte float as a 2 byte integer in the Historian archive. The scaled data type saves disk space but sacrifices data precision as a result. See Scaled Data Types for more information |
Note: Tags associated with Quad Integer, Unsigned Double Integer, or Unsigned Quad Integer data types retrieved using Non-Web Admin, Excel Add-in, Calculation, ihSQL, or ihSDK may suffer a loss of precision value due to a Visual Basic limitation.
Note: The Calculation Collector supports only calculations performed using the current value calculation. It does not support other calculations due to a Visual Basic script limitation.
Scaled Data Types
Historian uses the high and low EGU values to both store and retrieve archived values for the scaled data type. This allows you to store 4 byte floats as 2 byte integers in the Historian archive. Though this saves disk space, it sacrifices data precision. The smaller the span is between the high and low EGU limits, the more precise the retrieved value will be. When calculating the value of a scaled data type, you can use this formula:
ArchivedValue = (((RealWorldValue - EngUnits->Low) /
(EngUnits->High - EngUnits->Low) * (float) HR_SCALED_MAX_VALUE) + .5);
For example: A value of 12.345 was stored in a scaled tag whose high EGU was 200 and low EGU was 0. When later retrieved from the Historian archive, a value of 12.34473 would be returned. Important: Values that are outside of the EGU range of a scaled data type tag get stored as "bad, "scaledoutofrange" in Historian. Changing either the High or Low EGU tags does not affect existing data, but only affects the new data with new timestamps. You cannot correct values for scaled data types that were inserted while EGUs were incorrect. If necessary, contact technical support for additional information.
Quad Integer Data Types
The high and low EGU limits for Quad Integer, Unsigned Single Integer, Unsigned Double Integer, Unsigned Quad Integer are between 2.2250738585072014e-308 to 1.7976931348623158e+308.