The InfluxDB External TagProvider uses InfluxDB as a Historian Target Database for storing time-series data. Configure this External TagProvider to integrate time-series data into your solution, facilitating data storage, retrieval, and analysis. This setup provides a method for managing historical data within the Unified Namespace.
On this page:
This TagProvider requires the user to have access to an InfluxDB Server with support for API Version 2.0 or greater.
To configure this Protocol as a ExternalTags, go to Unified Namespace → External TagProviders Source and create a new provider for InfluxDB Connector.
The Station syntax is similar to the Device one, with two additional fields:
The Filters are used to define the Query to be executed when assembling the TreeView. In this example with measurement and field, the structure would be as follows:
Always use the Test button to verify the connection status. |
A DataCollector is an application that collects data from the field.
This ExternalTags can act as a Collector for different InfluxDB Schemas. Each one of them will have its own characteristic when assembling the Data in a TreeView Structure.
The Collectors are described in the sections below.
ExternalTags connection cannot create new CustomColumns in InfluxDB Database, only access existing ones. To create new CustomColumns, use the Device Configuration. |
This collector will access any InfluxDB Database, and create the TreeView Structure based on the Filters.
This Collector can Read/Write data.
When a new Provider is Created, there is an option at the Dialog Window to Enable it as an Historian Server. When enabled, the provider is Write-Only.
In this Configuration, Tags added on Historian → Historian Tags, into a Table targeted for InfluxDB Provider, will be automatically logged in your Database.
In this scenario, the Table Name will act as our _measurement and the Complete TagName will be added to the field column.
By using the Complete TagName as _field, the TreeView can use that information to transform that name into a multi-level structure as illustrated below.
This Collector is used to Read Data from an InfluxDB Database Structure that was stored using Telegraf’s MQTT Plugin pre-defined schema, with MQTT topic stored in a column called topic.
The filters are, by default, defined as _measurement, topic and _field.
In Runtime, the TreeView Structure will use the MQTT Topic similar to what is done in MQTTspB ExternalTags.
As an example, let us assume we have an MQTT Client publishing to Topics:
Panel/Motor1/RPM Panel/Motor2/RPM |
The _measurement is defined as mqtt_consumer and _field is value.
Our TreeView Structure is illustrated below.
This Provider can be used to plot Historized data in the Project’s built-in TrendChart component. To do so, just add the component into a Display (1) and add to the PenList (2) an asset from this Provider (3), as illustrated in the image below.
Now, using the Trend ControlName (4), we can access its properties in CodeBehind.
There is a property called GetSamplesMode that allows us to use different Aggregation Methods to the data to be displayed. The syntax used will be:
TTrendChart trend = this.CurrentDisplay.GetControl("trend") as TTrendChart; trend.GetSamplesMode = "<AggregationMethod>;<AggregationInterval>"; trend.Refresh(); |
Where:
integral | stddev | experimental.histogramQuantile |
mean | sum | experimental.integral |
median | timeWeightedAvg | experimental.mean |
mode | highestAverage | experimental.mode |
oee.APQ | highestCurrent | experimental.quantile |
oee.computeAPQ | highestMax | experimental.skew |
prometheus.histogramQuantile | lowestAverage | experimental.spread |
quantile | lowestCurrent | experimental.stddev |
reduce | lowestMin | experimental.sum |
skew | count | geo.ST_LineString |
spread | experimental.count | histogramQuantile |
For more information, please refer to the InfluxDB documentation.
AggregationInterval: TimeSpan as a String, with syntax: ”hh:mm:ss”. E.g.: ”00:01:00” to represent one minute.
It is important to always refresh when changing the GetSamplesMode to make sure the correct data is displayed. |
In this section: