Configuration
By default, the tag historian database has one table configured. The table settings provide rules for saving each tag. You can set a trigger that determine when tags will be saved, a time deadband that defines the minimum interval between saves, and a lifetime value that determines how long the saved tag values will be retained. The table configuration is independent of the database selected to store the information.
If you want some tags to have different settings, such as different time deadbands, you should configure additional tables with the settings you need and assign tags to the appropriate tables. You can also edit the settings of the default table.
In general, you should not store more data than you need. Storing a large amount of data slows the recovery of that data. You should use triggers and deadbands that are as large as possible, to ensure you have the information you need and without overloading the system.
To configure a tag historian table:
- Go to Edit > Tags > Historian.
- Do one of the following:
- To edit an existing table, select it from the Historian table's drop-down list and click Config.
- To create a new table, click New.
Enter or select information, as needed.
Option | Description |
Database | Display-only name of the current tag historian database. |
Table Name | Enter a name for the table in the database. |
Auto Create | Select to have the system automatically create the table in the database. |
Save on Change | Select to store data in the table (add a row) every time a tag changes that is associated with the table. |
Trigger | Use to store data in the table every time a tag or tag property changes. With the Save on Change option, the system stores data in the table when either the tag value changes or the trigger value changes. |
Time Deadband (Log TimeSpan) | Enter the minimum logging interval. This is how long the system must wait after storing the value of a tag and before storing a new value. Use with the Save on Change option to avoid creating too many records in the database. |
Life Time | Number of days to retain the historian data. After that time, the older rows are automatically deleted from the database. To never delete data, leave this field blank or enter 0 (zero). |
Save Quality | Enable or disable the quality of the tag to be stored on the historian table |
Normalized | Enable or disable to configure the schema to be used on the historian table |
GetSamplesMethod | Use to configure a Script > Class method to customize the data retrieved from the historian table |
Description | Brief description of the historian table |
Using the OSIsoft™ PI System
The system can seamlessly use the OSIsoft PI System as the historian provider. In this situation, it is not necessary define any Historian configuration. If the tag is mapped to a OSIsoft PI point, the system will automatically call the PI Server to get the data when trend charts are plotted trend or for any script or display methods that require historian information.
The system can work with both the PI System and the built-in historian at the same time. When historical information is requested for a point, either from trend charts or scripts, the system will first look for that information on the built-in historian module. If it is not available, it will try to find the data on the PI server. For information on connecting to the PI Systems, see Import Wizards.
The Tag Historian Tables Schemas
There are two different schemas for tag historian tables that are based on the configuration of the tables: the default schema and the normalized schema. Each schema is described below.
The Default Schema
The default historian tables contain the following columns:
- ID - PK, BigInt (8 Bytes) - The primary key of the table used as reference by the system.
- UTCTimeStamp_Ticks - BigInt (8 Bytes) - Date and time in Universal Time for that row in 64-bit .NET ticks. The value of this property is the number of 100-nanosecond (1/10th of a microsecond) intervals that have elapsed since 12:00 A.M., January 1, 0001. This is a new date/time standard used by the Microsoft .NET framework.
- LogType - TinyInt (1 byte) - Auxiliary column to show when the row was inserted: 0=on startup, 1=normal logging, 2=on shutdown.
- NotSync - Int (4 Bytes) - Auxiliary column to show if the data was synchronized or not when the Redundancy option is enabled. See Deploying Redundant Systems.
- TagName - Float (8 Bytes) - Column automatically created using the name of each tag as the column title. It stores the data value using double precision.
- _TagName_Q - Float (8 Bytes) - Column automatically created for the quality of the data for each tag, using the OPC quality specification.
Typically you can associate up to 200 tags with each historian table, but that number is dependent on how many columns your target database allows. The tags should be defined in the same table when they have similar storing rates and process dynamics because the entire row must be saved in order to save a tag in the table.
The Normalized Schema
The Normalized tables have the following schema:
Table: TagsDictionary
- ID - PK, BigInt (8 Bytes) - The primary key of the table used as a reference by the system.
- TagName - NVarchar - The name of all the tags configured to "normalized" databases on the Historian.
- NotSync - Int (4 Bytes) - Not used for this release. It was created for future changes and new features.
The system will automatically create four more tables as follows:
- TableName_BIT
- TableName_FLOAT
- TableName_NTEXT
- TableName_REAL
The schema for these table is:
- ID - PK, BigInt (8 Bytes) - The primary key of the table used as a reference by the system.
- UTCTimeStamp_Ticks - BigInt (8 Bytes) - Date and time in Universal Time for each row in 64-bit .NET ticks. The value of this property is the number of 100-nanosecond (1/10th of a microsecond) intervals that have elapsed since 12:00 A.M., January 1, 0001. This is a new date/time standard used by the Microsoft .NET framework.
- ObjIndex - FK, Integer (4 Bytes) - Reference to the column ID on the TagsDictionary table
- ObjValue - Can be Bit, Float, NText, or Real, depending on which table it is. Represents the value of the tag on the specified timestamp.
- ObjQuality - TinyInt (1 Byte) - Represents the quality of the tag on the specified time, using the OPC quality specification.
- NotSync - Int (4 Bytes) - Not used for this release. It was created for future changes and new features.
It's important to remember that the normalized database cannot be synchronized through the Redundancy option.