Trend2 Sampling Mode

The Trend2 sampling mode is a modified version of the Trend sampling mode.

The Trend2 sampling mode splits up a given time period into a number of intervals (using either a specified number of samples or specified interval length), and returns the minimum and maximum data values that occur within the range of each interval, together with the timestamps of the raw values.

The key differences between Trend and Trend2 sampling modes are in:

  • How they treat a sampling period that does not evenly divide by the interval length:
    • For the Trend sampling mode, Historian ignores any leftover values at the end, rather than putting them into a smaller interval.
    • For the Trend2 sampling mode, Historian creates as many intervals of the interval length as will fit into the sampling period, and then creates a remainder interval from whatever time is left.
  • Spacing of timestamps returned:
    • For the Trend sampling mode, Historian returns evenly-spaced interval timestamps.
    • For the Trend2 sampling mode, Historian returns raw sample timestamps. These timestamps can be unevenly spaced, since raw data can be unevenly spaced.
  • Inclusion of start and end times entered:
    • The Trend sampling mode is start time exclusive and end time inclusive.
    • The Trend2 sampling mode is start time inclusive and end time inclusive.

The Trend sampling mode is more suitable for plotting applications that prefer evenly-spaced data.

The Trend2 sampling mode is more suitable for analysis of mins and maxes and for plotting programs that can handle unevenly spaced data.

Table 1. Parameters
Name Description
Tagname(s) Specify all of the tag(s) on which to perform Trend2 sampling.
Starting time

Specify when the time period starts.

Values in the raw data whose timestamps fall on the starting time will be included in the results, if they are the minimum or the maximum in the interval.

Ending time

Specify when the time period ends.

Values in the raw data whose timestamps fall on the ending time will be included in the results, if they are the minimum or the maximum in the interval.

The following determine the size of the intervals:
Name Description
Interval length If you specify the interval length, then Historian splits the time period between start and end into as many intervals of that length as will fit in the period.

For example, if you have a 30 second time period, and you request intervals of 5 seconds, Historian will break the time period into 6 intervals, each of which covers 5 seconds.

If the sampling period does not evenly divide by the interval length, then Historian creates as many intervals of that length as will fit, and then create a remainder interval from whatever time is left. So, if we request intervals of 7 seconds for a 30 second time period, Historian splits the sampling period into 4 intervals of 7 seconds each, and one remainder interval of 2 seconds.

This behavior is in contrast to the original Trend sampling, which would simply ignore any leftover values at the end, rather than putting them into a smaller interval.

Number of samples If you specify the number of samples to return, Historian determines the number of intervals to return. Each interval returns 2 samples, so Historian divides the time period between start and end into half as many intervals as there are specified samples.

For example, if you specify 12 samples, Historian will divide the time period into 6 intervals, because 12/2 = 6.

If the number of samples specified is odd, then it is rounded up to the nearest even number. So, if you ask for 7 samples, Historian rounds up to 8 samples, from 8/2 = 4 intervals. All intervals are of the same length.

If the time period from start to finish is 60 seconds and we request 10 intervals, then each interval will be 6 seconds long.