Skip to content
  • There are no suggestions because the search field is empty.

Historian: Canary System Current Values to Narrow Table Format

This article captures the design considerations for creating a solution to poll Canary Historian views for current values of tags within a path and create a data payload for a narrow table format​

What Does This Article Cover?

An Intelligence Hub solution can be created to poll Canary Historian at a specified frequency to obtain the current value of a collection of tags within a views tag path.  The solution can be configured to shape the data payload so that the values for all resulting tags are written to the same values column.  The following describes how this solution can be created.

Design Assumptions

The following are some of the design considerations.

  • This approach should be used when polling at a frequency of fractions of a minute or slower is acceptable.  ​
  • This approach uses a Connection configured to query the Canary Historian REST API endpoint with a bearer token associated with a user with sufficient read privileges.
  • This Connection Input queries the getTagData endpoint using the Tag Path and search parameter to return the desired tags. It assumes the tag naming convention within the Canary View is designed such that a Tag Path query will return desired attributes and only the latest value is needed.

 

Overall Solution Configuration​

The following describes the Intelligence Hub configuration objects.​

  • Obtain data from Canary Historian using an Input that queries the getTagData with a hard defined tag path that is filtered for a specific subset of tags of interest.
    • The example demonstration uses a Canary environment built using the Canary Project Book Camp View. The Hays-Station01-Pump01 tags within the "Roadshow - Hays' Tag Alias" view are the targeted set of historical tags.
  • Using an Intelligence Hub Model, a model of the desired output schema of a narrow table is created.
  • Create a Pipeline with Flow stage configured with the desired polling frequency.
  • Configure the Connection Input as the Reference of the Flow stage. ​
  • Configure the Connection Output for the respective data store. ​​


Pipeline Configuration ​

The following describes the Intelligence Hub Pipeline design​.

  • Verify that REST API call results were successful in reading desired tags.
  • Elevate the data object within the REST API returned payload to the pipeline event value.
  • Breakup the incoming array.
  • For each object in the array, elevate the timestamp and value ('t' and 'v', respectively) to the event value.
  • Determine if the value is a number or a string.
  • Map the payload to the predefined schema using the Intelligence Hub Model.
  • Buffer transactions using a strategy that aligns with the solution requirements for latency.  It may be beneficial to buffer transactions for a cloud data warehouse, like Snowflake for example.
  • Consider the use of the Buffer Key based on use case​.
  • Create the desired file format ​for the data lake if applicable.
  • Write to the data lake configuring the desired file name format.

 

Other Considerations 

The following should be considered related to this design ​

  • The reference example simply considers whether the value is a number or not.  Additional logic may be needed to handle a variety of values including Boolean, etc.

 

Solution Video

The following video captures a reference solution.