Skip to main content
InSource Solutions

TN - 1116 How to determine time between samples

Description

 

This article from InSource shows how to use the built in column of the Historian Server (called wwResolution) to return the time between samples of a queried result set.  This can be useful to understand how long something spent in a given state or how long it has been since the value of X was something.

  • Author: Lewis Talley
  • Published: 02/22/21
  • Applies to: Historian Server (various versions)

Details

when querying the Historian, you can specify which columns are returned in the result set as shown below.  Although most commonly we are only concerned with the tagname, datetime, value and quality.  The Historian Client allows you a visual list to pick which columns you want (or you can look in the documentation for a full list):

clipboard_e965c097c509d4fd2b707ecac0d186961.png

 

One of the often overlooked columns available is the wwResolution column, and this column is used to show the time difference between the samples returned the result set.  This can be displayed in the Historian Client, but clicking the checkbox to turn it on or by specifying it in part of the select statement in the SQL query.  Below shows what this looks like using the system second, and system minute counter.  You will notice the time difference between the two is expressed in milliseconds for each 

clipboard_e78d035a5082b8d6a88fe968590f45231.pngclipboard_e742ac65fcd07040cabef6e829c6e72b7.png

To specify this in a query looks like this:

clipboard_e9c190f5928f8db43730eaeca181861cd.png