Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

This page has information about the InfluxDB TagProvider. The InfluxDB TagProvider allows InfluxDB to be seamless used as a Historian Target Database to store time-series data for Tags in your Solutionallow dynamic retrieval of data from InfluxDB database, as well to save tags values to the InfluxDB databases. It can be used in read-only mode mode, or updating values, using as an Unified Namespace TagProvider, or it can also be used in Historian, Storage Locations, to act as one of locations where the Historian Module can save its data

On this page:

Table of Contents
2
maxLevel3minLevel
stylenone


Configuration

To set up InfluxDB as a TagProvider, navigate to Unified Namespace → TagProvider Connections and select the InfluxDB Connector. Or the same configuration dialog will be presented when selecting InfluxDB from Historian → StorageLocations.

Image Added

System Requirements

This TagProvider requires the user to have access to an InfluxDB Server with support for API Version 2.0 or greater.

AnchorInfluxDB Tag Provider and Historian IntegrationInfluxDB Tag Provider and Historian IntegrationInfluxDB TagProvider and Historian Integration

To configure this Protocol as a ExternalTags, go to Unified Namespace → External TagProviders Source and create a new provider for InfluxDB Connector.


Connection Parameters

Field

Description

Provider

Specifies the system the TagProvider will interface with. In this case, it interfaces with the InfluxDB Connector.

Access Mode

Determines permissions for interacting with tags.

Read allows only data reading.

Write permits only data writing. 

ReadWrite enables both reading and writing.

Name

User-defined name for the TagProvider instance. Identifies the specific configuration in the system.

Description

Defines a short description for the TagProvider's purpose or the systems it interfaces with. Provides context for its usage.

ProtocolOptions

Defines specific communication settings for the connection to the device.

Connection

Defines connection settings for the InfluxDB, including IP address, port, token, bucket, and organization.

IP Address

Specifies the IP address of the InfluxDB server.

Port

Sets the port number used for communication with the InfluxDB server.

Token

Specifies the token for authentication with the InfluxDB server.

Bucket

Defines the bucket within InfluxDB to retrieve or store data.

Organization

Specifies the organization associated with the InfluxDB instance.

Test

Verifies the connection settings to ensure successful communication with the specified server.

ConnectionString

Displays the full connection string used to connect to the InfluxDB server. Provides a summary of all connection parameters

The Station syntax is similar to the Device one, with two additional fields:

  • IP Address: InfluxDB Database Server Default value is localhost.
  • Port: InfluxDB Database Server Port Default value is 8086.
  • Token: Token used to verify Read/Write Permission.
  • Bucket: Bucket in which client will connect If Connection parameters are correctly filled, you should see all buckets available in the ComboBox DropDown.
  • Organization: Organization defined for user in InfluxDB Database

    .


    • Collector: Specifies the type of Collector to be used. Each one have a specific behavior in Runtime. Options are:
      • Default: Connects to any InfluxDB Database without any custom TreeView is based only on Filter configuration.
    tProj Historian
      • SolutionHistorian: Is used to Write ProjectTags Historian data in a custom.
        • Filters field will always be disabled, with measurement and field columns added to.
        • When Provider is used as Historian, Historian TableName will be used as measurement.
        • TreeView structure will behave different than Default and MQTT More details available in following sections.
      • MQTT: Is used to Read Data that was stored using Telegraf’s MQTT Plugin pre-defined column structure.
        • The Topic information MUST be stored in a column named topic.
        • Filters field will always be disabled, with measurement, topic and field columns added to
        • TreeView structure will behave different than Default and tProj Historian.More details available in following sections.
    • Filters: Defines a hierarchical order for columns, separated by comma (","), when assembling the TreeView.
    1. You can browse the columns to be discarded at the "+"
    2. Click on + or - to add / remove And Up/Down arrows to change the filter order.
    Image Removed
    Info
    titleCollector Selection

    When using the InfluxDB in conjunction with Unified Namespace TagProvider, the Collector Default and MQTT can be used.

    When using the InfluxDB as a Historian Storage Location, the Collection SolutionHistorian shall be used. 


    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:

     TreeView Structure Behavior.Image Modified

    Note
    Always use the Test button to verify the connection status.

    Collectors

    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.

    Tip
    titleCustomColumns in InfluxDB

    TagProvider connections

    Info

    ExternalTags connection cannot create new CustomColumns in InfluxDB Database, only access existing ones. To create new CustomColumns, use the Device Module Configuration.


    Collectors

    Default Collector

    This collector will access any InfluxDB Database, and create the TreeView Structure based on the Filters. 

    This Collector can Read/Write data

    .

    tProj Historian Collector

    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.

    Create New Provider dialog.Image Removed

    Storing Data

    In this Configuration, Tags added on Historian  Historian Tags, into a Table targeted for InfluxDB Provider, will be automatically logged in your Database.

    InfluxDB TagProvider as Historian.Image Removed

    In this scenario, the Table Name will act as our _measurement and the Complete TagName will be added to the field column.

    Image Removed

    Reading Historical Data

    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.

    InfluxDB Table TagProvider as HistorianImage Removed

    , and it is used with the Unified Namespace TagProviders.

    MQTT Collector

    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:

    Code Block
    languagetext

    Panel/Motor1/RPM


    Panel/Motor2/RPM

    The _measurement is defined as mqtt_consumer and _field is value.

    Our TreeView Structure is illustrated below.

    TreeView Structure For MQTT Collector.Image Modified

    Aggregation Methods in Charts

    SolutionHistorian Collector

    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.

    Image Removed

    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:

    Code Block
    languagebash
    TTrendChart trend = this.CurrentDisplay.GetControl("trend") as TTrendChart;
    trend.GetSamplesMode = "<AggregationMethod>;<AggregationInterval>";
    trend.Refresh();

    Where:

    • AggregationMethod: One of the methods available in the list below:

    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

    collector is used with the Historian Storage Location configuration. 

    In this case, the InfluxDB is used as one of the repositories for the Historian Module of the solution. 

    In this Configuration, Tags added on Historian /  Historian Tags, into a Table targeted for InfluxDB Provider, will be automatically logged in your Database.

    The Historian Table Name will act as our _measurement and the Complete TagName will be added to the field column.

    Image Added

    Reading Historical Data

    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.

    InfluxDB Table TagProvider as HistorianImage Added

    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.

    NoteIt is important to always refresh when changing the GetSamplesMode to make sure the correct data is displayed.





    In this section:

    Page Tree
    root@parent
    spacesV10