The Sample Mode setting determines how often a historical record should be collected.
- On Change - Collects a record whenever the value on the Tag changes.
- Periodic - Collects a record based on the Sample Rate and Sample Rate Units properties.
- Tag Group - Collects a record based on the Tag Group specified under the Historical Tag Group property.
Historical Tag Group
Historical Tag Group setting shows up with Sample Mode is set to Tag Group. Historical Tag Group setting determines how often to record the value on the Tag. It uses the same Tag Groups that dictate how often your Tags should execute. Typically, the Historical Tag Group should execute at the same rate as the Tag's Tag Group or slower: if a Tag's Tag Group is set to update at a 1,000ms rate, but the Historical Tag Group is set to a Tag Group that runs at 500ms rate, then the Tag History system will be checking the Tag's value twice between normal value changes, which is unnecessary.
Max and Min Time Between Samples
Normally Tag Historian only stores records when values change. By default, an "unlimited" amount of time can pass between records – if the value doesn't change, a new row is never inserted in the database. By modifying these settings, it is possible to specify the maximum number of scan class execution cycles that can occur before a value is recorded. Setting the value to 1, for example, would cause the Tag value to be inserted each execution, even if it has not changed. Given the amount of extra data in the database that this would lead to, it's important to only change this property when necessary.
Deadband and Analog Compression
The deadband value is used differently depending on whether the Tag is configured as a Discrete Tag or as an Analog Tag. Its use with discrete values is straight forward, registered a change any time the value moves +/- the specified amount from the last stored value. With Analog Tags, however, the deadband value is used more as a compression threshold, in an algorithm similar to that employed in other Historian packages. It is a modified version of the 'Sliding Window' algorithm. Its behavior may not be immediately clear, so the following images show the process in action, comparing a raw value trend to a "compressed" trend.
The Deadband Style property sets the: Auto, Analog, or Discrete.
When set to Auto, this setting will automatically pick from Analog or Discrete, based on the datatype of the Tag.
- If the datatype of the Tag is set to a float or double, then Auto will use the Analog Style.
- If the datatype of the Tag is any other type, then the Discrete style will be used.
In this image, an analog value has been stored. The graph has been zoomed in to show detail; the value changes often and ranges over time +/- 10 points from around 1490.0. The compressed value was stored using a deadband value of 1.0, which is only about .06% of the raw value, or about 5% of the effective range. The raw value was stored using the Analog Tag mode, but with a deadband of 0.0. While not exactly pertinent to the explanation of the algorithm, it is worth noting that the data size of the compressed value, in this instance, was 54% less than that of the raw value.
By looking at one specific sequence, we can see how the algorithm works:
The sequence starts with the second stored compressed value on the chart.
- A value is stored. No further action is taken.
- The next value arrives. A line is made through the value, with the size of the specified deadband value. A line is projected from the last stored value to the upper (line U1), and lower (line L1), bounds of this new value line. This establishes the initial corridor.
- A new value arrives. The same procedure is taken, and new lines are created. However, only lines that are more restrictive than the previous are used. In this case, that means only line U2, the new upper line.
- Another value arrives, causing a new lower line (L3) to be used.
- Finally, a value arrives that falls outside of our corridor. The last received value (value 4) is stored, and a the process is started again from that point.
Log Tag History Data
Do the following steps to log history data for your tags:
- In the Tag Browser, select one or more tags. For example, we selected several Sine tags in the Sine folder.
- Right-click on the selected tags, and then select Edit tag
The Tag Editor window is displayed. Here, you can edit the tag and change the name, data type, scaling options, metadata, permissions, history, and alarming.
- Scroll down to the History section of the Tag Editor. Select the History Enabled check box.
- Choose a database (for example, MySQL) from the Storage Provider dropdown.
- Set the Sample Mode to Tag Group.
- Set the Historical Tag Group to Default Historical.
- Click OK.
Now look in the Tag Browser. To the right of each Sine tag that is storing history, a History icon appears letting you know it is set up.
If you were to look in your database, you can see all the tables and data Ignition has created for you.