skybotz / Kepware_Template

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Kepware and InfluxDB Integration

Kepware Version: KEPServerEX | 6.11.718.0

The goal: This repository will contain the how to guide and configs to get you started with both platforms. Kepware has provided a Factory simulator so you can trial the integration without connecting to your machines.

Prerequisite

Setup

You have two options when intergrating Kepware and InfluxDB together. Direct and via Telegraf. There are pros and cons to both architectures, pick the version that is right for your usecase.

The below instructions will get you up and running. I highly recommend you check out "PTC Kepware and InfluxDB: Collecting and Storing Your Automation Data" for more infromation.

Direct

Pros Cons
No bridging software required Limited Data model transformation and templating (has to be done in InfluxDB)
No code templating

Note: The below instructions will teach you how to deploy the Kepware Smart Factory simulation with is preconfigured with the IoT Gateway template. For more information check out the instructions here.

  1. Open KEPServerEX 6 configuration.
  2. (Optional) Load factory_simulator project file.
  3. Right Click IoT Gateway and select new agent.
  4. Select REST Client.
  5. Enter the below InfluxDB URL and modify the following paramterars (base_url, organisation and bucket):
    {{base_url}}/api/v2/write?bucket={{bucket}}&precision=ms&org={{org}}
  1. Enter the token header:
Authorization: Token <TOKEN>
Content-Type: text/plain
  1. Right click the newely created agent. Select properties.
  2. Select message. Change template to advance template. Add the new template.
|#each VALUES|kepware,factory=germany |TAGNAME|=|VALUE| |TIMESTAMP||#unless @last||LINEFEED||/unless||/each|

Change the template type to plain text.

  1. Add server tags to the new IoT gateway and restart the gatway. IMPORTANT: tags cannot have spaces within there names.

Telegraf

Pros Cons
Data model transformation and templating Second application to maintain
Stream Kepware data to multiple enterprise endpoints (Cloud, historians and enterpise platforms)
  1. Download and install Telegraf.
  2. Decide whether to use the MQTT or OPC UA Telegraf config. Note that MQTT requires that you use Kepware's IoT Gateway and setup an MQTT Broker like Mosquitto.
  3. Complete the Telegraf configuration parameters. See blog guide for more information on each.
  4. Start the Telegraf service,
sudo systemctl start telegraf 

Contributing

Pull requests are welcome. For major changes, please open an issue first to discuss what you would like to change.

Please make sure to update tests as appropriate.

About