Skip to content

MTConnect CPP Reference Agent Documentation

Dave Wickelhaus edited this page Dec 15, 2024 · 11 revisions

MTConnect C++ Reference Agent Documentation


Reference MTConnect Agent

The MTConnect implementation that has been most closely tracking the MTConnect standard and is used in most production implementation is the C++ Agent that resides on the MTConnect project pages of github C++ Agent.

As part of the effort, we also provide pre-built Windows x86 binaries that are statically linked and can be run on any Windows computer dating from around Windows XP SP2 and later. Earlier builds are possible, but these will be left up to the reader. The pre-built binaries can be found at: C++ Agent Releases.

The C++ Agent provides the fullest implementation of the standard available at the time of release. The version number (Major, Minor, Patch, Build) are tied to the MTConnect standard. The first three (Major, Minor, Build) are based directly on the MTConnect standard release nomenclature and the build number will increment as new versions of the C++ agent is released. When the agent is in pre-release for a upcoming version of the standard, it will be suffixed with a RCn where this stands for Release Candidate n as in RC1.

The agent has a rich level of configuration and is capable of serving up content from the local file system and allowing changes to be pushed. To get the full details on the configuration, again, visit the C++ Agent github page and scroll down to the readme file. There are many features built in to the agent, some documented better than others. We will try to document some of the more interesting capabilities on these pages.

Responsibilities

The MTConnect agent receives data from an adapter and transforms it as required by the MTConnect standard. The adapter communicates with the device's propriatary interface and delivers a simple pipe-delimited stream of data on change. The agent take the stream of data and associates it with the data model, performs any conversions, and then renders it in XML or JSON according to the standard. The agent exists to facilitate implemention by providing the protocol and transformat responsibilities away from the adapter.

The agent main responsibility is data collection, transformation, and delivery to various sinks (destination protocols). The agent supports REST as the primary method using HTTP optionally with TLS (SSL) according to the MTConnect standard. Starting with version 2.0, various plugins are available for OPC UA, Kafka, InfluxDB, and MQTT.

Quick Start (Windows)

  • Download the pre-built Agent from Releases
  • unzip the archive
    • The agent executable is in the bin directory with a sample agent.cfg file
    • The distribution comes with an example Device.xml file providing a description of the machine
  • Open a command prompt:
      C:> cd cppagent-2.<version>-win64\bin
      C:> agent debug

replace <version> with the release version number, such as 2.0.0.7

  • Open a browser and navigate to:
     http://localhost:5000/probe
  • Configure the agent for your machine and adapter
    • Modify the Device.xml with the components and data available from you adapter(s)
  • The agent supports many incoming data feeds as follows:
    • Classic SHDR (pipe delimited. timestamped data)
    • MQTT
    • Another agent
    • Plugins available for OPC UA and other protocols.

See Building the C++ Agent for further install options, operating systems, and platforms.

Usage and Configuration

Agent Usage and Configuration

Adapter Connectivity

Adapter Connectivity

Building the C Plus Plus Agent

The agent build is dependent on the following utilities:

  • C++ Compiler compliant with C++ 17
  • git is optional but suggested to download source and update when changes occur
  • cmake for build generator and testing
  • python 3 and pip to support conan for dependency and package management
  • ruby and rake for mruby to support building the embedded scripting engine [not required if -o with_ruby=False]

Raspberry Pi OS

Installing C++ Agent on Raspberry Pi

Ubuntu

Installing C++ Agent on Ubuntu

Windows

Installing C++ Agent on Windows

Mac

Installing C++ Agent on Mac

Fedora Alpine

Installing C++ Agent on Fedora Alpine

MQTT

Adapter