From c75223eb4adabcab26303ae1bce9288cd81f8843 Mon Sep 17 00:00:00 2001 From: Patrick Ritchie Date: Mon, 13 May 2024 20:57:15 -0400 Subject: [PATCH] Updated ReadMe files for v6.4.0 --- README.md | 42 ++-- .../NLog.config | 4 +- .../README-Nuget.md | 2 +- .../README.md | 2 +- agent/MTConnect.NET-Agent/NLog.config | 10 +- agent/MTConnect.NET-Agent/README.md | 2 +- .../MTConnect.NET-Applications-Agents.csproj | 19 -- .../README-Nuget.md | 27 ++- .../README.md | 27 ++- .../MTConnectHttpAgentServer.cs | 8 +- .../Module.cs | 1 + .../README-Nuget.md | 104 ++++----- .../README.md | 104 ++++----- .../README-Nuget.md | 13 +- .../README.md | 13 +- .../README-Nuget.md | 9 +- .../README.md | 9 +- .../README-Nuget.md | 61 +++--- .../README.md | 61 +++--- .../README-Nuget.md | 31 ++- .../README.md | 31 ++- .../README-Nuget.md | 5 +- .../README.md | 5 +- agent/README.md | 28 ++- build/AssemblyInfo.cs | 4 +- docs/InfluxDB.md | 4 +- docs/MQTT-AWS-Greengrass-Moquette.md | 38 ++-- docs/MQTT-AWS-IoT.md | 35 ++- docs/MQTT-HiveMQ.md | 35 ++- docs/OpenSSL.md | 2 +- .../MTConnect.NET-Agent-Embedded/ReadMe.md | 6 +- examples/MTConnect.NET-Client-HTTP/Program.cs | 17 +- libraries/MTConnect.NET-HTTP/README-Nuget.md | 10 + libraries/MTConnect.NET-HTTP/README.md | 10 + .../README-Nuget.md | 12 +- .../MTConnect.NET-JSON-cppagent/README.md | 12 +- libraries/MTConnect.NET-JSON/README-Nuget.md | 2 + libraries/MTConnect.NET-JSON/README.md | 2 + libraries/MTConnect.NET-MQTT/README-Nuget.md | 171 ++++++--------- libraries/MTConnect.NET-MQTT/README.md | 93 ++++++-- libraries/MTConnect.NET-SHDR/README-Nuget.md | 24 +-- libraries/MTConnect.NET-SHDR/README.md | 24 +-- libraries/MTConnect.NET/README-Nuget.md | 202 +++++++++++++++++- .../MTConnect.NET-Embedded-Agent/NLog.config | 10 +- 44 files changed, 843 insertions(+), 488 deletions(-) diff --git a/README.md b/README.md index c6d01512..b7d8e812 100644 --- a/README.md +++ b/README.md @@ -4,7 +4,7 @@ [![MTConnect.NET](https://github.com/TrakHound/MTConnect.NET/actions/workflows/dotnet.yml/badge.svg)](https://github.com/TrakHound/MTConnect.NET/actions/workflows/dotnet.yml) -> 5/1/2024 : Version 6.4 Released with new Agent, Adapter, & SysML Import +> **New Release 5/13/2024** : Version 6.4 Released with new Agent, Adapter, & SysML Import ## Download @@ -39,7 +39,7 @@
## Overview -MTConnect.NET is a fully featured and fully Open Source .NET library for MTConnect to develop Agents, Adapters, and Clients. Supports MTConnect Versions up to 2.3. A pre-compiled Agent application is available to download as well as an Adapter application that can be easily customized. +MTConnect.NET is a fully featured and fully Open Source **[.NET](https://dotnet.microsoft.com/)** library for **[MTConnect](https://www.mtconnect.org/)** to develop Agents, Adapters, and Clients. Supports MTConnect Versions up to 2.3. A pre-compiled Agent application is available to download as well as an Adapter application that can be easily customized. - .NET Native MTConnect Agent - Adapter framework used to send data to an MTConnect Agent @@ -72,44 +72,38 @@ MTConnect.NET is a fully featured and fully Open Source .NET library for MTConne - Embed an MTConnect Agent into your adapter (remove need for separate SHDR Adapter) #### MTConnect Version Compatibility -MTConnect.NET is designed to be fully compatible for all versions of the MTConnect standard. This is done through processing by the [MTConnectAgent](https://github.com/TrakHound/MTConnect.NET/tree/master/src/MTConnect.NET-Common/Agents/MTConnectAgent.cs) class before data is output. This allows the version to be a parameter when requesting data from the Agent. More information can be found in the [Devices README](https://github.com/TrakHound/MTConnect.NET/tree/master/src/MTConnect.NET-Common/Devices/README.md). +MTConnect.NET is designed to be fully compatible for all versions of the MTConnect standard. This is done through processing by the [MTConnectAgent](https://github.com/TrakHound/MTConnect.NET/tree/master/libraries/MTConnect.NET-Common/Agents/MTConnectAgent.cs) class before data is output. This allows the version to be a parameter when requesting data from the Agent. More information can be found in the [Devices README](https://github.com/TrakHound/MTConnect.NET/tree/master/libraries/MTConnect.NET-Common/Devices/README.md). #### Data Validation -Validation is performed on a Device, Component, Composition, or DataItem level through the classes in [Devices](https://github.com/TrakHound/MTConnect.NET/tree/master/src/MTConnect.NET-Common/Devices). This allows for validation without the need to use XML schemas (although XML Validation against XSD schemas is supported). - -### Live Demo -A live demo of the MTConnect Gateway HTTP Agent (AspNetCore) application is running at [https://mtconnect.trakhound.com](https://mtconnect.trakhound.com?outputComments=true&indentOutput=true&version=2.1). -- [https://mtconnect.trakhound.com/current](https://mtconnect.trakhound.com/current?outputComments=true&indentOutput=true&version=2.1) -- [https://mtconnect.trakhound.com/sample](https://mtconnect.trakhound.com/sample?outputComments=true&indentOutput=true&version=2.1&count=500) -- [https://mtconnect.trakhound.com/assets](https://mtconnect.trakhound.com/assets?outputComments=true&indentOutput=true) +Validation is performed on a Device, Component, Composition, or DataItem level through the classes in [Devices](https://github.com/TrakHound/MTConnect.NET/tree/master/libraries/MTConnect.NET-Common/Devices). This allows for validation without the need to use XML schemas (although XML Validation against XSD schemas is supported). ## Clients #### Client Interfaces -- [IMTConnectClient](https://github.com/TrakHound/MTConnect.NET/blob/master/src/MTConnect.NET-Common/Clients/IMTConnectClient.cs) : Interface used to read MTConnect response documents (Probe, Current, Sample, and Assets) -- [IMTConnectEntityClient](https://github.com/TrakHound/MTConnect.NET/blob/master/src/MTConnect.NET-Common/Clients/IMTConnectEntityClient.cs) : Interface used to read MTConnect entities (Device, Observation, Asset) +- [IMTConnectClient](https://github.com/TrakHound/MTConnect.NET/blob/master/libraries/MTConnect.NET-Common/Clients/IMTConnectClient.cs) : Interface used to read MTConnect response documents (Probe, Current, Sample, and Assets) +- [IMTConnectEntityClient](https://github.com/TrakHound/MTConnect.NET/blob/master/libraries/MTConnect.NET-Common/Clients/IMTConnectEntityClient.cs) : Interface used to read MTConnect entities (Device, Observation, Asset) #### Client Classes -- [MTConnectHttpClient](https://github.com/TrakHound/MTConnect.NET/blob/master/src/MTConnect.NET-HTTP/Clients/MTConnectHttpClient.cs) : Reads from MTConnect Agents using the MTConnect HTTP REST Api. Supports both polling and streaming. Supports compression. Supports XML & JSON. -- [MTConnectMqttClient](https://github.com/TrakHound/MTConnect.NET/blob/master/src/MTConnect.NET-MQTT/Clients/MTConnectMqttClient.cs) : Reads MTConnect data from an MQTT Broker. Supports the latest MTConnect MQTT Protocol. +- [MTConnectHttpClient](https://github.com/TrakHound/MTConnect.NET/blob/master/libraries/MTConnect.NET-HTTP/Clients/MTConnectHttpClient.cs) : Reads from MTConnect Agents using the MTConnect HTTP REST Api. Supports both polling and streaming. Supports compression. Supports XML & JSON. +- [MTConnectMqttClient](https://github.com/TrakHound/MTConnect.NET/blob/master/libraries/MTConnect.NET-MQTT/Clients/MTConnectMqttClient.cs) : Reads MTConnect data from an MQTT Broker. Supports the latest MTConnect MQTT Protocol. ## Agents #### Embedded Agent Application An MTConnect Agent can be embedded into an application where the DataSource(s) can be read and the MTConnect Agent can be combined into the same application. This eliminates the need to transfer data from an Adapter to an Agent (typically using the SHDR protocol). -##### Option #1 : [DotNet Template](https://github.com/TrakHound/MTConnect.NET/tree/version-6.0) +##### Option #1 : [DotNet Template](https://github.com/TrakHound/MTConnect.NET/tree/master/templates/mtconnect.net-agent) ``` dotnet new mtconnect.net-agent ``` -##### Option #2 : [Nuget Package](https://github.com/TrakHound/MTConnect.NET/tree/version-6.0) +##### Option #2 : [Nuget Package](https://www.nuget.org/packages/MTConnect.NET-Applications-Agents) ``` dotnet add package MTConnect.NET-Applications-Agents ``` #### Standalone Agent Application -A standalone preconfigured [Application](https://github.com/TrakHound/MTConnect.NET/tree/version-6.0/agent/MTConnect.NET-Agent) ready to download is available and supports: +A standalone preconfigured [Application](https://github.com/TrakHound/MTConnect.NET/tree/master/agent/MTConnect.NET-Agent) ready to download is available and supports: - Modular architecture - HTTP Server Module - SHDR Adapter Module @@ -123,13 +117,13 @@ A standalone preconfigured [Application](https://github.com/TrakHound/MTConnect. - Extensible configuration file and monitors for changes #### Agent Classes -- [MTConnectAgent](https://github.com/TrakHound/MTConnect.NET/blob/master/src/MTConnect.NET-Common/Agents/MTConnectAgent.cs) : Handles MTConnect Entities (Device, Observation, Asset), Unit Conversion, Filtering, etc. -- [MTConnectAgentBroker](https://github.com/TrakHound/MTConnect.NET/blob/master/src/MTConnect.NET-Common/Agents/MTConnectAgent.cs) : Handles MTConnect Requests to respond with Response Documents (Probe, Current, Sample, Assets) specified in the MTConnect Standard, Buffers, etc. +- [MTConnectAgent](https://github.com/TrakHound/MTConnect.NET/blob/master/libraries/MTConnect.NET-Common/Agents/MTConnectAgent.cs) : Handles MTConnect Entities (Device, Observation, Asset), Unit Conversion, Filtering, etc. +- [MTConnectAgentBroker](https://github.com/TrakHound/MTConnect.NET/blob/master/libraries/MTConnect.NET-Common/Agents/MTConnectAgent.cs) : Handles MTConnect Requests to respond with Response Documents (Probe, Current, Sample, Assets) specified in the MTConnect Standard, Buffers, etc. ## Adapters #### Standalone Modular Adapter Application -A preconfigured [Application](https://github.com/TrakHound/MTConnect.NET/tree/version-6.0/adapter/MTConnect.NET-Adapter) & [Library](https://github.com/TrakHound/MTConnect.NET/tree/version-6.0/adapter/MTConnect.NET-Applications-Adapter) to build an Adapter is available and supports: +A preconfigured [Application](https://github.com/TrakHound/MTConnect.NET/tree/master/adapter/MTConnect.NET-Adapter) & [Library](https://github.com/TrakHound/MTConnect.NET/tree/master/adapter/MTConnect.NET-Applications-Adapter) to build an Adapter is available and supports: - Modular architecture - SHDR Module (export data to an MTConnect Agent using the SHDR protocol) - MQTT Module (export data to an MQTT Broker to be read by an MTConnect Agent) @@ -139,10 +133,10 @@ A preconfigured [Application](https://github.com/TrakHound/MTConnect.NET/tree/ve - Updated through a Nuget package (no source code copy & paste required when updating to new versions) #### SHDR Adapter Classes -- [ShdrAdapter](https://github.com/TrakHound/MTConnect.NET/blob/master/src/MTConnect.NET-SHDR/Adapters/Shdr/ShdrAdapter.cs) : Sends the most recent values On-Demand using the SendCurrent() method. This is used when full control of the communication is needed. -- [ShdrIntervalAdapter](https://github.com/TrakHound/MTConnect.NET/blob/master/src/MTConnect.NET-SHDR/Adapters/Shdr/ShdrIntervalAdapter.cs) : Sends the most recent values at the specified Interval. This is used when a set interval is adequate and the most recent value is all that is needed -- [ShdrQueueAdapter](https://github.com/TrakHound/MTConnect.NET/blob/master/src/MTConnect.NET-SHDR/Adapters/Shdr/ShdrQueueAdapter.cs) : Queues all values that are sent from the PLC and sends them all on demand using the SendBuffer() method. This is used when all values are needed and full control of the communication is needed. -- [ShdrIntervalQueueAdapter](https://github.com/TrakHound/MTConnect.NET/blob/master/src/MTConnect.NET-SHDR/Adapters/Shdr/ShdrIntervalQueueAdapter.cs) : Queues all values that are sent from the PLC and sends any queued values at the specified Interval. This is used when all values are needed but an interval is adequate. +- [ShdrAdapter](https://github.com/TrakHound/MTConnect.NET/blob/master/src/MTConnect.NET-SHDR/Adapters/ShdrAdapter.cs) : Sends the most recent values On-Demand using the SendCurrent() method. This is used when full control of the communication is needed. +- [ShdrIntervalAdapter](https://github.com/TrakHound/MTConnect.NET/blob/master/src/MTConnect.NET-SHDR/Adapters/ShdrIntervalAdapter.cs) : Sends the most recent values at the specified Interval. This is used when a set interval is adequate and the most recent value is all that is needed +- [ShdrQueueAdapter](https://github.com/TrakHound/MTConnect.NET/blob/master/src/MTConnect.NET-SHDR/Adapters/ShdrQueueAdapter.cs) : Queues all values that are sent from the PLC and sends them all on demand using the SendBuffer() method. This is used when all values are needed and full control of the communication is needed. +- [ShdrIntervalQueueAdapter](https://github.com/TrakHound/MTConnect.NET/blob/master/src/MTConnect.NET-SHDR/Adapters/ShdrIntervalQueueAdapter.cs) : Queues all values that are sent from the PLC and sends any queued values at the specified Interval. This is used when all values are needed but an interval is adequate. ## Nuget Packages The Nuget packages for the libraries in this repo are listed below: diff --git a/adapter/MTConnect.NET-Applications-Adapter/NLog.config b/adapter/MTConnect.NET-Applications-Adapter/NLog.config index 2bfd17b0..00ee903e 100644 --- a/adapter/MTConnect.NET-Applications-Adapter/NLog.config +++ b/adapter/MTConnect.NET-Applications-Adapter/NLog.config @@ -8,7 +8,7 @@ - @@ -16,7 +16,7 @@ layout="${longdate}|${event-properties:item=EventId_Id:whenEmpty=0}|${uppercase:${level}}|${logger}|${message} ${exception:format=tostring}" />--> - diff --git a/adapter/Modules/MTConnect.NET-AdapterModule-MQTT/README-Nuget.md b/adapter/Modules/MTConnect.NET-AdapterModule-MQTT/README-Nuget.md index d4993b21..afaaa889 100644 --- a/adapter/Modules/MTConnect.NET-AdapterModule-MQTT/README-Nuget.md +++ b/adapter/Modules/MTConnect.NET-AdapterModule-MQTT/README-Nuget.md @@ -3,7 +3,7 @@ # MTConnect MQTT Adapter Module This Adapter Module sends input data to an MQTT Broker that can be read by an MTConnect Agent ->This Module is still under development. Please feel free to leave feedback or create Issues on GitHub. +>**Note:** This Module is still under development and may be deprecated in the future. Please feel free to leave feedback or create Issues on GitHub. ## Configuration ```yaml diff --git a/adapter/Modules/MTConnect.NET-AdapterModule-MQTT/README.md b/adapter/Modules/MTConnect.NET-AdapterModule-MQTT/README.md index cb6c726d..2a345913 100644 --- a/adapter/Modules/MTConnect.NET-AdapterModule-MQTT/README.md +++ b/adapter/Modules/MTConnect.NET-AdapterModule-MQTT/README.md @@ -3,7 +3,7 @@ # MTConnect MQTT Adapter Module This Adapter Module sends input data to an MQTT Broker that can be read by an MTConnect Agent ->This Module is still under development. Please feel free to leave feedback or create Issues on GitHub. +>**Note:** This Module is still under development and may be deprecated in the future. Please feel free to leave feedback or create Issues on GitHub. ## Nuget diff --git a/agent/MTConnect.NET-Agent/NLog.config b/agent/MTConnect.NET-Agent/NLog.config index 2cfe9cfa..19ed00c0 100644 --- a/agent/MTConnect.NET-Agent/NLog.config +++ b/agent/MTConnect.NET-Agent/NLog.config @@ -8,23 +8,23 @@ - - - - - diff --git a/agent/MTConnect.NET-Agent/README.md b/agent/MTConnect.NET-Agent/README.md index 4f21d1a2..fb7cd920 100644 --- a/agent/MTConnect.NET-Agent/README.md +++ b/agent/MTConnect.NET-Agent/README.md @@ -42,7 +42,7 @@ This project is a full implementation of an MTConnect Agent used to read data fr - Configuration File monitoring to automatically restart the Agent upon configuration file changes - Flexible Logging using NLog which can be used to output log information to separate files for easier analysis -![Agent-Diagram](https://raw.githubusercontent.com/TrakHound/MTConnect.NET/version-6.0/img/agent-diagram.png) +![Agent-Diagram](https://raw.githubusercontent.com/TrakHound/MTConnect.NET/master/img/agent-diagram.png) ## Capabilites | Description | Supported | Description | Supported | diff --git a/agent/MTConnect.NET-Applications-Agents/MTConnect.NET-Applications-Agents.csproj b/agent/MTConnect.NET-Applications-Agents/MTConnect.NET-Applications-Agents.csproj index 6b356336..edb2f0a3 100644 --- a/agent/MTConnect.NET-Applications-Agents/MTConnect.NET-Applications-Agents.csproj +++ b/agent/MTConnect.NET-Applications-Agents/MTConnect.NET-Applications-Agents.csproj @@ -78,23 +78,4 @@ - - - Always - true - true - True - contentFiles\any\any;content - true - - - Always - true - true - True - contentFiles\any\any;content - true - - - diff --git a/agent/Modules/MTConnect.NET-AgentModule-HttpAdapter/README-Nuget.md b/agent/Modules/MTConnect.NET-AgentModule-HttpAdapter/README-Nuget.md index d5fb463c..4477e398 100644 --- a/agent/Modules/MTConnect.NET-AgentModule-HttpAdapter/README-Nuget.md +++ b/agent/Modules/MTConnect.NET-AgentModule-HttpAdapter/README-Nuget.md @@ -5,17 +5,34 @@ This Agent Module implements an adapter to read from other MTConnect Agents usin ## Configuration ```yaml -- http-adapter: - address: localhost - port: 5000 - deviceKey: M12346 - interval: 100 +modules: + - http-adapter: + address: localhost + port: 5000 + deviceKey: M12346 + interval: 100 + heartbeat: 10000 + useSSL: false + currentOnly: false + useStreaming: true ``` * `address` - The client Agent IP Address or Hostname to read from. * `port` - The port number to read from. +* `deviceKey` - The Name or UUID of the Device to read + +* `interval` - The Interval (in milliseconds) to receive new data at + +* `heartbeat` - The Heartbeat (in milliseconds) to use to maintain a connection to the Agent + +* `useSSL` - Set to 'true' if using HTTPS + +* `currentOnly` - Gets or Sets whether the stream requests a Current (true) or a Sample (false) + +* `useStreaming` - Gets or Sets whether the client should use Streaming (true) or Polling (false) + ## Contribution / Feedback - Please use the [Issues](https://github.com/TrakHound/MTConnect.NET/issues) tab to create issues for specific problems that you may encounter diff --git a/agent/Modules/MTConnect.NET-AgentModule-HttpAdapter/README.md b/agent/Modules/MTConnect.NET-AgentModule-HttpAdapter/README.md index e3d60d60..a17ed3f1 100644 --- a/agent/Modules/MTConnect.NET-AgentModule-HttpAdapter/README.md +++ b/agent/Modules/MTConnect.NET-AgentModule-HttpAdapter/README.md @@ -23,17 +23,34 @@ This Agent Module implements an adapter to read from other MTConnect Agents usin ## Configuration ```yaml -- http-adapter: - address: localhost - port: 5000 - deviceKey: M12346 - interval: 100 +modules: + - http-adapter: + address: localhost + port: 5000 + deviceKey: M12346 + interval: 100 + heartbeat: 10000 + useSSL: false + currentOnly: false + useStreaming: true ``` * `address` - The client Agent IP Address or Hostname to read from. * `port` - The port number to read from. +* `deviceKey` - The Name or UUID of the Device to read + +* `interval` - The Interval (in milliseconds) to receive new data at + +* `heartbeat` - The Heartbeat (in milliseconds) to use to maintain a connection to the Agent + +* `useSSL` - Set to 'true' if using HTTPS + +* `currentOnly` - Gets or Sets whether the stream requests a Current (true) or a Sample (false) + +* `useStreaming` - Gets or Sets whether the client should use Streaming (true) or Polling (false) + ## Contribution / Feedback - Please use the [Issues](https://github.com/TrakHound/MTConnect.NET/issues) tab to create issues for specific problems that you may encounter diff --git a/agent/Modules/MTConnect.NET-AgentModule-HttpServer/MTConnectHttpAgentServer.cs b/agent/Modules/MTConnect.NET-AgentModule-HttpServer/MTConnectHttpAgentServer.cs index 06b59cda..314163e6 100644 --- a/agent/Modules/MTConnect.NET-AgentModule-HttpServer/MTConnectHttpAgentServer.cs +++ b/agent/Modules/MTConnect.NET-AgentModule-HttpServer/MTConnectHttpAgentServer.cs @@ -36,10 +36,10 @@ public MTConnectHttpAgentServer(HttpServerModuleConfiguration configuration, IMT } - protected override void OnConfigureServer(ServerConfig serverConfig) - { - base.OnConfigureServer(serverConfig); - } + //protected override void OnConfigureServer(ServerConfig serverConfig) + //{ + // base.OnConfigureServer(serverConfig); + //} protected override Stream OnProcessStatic(MTConnectStaticFileRequest request) { diff --git a/agent/Modules/MTConnect.NET-AgentModule-HttpServer/Module.cs b/agent/Modules/MTConnect.NET-AgentModule-HttpServer/Module.cs index 197ede0a..a22eddd6 100644 --- a/agent/Modules/MTConnect.NET-AgentModule-HttpServer/Module.cs +++ b/agent/Modules/MTConnect.NET-AgentModule-HttpServer/Module.cs @@ -4,6 +4,7 @@ using Ceen; using MTConnect.Agents; using MTConnect.Configurations; +using MTConnect.Http; using MTConnect.Logging; using MTConnect.Servers.Http; using System; diff --git a/agent/Modules/MTConnect.NET-AgentModule-HttpServer/README-Nuget.md b/agent/Modules/MTConnect.NET-AgentModule-HttpServer/README-Nuget.md index 25157b70..d24d1b84 100644 --- a/agent/Modules/MTConnect.NET-AgentModule-HttpServer/README-Nuget.md +++ b/agent/Modules/MTConnect.NET-AgentModule-HttpServer/README-Nuget.md @@ -5,25 +5,26 @@ This Agent Module implements a MTConnect REST Protocol Http server ## Configuration ```yaml - - http-server: - hostname: localhost - port: 5000 - allowPut: true - indentOutput: true - documentFormat: xml - accept: - text/xml: xml - application/json: json-cppagent - responseCompression: - - gzip - - br - files: - - path: schemas - location: schemas - - path: styles - location: styles - - path: styles/favicon.ico - location: favicon.ico +modules: + - http-server: + hostname: localhost + port: 5000 + allowPut: true + indentOutput: true + documentFormat: xml + accept: + text/xml: xml + application/json: json-cppagent + responseCompression: + - gzip + - br + files: + - path: schemas + location: schemas + - path: styles + location: styles + - path: styles/favicon.ico + location: favicon.ico ``` * `hostname` - The server IP Address or Hostname to bind to. @@ -66,65 +67,72 @@ This Agent Module implements a MTConnect REST Protocol Http server ### Example 1 Use defualt configuration ```yaml - - http-server: +modules: + - http-server: ``` ### Example 2 Specify the port ```yaml - - http-server: - port: 5001 +modules: + - http-server: + port: 5001 ``` ### Example 3 Specify the port and hostname to an IP Address ```yaml - - http-server: - hostname: 192.168.1.145 - port: 5001 +modules: + - http-server: + hostname: 192.168.1.145 + port: 5001 ``` ### Example 4 Specify the port and hostname ```yaml - - http-server: - hostname: DESKTOP-HV74M4N - port: 5001 +modules: + - http-server: + hostname: DESKTOP-HV74M4N + port: 5001 ``` ### Example 4 Specify the port and hostname with TLS (PFX Certificate) ```yaml - - http-server: - hostname: DESKTOP-HV74M4N - port: 5001 - tls: - pfx: - certificatePath: c:\certs\mtconnect-testing.pfx - certificatePassword: mtconnect +modules: + - http-server: + hostname: DESKTOP-HV74M4N + port: 5001 + tls: + pfx: + certificatePath: c:\certs\mtconnect-testing.pfx + certificatePassword: mtconnect ``` ### Example 5 Specify the port and hostname with TLS (PEM Certificate) ```yaml - - http-server: - hostname: DESKTOP-HV74M4N - port: 5001 - tls: - pem: - certificateAuthority: c:\certs\rootCA.crt - certificatePath: c:\certs\mtconnect-testing.crt - privateKeyPath: c:\certs\mtconnect-testing.key - privateKeyPassword: mtconnect +modules: + - http-server: + hostname: DESKTOP-HV74M4N + port: 5001 + tls: + pem: + certificateAuthority: c:\certs\rootCA.crt + certificatePath: c:\certs\mtconnect-testing.crt + privateKeyPath: c:\certs\mtconnect-testing.key + privateKeyPassword: mtconnect ``` ### Example 6 Specify with custom Accept headers ```yaml - - http-server: - accept: - text/xml: xml - application/json: json-cppagent +modules: + - http-server: + accept: + text/xml: xml + application/json: json-cppagent ``` diff --git a/agent/Modules/MTConnect.NET-AgentModule-HttpServer/README.md b/agent/Modules/MTConnect.NET-AgentModule-HttpServer/README.md index 98b97ce1..a85148d7 100644 --- a/agent/Modules/MTConnect.NET-AgentModule-HttpServer/README.md +++ b/agent/Modules/MTConnect.NET-AgentModule-HttpServer/README.md @@ -23,25 +23,26 @@ This Agent Module implements a MTConnect REST Protocol Http server ## Configuration ```yaml - - http-server: - hostname: localhost - port: 5000 - allowPut: true - indentOutput: true - documentFormat: xml - accept: - text/xml: xml - application/json: json-cppagent - responseCompression: - - gzip - - br - files: - - path: schemas - location: schemas - - path: styles - location: styles - - path: styles/favicon.ico - location: favicon.ico +modules: + - http-server: + hostname: localhost + port: 5000 + allowPut: true + indentOutput: true + documentFormat: xml + accept: + text/xml: xml + application/json: json-cppagent + responseCompression: + - gzip + - br + files: + - path: schemas + location: schemas + - path: styles + location: styles + - path: styles/favicon.ico + location: favicon.ico ``` * `hostname` - The server IP Address or Hostname to bind to. @@ -84,65 +85,72 @@ This Agent Module implements a MTConnect REST Protocol Http server ### Example 1 Use defualt configuration ```yaml - - http-server: +modules: + - http-server: ``` ### Example 2 Specify the port ```yaml - - http-server: - port: 5001 +modules: + - http-server: + port: 5001 ``` ### Example 3 Specify the port and hostname to an IP Address ```yaml - - http-server: - hostname: 192.168.1.145 - port: 5001 +modules: + - http-server: + hostname: 192.168.1.145 + port: 5001 ``` ### Example 4 Specify the port and hostname ```yaml - - http-server: - hostname: DESKTOP-HV74M4N - port: 5001 +modules: + - http-server: + hostname: DESKTOP-HV74M4N + port: 5001 ``` ### Example 4 Specify the port and hostname with TLS (PFX Certificate) ```yaml - - http-server: - hostname: DESKTOP-HV74M4N - port: 5001 - tls: - pfx: - certificatePath: c:\certs\mtconnect-testing.pfx - certificatePassword: mtconnect +modules: + - http-server: + hostname: DESKTOP-HV74M4N + port: 5001 + tls: + pfx: + certificatePath: c:\certs\mtconnect-testing.pfx + certificatePassword: mtconnect ``` ### Example 5 Specify the port and hostname with TLS (PEM Certificate) ```yaml - - http-server: - hostname: DESKTOP-HV74M4N - port: 5001 - tls: - pem: - certificateAuthority: c:\certs\rootCA.crt - certificatePath: c:\certs\mtconnect-testing.crt - privateKeyPath: c:\certs\mtconnect-testing.key - privateKeyPassword: mtconnect +modules: + - http-server: + hostname: DESKTOP-HV74M4N + port: 5001 + tls: + pem: + certificateAuthority: c:\certs\rootCA.crt + certificatePath: c:\certs\mtconnect-testing.crt + privateKeyPath: c:\certs\mtconnect-testing.key + privateKeyPassword: mtconnect ``` ### Example 6 Specify with custom Accept headers ```yaml - - http-server: - accept: - text/xml: xml - application/json: json-cppagent +modules: + - http-server: + accept: + text/xml: xml + application/json: json-cppagent ``` diff --git a/agent/Modules/MTConnect.NET-AgentModule-MqttAdapter/README-Nuget.md b/agent/Modules/MTConnect.NET-AgentModule-MqttAdapter/README-Nuget.md index 8a022969..69f58924 100644 --- a/agent/Modules/MTConnect.NET-AgentModule-MqttAdapter/README-Nuget.md +++ b/agent/Modules/MTConnect.NET-AgentModule-MqttAdapter/README-Nuget.md @@ -3,15 +3,16 @@ # MTConnect MQTT Adapter Agent Module This Agent Module implements an adapter to read from an MQTT broker ->This Module is still under development. Please feel free to leave feedback or create Issues on GitHub. +>**Note:** This Module is still under development and may be deprecated in the future. Please feel free to leave feedback or create Issues on GitHub. ## Configuration ```yaml -- mqtt-adapter: - server: localhost - port: 1883 - topicPrefix: input - deviceKey: M12346 +modules: + - mqtt-adapter: + server: localhost + port: 1883 + topicPrefix: input + deviceKey: M12346 ``` * `server` - The MQTT broker hostname diff --git a/agent/Modules/MTConnect.NET-AgentModule-MqttAdapter/README.md b/agent/Modules/MTConnect.NET-AgentModule-MqttAdapter/README.md index 0f100b05..d1702147 100644 --- a/agent/Modules/MTConnect.NET-AgentModule-MqttAdapter/README.md +++ b/agent/Modules/MTConnect.NET-AgentModule-MqttAdapter/README.md @@ -3,7 +3,7 @@ # MTConnect MQTT Adapter Agent Module This Agent Module implements an adapter to read from an MQTT broker ->This Module is still under development. Please feel free to leave feedback or create Issues on GitHub. +>**Note:** This Module is still under development and may be deprecated in the future. Please feel free to leave feedback or create Issues on GitHub. ## Nuget
@@ -25,11 +25,12 @@ This Agent Module implements an adapter to read from an MQTT broker ## Configuration ```yaml -- mqtt-adapter: - server: localhost - port: 1883 - topicPrefix: input - deviceKey: M12346 +modules: + - mqtt-adapter: + server: localhost + port: 1883 + topicPrefix: input + deviceKey: M12346 ``` * `server` - The MQTT broker hostname diff --git a/agent/Modules/MTConnect.NET-AgentModule-MqttBroker/README-Nuget.md b/agent/Modules/MTConnect.NET-AgentModule-MqttBroker/README-Nuget.md index 29f6ca28..4d97f43b 100644 --- a/agent/Modules/MTConnect.NET-AgentModule-MqttBroker/README-Nuget.md +++ b/agent/Modules/MTConnect.NET-AgentModule-MqttBroker/README-Nuget.md @@ -5,10 +5,11 @@ This Agent Module serves data via an **Internal** MQTT Broker ## Configuration ```yaml -- mqtt-broker: - port: 1883 - topicPrefix: MTConnect - topicStructure: Document +modules: + - mqtt-broker: + port: 1883 + topicPrefix: MTConnect + topicStructure: Document ``` * `server` - The MQTT broker hostname to bind to diff --git a/agent/Modules/MTConnect.NET-AgentModule-MqttBroker/README.md b/agent/Modules/MTConnect.NET-AgentModule-MqttBroker/README.md index 024ffa5e..35bfbd40 100644 --- a/agent/Modules/MTConnect.NET-AgentModule-MqttBroker/README.md +++ b/agent/Modules/MTConnect.NET-AgentModule-MqttBroker/README.md @@ -23,10 +23,11 @@ This Agent Module serves data via an **Internal** MQTT Broker ## Configuration ```yaml -- mqtt-broker: - port: 1883 - topicPrefix: MTConnect - topicStructure: Document +modules: + - mqtt-broker: + port: 1883 + topicPrefix: MTConnect + topicStructure: Document ``` * `server` - The MQTT broker hostname to bind to diff --git a/agent/Modules/MTConnect.NET-AgentModule-MqttRelay/README-Nuget.md b/agent/Modules/MTConnect.NET-AgentModule-MqttRelay/README-Nuget.md index 1a44b285..8b8c3a7e 100644 --- a/agent/Modules/MTConnect.NET-AgentModule-MqttRelay/README-Nuget.md +++ b/agent/Modules/MTConnect.NET-AgentModule-MqttRelay/README-Nuget.md @@ -5,11 +5,12 @@ This Agent Module writes data to an **External** MQTT Broker ## Configuration ```yaml -- mqtt-relay: - server: localhost - port: 1883 - topic: enterprise/site/area/line/cell/MTConnect - topicStructure: Document +modules: + - mqtt-relay: + server: localhost + port: 1883 + topic: enterprise/site/area/line/cell/MTConnect + topicStructure: Document ``` * `server` - The MQTT broker hostname @@ -72,34 +73,36 @@ This Agent Module writes data to an **External** MQTT Broker ### AWS Greengrass Moquette Configuration Example ```yaml -- mqtt-relay: - server: localhost - port: 8883 - clientId: mtconnect-test # Set the ClientId to the AWS Thing ID - tls: - verifyClientCertificate: false - pem: - certificateAuthority: certs/AmazonRootCA1.pem - certificatePath: certs/2316549874654321654984984158961634984794-certificate.pem.crt - privateKeyPath: certs/2316549874654321654984984158961634984794-private.pem.key - documentFormat: json-cppagent - currentInterval: 5000 - sampleInterval: 500 - topicPrefix: enterprise/site/area/line/cell/MTConnect +modules: + - mqtt-relay: + server: localhost + port: 8883 + clientId: mtconnect-test # Set the ClientId to the AWS Thing ID + tls: + verifyClientCertificate: false + pem: + certificateAuthority: certs/AmazonRootCA1.pem + certificatePath: certs/2316549874654321654984984158961634984794-certificate.pem.crt + privateKeyPath: certs/2316549874654321654984984158961634984794-private.pem.key + documentFormat: json-cppagent + currentInterval: 5000 + sampleInterval: 500 + topicPrefix: enterprise/site/area/line/cell/MTConnect ``` ### HiveMQ Configuration Example ```yaml -- mqtt-relay: - server: 5679887d308d402888f32.s1.eu.hivemq.cloud - port: 8883 - username: mtconnect - password: mtconnect - useTls: true - documentFormat: json-cppagent - currentInterval: 5000 - sampleInterval: 500 - topicPrefix: enterprise/site/area/line/cell/MTConnect +modules: + - mqtt-relay: + server: 5679887d308d402888f32.s1.eu.hivemq.cloud + port: 8883 + username: mtconnect + password: mtconnect + useTls: true + documentFormat: json-cppagent + currentInterval: 5000 + sampleInterval: 500 + topicPrefix: enterprise/site/area/line/cell/MTConnect ``` ## Contribution / Feedback diff --git a/agent/Modules/MTConnect.NET-AgentModule-MqttRelay/README.md b/agent/Modules/MTConnect.NET-AgentModule-MqttRelay/README.md index 1e842bb1..75d42a5f 100644 --- a/agent/Modules/MTConnect.NET-AgentModule-MqttRelay/README.md +++ b/agent/Modules/MTConnect.NET-AgentModule-MqttRelay/README.md @@ -23,11 +23,12 @@ This Agent Module writes data to an **External** MQTT Broker ## Configuration ```yaml -- mqtt-relay: - server: localhost - port: 1883 - topic: enterprise/site/area/line/cell/MTConnect - topicStructure: Document +modules: + - mqtt-relay: + server: localhost + port: 1883 + topic: enterprise/site/area/line/cell/MTConnect + topicStructure: Document ``` * `server` - The MQTT broker hostname @@ -90,34 +91,36 @@ This Agent Module writes data to an **External** MQTT Broker ### AWS Greengrass Moquette Configuration Example ```yaml -- mqtt-relay: - server: localhost - port: 8883 - clientId: mtconnect-test # Set the ClientId to the AWS Thing ID - tls: - verifyClientCertificate: false - pem: - certificateAuthority: certs/AmazonRootCA1.pem - certificatePath: certs/2316549874654321654984984158961634984794-certificate.pem.crt - privateKeyPath: certs/2316549874654321654984984158961634984794-private.pem.key - documentFormat: json-cppagent - currentInterval: 5000 - sampleInterval: 500 - topicPrefix: enterprise/site/area/line/cell/MTConnect +modules: + - mqtt-relay: + server: localhost + port: 8883 + clientId: mtconnect-test # Set the ClientId to the AWS Thing ID + tls: + verifyClientCertificate: false + pem: + certificateAuthority: certs/AmazonRootCA1.pem + certificatePath: certs/2316549874654321654984984158961634984794-certificate.pem.crt + privateKeyPath: certs/2316549874654321654984984158961634984794-private.pem.key + documentFormat: json-cppagent + currentInterval: 5000 + sampleInterval: 500 + topicPrefix: enterprise/site/area/line/cell/MTConnect ``` ### HiveMQ Configuration Example ```yaml -- mqtt-relay: - server: 5679887d308d402888f32.s1.eu.hivemq.cloud - port: 8883 - username: mtconnect - password: mtconnect - useTls: true - documentFormat: json-cppagent - currentInterval: 5000 - sampleInterval: 500 - topicPrefix: enterprise/site/area/line/cell/MTConnect +modules: + - mqtt-relay: + server: 5679887d308d402888f32.s1.eu.hivemq.cloud + port: 8883 + username: mtconnect + password: mtconnect + useTls: true + documentFormat: json-cppagent + currentInterval: 5000 + sampleInterval: 500 + topicPrefix: enterprise/site/area/line/cell/MTConnect ``` ## Contribution / Feedback diff --git a/agent/Modules/MTConnect.NET-AgentModule-ShdrAdapter/README-Nuget.md b/agent/Modules/MTConnect.NET-AgentModule-ShdrAdapter/README-Nuget.md index 4157823d..3b83718b 100644 --- a/agent/Modules/MTConnect.NET-AgentModule-ShdrAdapter/README-Nuget.md +++ b/agent/Modules/MTConnect.NET-AgentModule-ShdrAdapter/README-Nuget.md @@ -5,22 +5,37 @@ This Agent Module implements the MTConnect REST Protocol ## Configuration ```yaml -- shdr-adapter: - deviceKey: M12346 - hostname: localhost - port: 7878 +modules: + - shdr-adapter: + deviceKey: M12346 + hostname: localhost + port: 7878 ``` -* `allowShdrDevice` - Sets whether a Device Model can be sent from an SHDR Adapter +* `deviceKey` - The UUID or Name of the Device that corresponds to the name of the Device (typically set in the Device XML file). + +* `hostname` - The host the adapter is located on. -* `preserveUuid` - Do not overwrite the UUID with the UUID from the adapter, preserve the UUID for the Device. This can be overridden on a per adapter basis. +* `port` - The port to connect to the adapter. -* `suppressIpAddress` - Suppress the Adapter IP Address and port when creating the Agent Device ids and names for 1.7. This applies to all adapters. +* `heartbeat` - The Heartbeat interval (in milliseconds) that the TCP Connection will use to maintain a connection when no new data has been sent -* `timeout` - The amount of time (in milliseconds) an adapter can be silent before it is disconnected. +* `connectionTimeout` - The amount of time (in milliseconds) an adapter can be silent before it is disconnected. * `reconnectInterval` - The amount of time (in milliseconds) between adapter reconnection attempts. +* `allowShdrDevice` - Sets whether a Device Model can be sent from an SHDR Adapter + +* `availableOnConnection` - For devices that do not have the ability to provide available events, if TRUE, this sets the Availability to AVAILABLE upon connection. + +* `convertUnits` - Adapter setting for data item units conversion in the agent. Assumes the adapter has already done unit conversion. Defaults to global. + +* `ignoreObservationCase` - Gets or Sets the default for Ignoring the case of Observation values + +* `ignoreTimestamps` - Overwrite timestamps with the agent time. This will correct clock drift but will not give as accurate relative time since it will not take into consideration network latencies. This can be overridden on a per adapter basis. + +* `outputConnectionInformation` - Gets or Sets whether the Connection Information (Host / Port) is output to the Agent to be collected by a client + ## Contribution / Feedback - Please use the [Issues](https://github.com/TrakHound/MTConnect.NET/issues) tab to create issues for specific problems that you may encounter diff --git a/agent/Modules/MTConnect.NET-AgentModule-ShdrAdapter/README.md b/agent/Modules/MTConnect.NET-AgentModule-ShdrAdapter/README.md index c77b4df7..655d1520 100644 --- a/agent/Modules/MTConnect.NET-AgentModule-ShdrAdapter/README.md +++ b/agent/Modules/MTConnect.NET-AgentModule-ShdrAdapter/README.md @@ -23,22 +23,37 @@ This Agent Module implements the MTConnect REST Protocol ## Configuration ```yaml -- shdr-adapter: - deviceKey: M12346 - hostname: localhost - port: 7878 +modules: + - shdr-adapter: + deviceKey: M12346 + hostname: localhost + port: 7878 ``` -* `allowShdrDevice` - Sets whether a Device Model can be sent from an SHDR Adapter +* `deviceKey` - The UUID or Name of the Device that corresponds to the name of the Device (typically set in the Device XML file). + +* `hostname` - The host the adapter is located on. -* `preserveUuid` - Do not overwrite the UUID with the UUID from the adapter, preserve the UUID for the Device. This can be overridden on a per adapter basis. +* `port` - The port to connect to the adapter. -* `suppressIpAddress` - Suppress the Adapter IP Address and port when creating the Agent Device ids and names for 1.7. This applies to all adapters. +* `heartbeat` - The Heartbeat interval (in milliseconds) that the TCP Connection will use to maintain a connection when no new data has been sent -* `timeout` - The amount of time (in milliseconds) an adapter can be silent before it is disconnected. +* `connectionTimeout` - The amount of time (in milliseconds) an adapter can be silent before it is disconnected. * `reconnectInterval` - The amount of time (in milliseconds) between adapter reconnection attempts. +* `allowShdrDevice` - Sets whether a Device Model can be sent from an SHDR Adapter + +* `availableOnConnection` - For devices that do not have the ability to provide available events, if TRUE, this sets the Availability to AVAILABLE upon connection. + +* `convertUnits` - Adapter setting for data item units conversion in the agent. Assumes the adapter has already done unit conversion. Defaults to global. + +* `ignoreObservationCase` - Gets or Sets the default for Ignoring the case of Observation values + +* `ignoreTimestamps` - Overwrite timestamps with the agent time. This will correct clock drift but will not give as accurate relative time since it will not take into consideration network latencies. This can be overridden on a per adapter basis. + +* `outputConnectionInformation` - Gets or Sets whether the Connection Information (Host / Port) is output to the Agent to be collected by a client + ## Contribution / Feedback - Please use the [Issues](https://github.com/TrakHound/MTConnect.NET/issues) tab to create issues for specific problems that you may encounter diff --git a/agent/Processors/MTConnect.NET-AgentProcessor-Python/README-Nuget.md b/agent/Processors/MTConnect.NET-AgentProcessor-Python/README-Nuget.md index 3bf5a2a4..36f44fac 100644 --- a/agent/Processors/MTConnect.NET-AgentProcessor-Python/README-Nuget.md +++ b/agent/Processors/MTConnect.NET-AgentProcessor-Python/README-Nuget.md @@ -5,8 +5,9 @@ This Agent Processor uses individual Python script files to transform input data ## Configuration ```yaml -- python: - directory: processors +processors: + - python: + directory: processors ``` * `directory` - The directory to load and monitor for ".py" script files. diff --git a/agent/Processors/MTConnect.NET-AgentProcessor-Python/README.md b/agent/Processors/MTConnect.NET-AgentProcessor-Python/README.md index 0b5d5cc4..50c6a8e4 100644 --- a/agent/Processors/MTConnect.NET-AgentProcessor-Python/README.md +++ b/agent/Processors/MTConnect.NET-AgentProcessor-Python/README.md @@ -23,8 +23,9 @@ This Agent Processor uses individual Python script files to transform input data ## Configuration ```yaml -- python: - directory: processors +processors: + - python: + directory: processors ``` * `directory` - The directory to load and monitor for ".py" script files. diff --git a/agent/README.md b/agent/README.md index 2512ac14..0a6a621b 100644 --- a/agent/README.md +++ b/agent/README.md @@ -1,5 +1,26 @@ # Standalone MTConnect Agent -> https://github.com/TrakHound/MTConnect.NET/tree/version-6.0/agent/MTConnect.NET-Agent + +
+ + + + + + + + + + + + + + + + + + + +
NameDownload Link
Installerhttps://github.com/TrakHound/MTConnect.NET/releases
Dockerhttps://hub.docker.com/repository/docker/trakhound/mtconnect.net-agent
A standalone preconfigured application ready to download is available and supports: - Modular architecture @@ -11,14 +32,17 @@ A standalone preconfigured application ready to download is available and suppor - Easy Windows Installer - Linux Compatible - Run as a Windows Service +- Docker Image - Transform input data using Python scripts - Extensible configuration file and monitors for changes +> [Learn More](https://github.com/TrakHound/MTConnect.NET/tree/master/agent/MTConnect.NET-Agent) about the standalone Agent installer + # Embedded MTConnect Agent An MTConnect Agent can be embedded into an application where the DataSource(s) can be read and the MTConnect Agent can be combined into the same application. This eliminates the need to transfer data from an Adapter to an Agent (typically using the SHDR protocol). ## Option 1 -The first option is to use the **[dotnet CLI](https://learn.microsoft.com/en-us/dotnet/core/tools/)** to install the MTConnect.NET-Agent-Template using the below commands: +The first option is to use the **[dotnet CLI](https://learn.microsoft.com/en-us/dotnet/core/tools/)** to install the **[MTConnect.NET-Agent-Template](https://www.nuget.org/packages/MTConnect.NET-Agent-Template)** using the below commands: ### Install Template ``` diff --git a/build/AssemblyInfo.cs b/build/AssemblyInfo.cs index cc90b4f2..42ed0fd6 100644 --- a/build/AssemblyInfo.cs +++ b/build/AssemblyInfo.cs @@ -1,6 +1,6 @@ using System.Reflection; -[assembly: AssemblyVersion("6.3.2")] -[assembly: AssemblyFileVersion("6.3.2")] +[assembly: AssemblyVersion("6.4.0")] +[assembly: AssemblyFileVersion("6.4.0")] [assembly: AssemblyCompany("TrakHound Inc.")] [assembly: AssemblyCopyright("Copyright (c) 2024 TrakHound Inc., All Rights Reserved.")] diff --git a/docs/InfluxDB.md b/docs/InfluxDB.md index 10f65ca4..fb98d464 100644 --- a/docs/InfluxDB.md +++ b/docs/InfluxDB.md @@ -21,8 +21,8 @@ var influxClient = new InfluxDBClient(influxServer, influxToken); // Setup MTConnect Client (over HTTP) var mtconnectClient = new MTConnectHttpClient("http://localhost:5000"); -mtconnectClient.OnCurrentReceived += ObservationsReceived; -mtconnectClient.OnSampleReceived += ObservationsReceived; +mtconnectClient.CurrentReceived += ObservationsReceived; +mtconnectClient.SampleReceived += ObservationsReceived; mtconnectClient.Start(); Console.ReadLine(); diff --git a/docs/MQTT-AWS-Greengrass-Moquette.md b/docs/MQTT-AWS-Greengrass-Moquette.md index f28f177f..cb165b2f 100644 --- a/docs/MQTT-AWS-Greengrass-Moquette.md +++ b/docs/MQTT-AWS-Greengrass-Moquette.md @@ -14,27 +14,29 @@ Under the Deployment configuration for the `aws.greengrass.clientdevices.mqtt.Mo } ``` -## MTConnect Relay Agent +## Relay Agent Module - [GitHub](https://github.com/TrakHound/MTConnect.NET/tree/master/applications/Agents/MTConnect-Agent-MQTT-Relay) -- [Release](https://github.com/TrakHound/MTConnect.NET/releases/latest) -### MTConnect Relay Agent Configuration +### Example Configuration (agent.config.yaml) ```yaml -# The hostname of the MQTT broker to publish messages to -server: localhost - -# The port number of the MQTT broker to publish messages to -port: 8883 - -# Set the ClientId to the AWS Thing ID -clientId: trakhound-test - -# The cerficates to use are for the AWS Thing that is configured for the AWS Core Device -tls: - pem: - certificateAuthority: C:\Users\patrick\Downloads\AmazonRootCA1.pem - certificatePath: C:\Users\patrick\Downloads\2316549874654321654984984158961634984794-certificate.pem.crt - privateKeyPath: C:\Users\patrick\Downloads\2316549874654321654984984158961634984794-private.pem.key +modules: + - mqtt-relay: + + # The hostname of the MQTT broker to publish messages to + server: localhost + + # The port number of the MQTT broker to publish messages to + port: 8883 + + # Set the ClientId to the AWS Thing ID + clientId: trakhound-test + + # The cerficates to use are for the AWS Thing that is configured for the AWS Core Device + tls: + pem: + certificateAuthority: C:\Users\patrick\Downloads\AmazonRootCA1.pem + certificatePath: C:\Users\patrick\Downloads\2316549874654321654984984158961634984794-certificate.pem.crt + privateKeyPath: C:\Users\patrick\Downloads\2316549874654321654984984158961634984794-private.pem.key ``` ## Screenshots diff --git a/docs/MQTT-AWS-IoT.md b/docs/MQTT-AWS-IoT.md index 3a727059..9eafe321 100644 --- a/docs/MQTT-AWS-IoT.md +++ b/docs/MQTT-AWS-IoT.md @@ -16,26 +16,25 @@ The SSL cerfificates can be created in the AWS IoT console and should be downloaded to the PC/device the MTConnect Agent. Files in this example are copied to the MTConnect Relay Agent's installation directory under the subdirectory "/certs". -## MTConnect Relay Agent +## Relay Agent Module - [GitHub](https://github.com/TrakHound/MTConnect.NET/tree/master/applications/Agents/MTConnect-Agent-MQTT-Relay) -- [Release](https://github.com/TrakHound/MTConnect.NET/releases/latest) -### Configuration +### Example Configuration (agent.config.yaml) ```yaml -... +modules: + - mqtt-relay: + + # The hostname of the MQTT broker to publish messages to + server: akljadkfjdlsf-ats.iot.us-east-1.amazonaws.com + + # The port number of the MQTT broker to publish messages to + port: 8883 + + # Set TLS configuration + tls: + pem: + certificateAuthority: certs/AmazonRootCA1.pem + certificatePath: certs/asfdslkafjdslkfjdklsdjf-certificate.pem.crt + privateKeyPath: certs/sdlkajlksdajfldskjfdldlskfjdslkaj-private.pem.key -# The hostname of the MQTT broker to publish messages to -server: akljadkfjdlsf-ats.iot.us-east-1.amazonaws.com - -# The port number of the MQTT broker to publish messages to -port: 8883 - -# Set TLS configuration -tls: - pem: - certificateAuthority: certs/AmazonRootCA1.pem - certificatePath: certs/asfdslkafjdslkfjdklsdjf-certificate.pem.crt - privateKeyPath: certs/sdlkajlksdajfldskjfdldlskfjdslkaj-private.pem.key - -... ``` diff --git a/docs/MQTT-HiveMQ.md b/docs/MQTT-HiveMQ.md index 9435ed79..34edc1ea 100644 --- a/docs/MQTT-HiveMQ.md +++ b/docs/MQTT-HiveMQ.md @@ -7,26 +7,21 @@ - [Download](https://mqtt-explorer.com/) - Download the MQTT Explorer app to browse the MQTT broker - [GitHub](https://github.com/thomasnordquist/MQTT-Explorer) -## MTConnect Relay Agent +## Relay Agent Module - [GitHub](https://github.com/TrakHound/MTConnect.NET/tree/master/applications/Agents/MTConnect-Agent-MQTT-Relay) -- [Release](https://github.com/TrakHound/MTConnect.NET/releases/latest) -### Configuration +### Example Configuration (agent.config.yaml) ```yaml -... - -# The hostname of the MQTT broker to publish messages to -server: 56497654654651654654987.s1.eu.hivemq.cloud - -# The port number of the MQTT broker to publish messages to -port: 8883 - -username: exampleuser -password: examplepassword -useTls: true - -mqttFormat: Hierarchy -retainMessage: true - -... -``` \ No newline at end of file +modules: + - mqtt-relay: + + # The hostname of the MQTT broker to publish messages to + server: 56497654654651654654987.s1.eu.hivemq.cloud + + # The port number of the MQTT broker to publish messages to + port: 8883 + + username: exampleuser + password: examplepassword + useTls: true +``` diff --git a/docs/OpenSSL.md b/docs/OpenSSL.md index c03fe961..5987eba6 100644 --- a/docs/OpenSSL.md +++ b/docs/OpenSSL.md @@ -1,5 +1,5 @@ # Create Self Signed Certificate ``` -openssl req -x509 -newkey rsa:2048 -keyout trakhound.key -out trakhound.crt -days 365 +openssl req -x509 -newkey rsa:2048 -keyout mtconnect.key -out mtconnect.crt -days 365 ``` \ No newline at end of file diff --git a/examples/MTConnect.NET-Agent-Embedded/ReadMe.md b/examples/MTConnect.NET-Agent-Embedded/ReadMe.md index 9b894090..1c1ceaf8 100644 --- a/examples/MTConnect.NET-Agent-Embedded/ReadMe.md +++ b/examples/MTConnect.NET-Agent-Embedded/ReadMe.md @@ -4,12 +4,12 @@ This is an example of an application that has an embedded MTConnect Agent. This ## Create .NET Project Create a .NET Console project: -![Visual-Studio-Create-Project](https://raw.githubusercontent.com/TrakHound/MTConnect.NET/version-6.0/img/vs-create-console-project.png) +![Visual-Studio-Create-Project](https://raw.githubusercontent.com/TrakHound/MTConnect.NET/master/img/vs-create-console-project.png) ## Install Nuget Pacakge -Install the [MTConnect.NET-Applications-Agents](https://www.nuget.org/packages/MTConnect.NET-Applications-Agents/6.2.2-beta) Nuget package: +Install the [MTConnect.NET-Applications-Agents](https://www.nuget.org/packages/MTConnect.NET-Applications-Agents) Nuget package: ``` -dotnet add package MTConnect.NET-Applications-Agents --version 6.2.2-beta +dotnet add package MTConnect.NET-Applications-Agents ``` ## Edit Program.cs diff --git a/examples/MTConnect.NET-Client-HTTP/Program.cs b/examples/MTConnect.NET-Client-HTTP/Program.cs index 9b4f104e..662659df 100644 --- a/examples/MTConnect.NET-Client-HTTP/Program.cs +++ b/examples/MTConnect.NET-Client-HTTP/Program.cs @@ -16,17 +16,12 @@ static void Main(string[] args) static void DocumentClient() { + var client = new MTConnectHttpClient("localhost", 5000); //var client = new MTConnectHttpClient("http://mtconnect.mazakcorp.com/", 5719); - //var client = new MTConnectHttpClient("localhost", 5006, "OKUMA-Lathe"); - //var client = new MTConnectHttpClient("localhost", 5006); - var client = new MTConnectHttpClient("localhost", 5000, "Okuma"); - //var client = new MTConnectHttpClient("localhost", 5000, "Okuma-Lathe"); - //var client = new MTConnectHttpClient("localhost", 5001); client.Interval = 100; - //client.Heartbeat = 0; client.ClientStarted += (s, args) => { Console.WriteLine("Client Started"); }; client.ClientStopped += (s, args) => { Console.WriteLine("Client Stopped"); }; - client.FormatError += (s, args) => { Console.WriteLine($"Format Error : {args.ContentType.Name} : {args.Messages?.FirstOrDefault()}"); }; + //client.FormatError += (s, args) => { Console.WriteLine($"Format Error : {args.ContentType.Name} : {args.Messages?.FirstOrDefault()}"); }; client.ProbeReceived += (s, response) => { @@ -43,8 +38,8 @@ static void DocumentClient() { Console.WriteLine($"Observation Received : {observation.DataItemId} : {string.Join(";", observation.Values.Select(o => o.Value))}"); - //var validationResult = observation.Validate(); - //Console.WriteLine($"Observation Validation : {observation.DataItemId} : {validationResult.IsValid} : {validationResult.Message}"); + var validationResult = observation.Validate(); + Console.WriteLine($"Observation Validation : {observation.DataItemId} : {validationResult.IsValid} : {validationResult.Message}"); } } } @@ -60,8 +55,8 @@ static void DocumentClient() { Console.WriteLine($"Observation Received : {observation.DataItemId} : {string.Join(";", observation.Values.Select(o => o.Value))}"); - //var validationResult = observation.Validate(); - //Console.WriteLine($"Observation Validation : {observation.DataItemId} : {validationResult.IsValid} : {validationResult.Message}"); + var validationResult = observation.Validate(); + Console.WriteLine($"Observation Validation : {observation.DataItemId} : {validationResult.IsValid} : {validationResult.Message}"); } } } diff --git a/libraries/MTConnect.NET-HTTP/README-Nuget.md b/libraries/MTConnect.NET-HTTP/README-Nuget.md index e99aed3f..0d8e4fcf 100644 --- a/libraries/MTConnect.NET-HTTP/README-Nuget.md +++ b/libraries/MTConnect.NET-HTTP/README-Nuget.md @@ -2,3 +2,13 @@ # MTConnect.NET-HTTP Classes to implement HTTP Clients & Servers for MTConnect + +## Client +A client that implements the full MTConnect REST Protocol is implemented in the [MTConnectHttpClient](https://github.com/TrakHound/MTConnect.NET/blob/version-6.0/libraries/MTConnect.NET-HTTP/Clients/MTConnectHttpClient.cs) class. This client supports individual endpoint requests as well the streaming protocol. + +> **[Learn More](https://github.com/TrakHound/MTConnect.NET/blob/version-6.0/libraries/MTConnect.NET-HTTP/Clients/README.md)** : Click here to learn more about MTConnect REST HTTP Clients in MTConnect.NET + +## Server +A fully MTConnect compatible HTTP web server is implemented in the [MTConnectHttpServer](https://github.com/TrakHound/MTConnect.NET/blob/version-6.0/libraries/MTConnect.NET-HTTP/Servers/MTConnectHttpServer.cs) class. This server supports all REST endpoints defined in the MTConnect standard as well as the streaming protocol. + +> **[Learn More](https://github.com/TrakHound/MTConnect.NET/blob/version-6.0/libraries/MTConnect.NET-HTTP/Servers/README.md)** : Click here to learn more about MTConnect REST HTTP Servers in MTConnect.NET \ No newline at end of file diff --git a/libraries/MTConnect.NET-HTTP/README.md b/libraries/MTConnect.NET-HTTP/README.md index 9d32f429..4728302a 100644 --- a/libraries/MTConnect.NET-HTTP/README.md +++ b/libraries/MTConnect.NET-HTTP/README.md @@ -20,3 +20,13 @@ Classes to implement HTTP Clients & Servers for MTConnect + +## Client +A client that implements the full MTConnect REST Protocol is implemented in the [MTConnectHttpClient](https://github.com/TrakHound/MTConnect.NET/blob/version-6.0/libraries/MTConnect.NET-HTTP/Clients/MTConnectHttpClient.cs) class. This client supports individual endpoint requests as well the streaming protocol. + +> **[Learn More](https://github.com/TrakHound/MTConnect.NET/blob/version-6.0/libraries/MTConnect.NET-HTTP/Clients/README.md)** : Click here to learn more about MTConnect REST HTTP Clients in MTConnect.NET + +## Server +A fully MTConnect compatible HTTP web server is implemented in the [MTConnectHttpServer](https://github.com/TrakHound/MTConnect.NET/blob/version-6.0/libraries/MTConnect.NET-HTTP/Servers/MTConnectHttpServer.cs) class. This server supports all REST endpoints defined in the MTConnect standard as well as the streaming protocol. + +> **[Learn More](https://github.com/TrakHound/MTConnect.NET/blob/version-6.0/libraries/MTConnect.NET-HTTP/Servers/README.md)** : Click here to learn more about MTConnect REST HTTP Servers in MTConnect.NET diff --git a/libraries/MTConnect.NET-JSON-cppagent/README-Nuget.md b/libraries/MTConnect.NET-JSON-cppagent/README-Nuget.md index 1f3b46dc..e1400755 100644 --- a/libraries/MTConnect.NET-JSON-cppagent/README-Nuget.md +++ b/libraries/MTConnect.NET-JSON-cppagent/README-Nuget.md @@ -3,11 +3,19 @@ # MTConnect.NET-JSON-cppagent MTConnect.NET-JSON is an extension library to MTConnect.NET that provides reading and writing as the JSON format supported by the MTConnect C++ Agent (json version 2.0) +>**Note:** This Module is still under development and may be deprecated in the future. Please feel free to leave feedback or create Issues on GitHub. + ## Overview This library is used to Read and Write using the JSON format from an MTConnect C++ Agent using its Json version 2.0. This can be used for clients and servers. -## Document Format ID +## Document Format ID (REST and latest version of MQTT) ``` JSON-CPPAGENT ``` -The above document format ID can be used to specify a ResponseDocumentFormatter or EntityFormatter to output using this library + +## Document Format ID (older versions of MQTT) +``` +JSON-CPPAGENT-MQTT +``` + +The above document format IDs can be used to specify a ResponseDocumentFormatter or EntityFormatter to output using this library diff --git a/libraries/MTConnect.NET-JSON-cppagent/README.md b/libraries/MTConnect.NET-JSON-cppagent/README.md index 900f6acb..bc786ebd 100644 --- a/libraries/MTConnect.NET-JSON-cppagent/README.md +++ b/libraries/MTConnect.NET-JSON-cppagent/README.md @@ -3,6 +3,8 @@ # MTConnect.NET-JSON-cppagent MTConnect.NET-JSON is an extension library to MTConnect.NET that provides reading and writing as the JSON format supported by the MTConnect C++ Agent (json version 2.0) +>**Note:** This Module is still under development and may be deprecated in the future. Please feel free to leave feedback or create Issues on GitHub. + ## Nuget @@ -24,8 +26,14 @@ MTConnect.NET-JSON is an extension library to MTConnect.NET that provides readin ## Overview This library is used to Read and Write using the JSON format from an MTConnect C++ Agent using its Json version 2.0. This can be used for clients and servers. -## Document Format ID +## Document Format ID (REST and latest version of MQTT) ``` JSON-CPPAGENT ``` -The above document format ID can be used to specify a ResponseDocumentFormatter or EntityFormatter to output using this library + +## Document Format ID (older versions of MQTT) +``` +JSON-CPPAGENT-MQTT +``` + +The above document format IDs can be used to specify a ResponseDocumentFormatter or EntityFormatter to output using this library diff --git a/libraries/MTConnect.NET-JSON/README-Nuget.md b/libraries/MTConnect.NET-JSON/README-Nuget.md index 9380291c..03f1ad2e 100644 --- a/libraries/MTConnect.NET-JSON/README-Nuget.md +++ b/libraries/MTConnect.NET-JSON/README-Nuget.md @@ -3,6 +3,8 @@ # MTConnect.NET-JSON MTConnect.NET-JSON is an extension library to MTConnect.NET that provides reading and writing as JSON formatted Response Documents +>**Note:** This Module is still under development and may be deprecated in the future. Please feel free to leave feedback or create Issues on GitHub. + ## Document Format ID ``` JSON diff --git a/libraries/MTConnect.NET-JSON/README.md b/libraries/MTConnect.NET-JSON/README.md index c9959fd2..415bece8 100644 --- a/libraries/MTConnect.NET-JSON/README.md +++ b/libraries/MTConnect.NET-JSON/README.md @@ -3,6 +3,8 @@ # MTConnect.NET-JSON MTConnect.NET-JSON is an extension library to MTConnect.NET that provides reading and writing as JSON formatted Response Documents +>**Note:** This Module is still under development and may be deprecated in the future. Please feel free to leave feedback or create Issues on GitHub. + ## Nuget
diff --git a/libraries/MTConnect.NET-MQTT/README-Nuget.md b/libraries/MTConnect.NET-MQTT/README-Nuget.md index e9be97ff..c6f0e471 100644 --- a/libraries/MTConnect.NET-MQTT/README-Nuget.md +++ b/libraries/MTConnect.NET-MQTT/README-Nuget.md @@ -3,8 +3,6 @@ # MTConnect.NET-MQTT MTConnect.NET-MQTT is an extension library to MTConnect.NET that provides an MQTT Broker & Client interface to an IMTConnectAgentBroker interface. -> Updated for Version 6 - # Topic Structures `Document` - Topics are the same as HTTP (Probe, Current, Sample, & Assets). Payloads are the corresponding MTConnect Response Documents. This provides a simple protocol that is performance based for applications with high frequency updates. @@ -12,20 +10,83 @@ MTConnect.NET-MQTT is an extension library to MTConnect.NET that provides an MQT ## Document Topic Structure +This topic structure is the official MQTT based protocol for MTConnect. +## Topics -## Entity Topic Structure +The **Document Topic Structure** uses the standard MTConnect Response documents as message payload and the standard MTConnect API endpoints as topics. + +`[TOPIC_PREFIX]/Probe/[DEVICE_UUID]` - The topic where MTConnectDevices Response documents are published + +`[TOPIC_PREFIX]/Current/[DEVICE_UUID]` - The topic where MTConnectStreams Response documents are published at the configured **CurrentInterval** + +`[TOPIC_PREFIX]/Sample/[DEVICE_UUID]` - The topic where MTConnectStreams Response documents are published at the the configured **SampleInterval** when new data is added to the Agent + +`[TOPIC_PREFIX]/Asset/[DEVICE_UUID]/[ASSET_ID]` - The topic where MTConnectAssets Response documents are published + + +## Protocol + +### Probe +Each device is sent in an MTConnectDevices Response document. The message is published upon Agent start/restart or when a Device is changed or a new Device is added. + +#### Topic +``` +[TOPIC_PREFIX]/Probe/[DEVICE_UUID] +``` + +#### Payload +The payload currently defaults to use the **json-cppagent** Document Format ID. + +> **[Learn More](https://github.com/TrakHound/MTConnect.NET/tree/master/libraries/MTConnect.NET-JSON-cppagent/Examples/MTConnectDevicesResponseDocument.json)** : See example MTConnectDevices Response Document Payload + +### Current + +#### Topic +``` +[TOPIC_PREFIX]/Current/[DEVICE_UUID] +``` + +#### Payload +The payload currently defaults to use the **json-cppagent** Document Format ID. +> **[Learn More](https://github.com/TrakHound/MTConnect.NET/tree/master/libraries/MTConnect.NET-JSON-cppagent/Examples/MTConnectStreamsResponseDocument.json)** : See example MTConnectDevices Response Document Payload +### Sample -## Devices +#### Topic +``` +[TOPIC_PREFIX]/Sample/[DEVICE_UUID] +``` + +#### Payload +The payload currently defaults to use the **json-cppagent** Document Format ID. + +> **[Learn More](https://github.com/TrakHound/MTConnect.NET/tree/master/libraries/MTConnect.NET-JSON-cppagent/Examples/MTConnectStreamsResponseDocument.json)** : See example MTConnectDevices Response Document Payload + +### Asset +``` +[TOPIC_PREFIX]/Asset/[DEVICE_UUID]/[ASSET_ID] +``` + +#### Payload +The payload currently defaults to use the **json-cppagent** Document Format ID. + +> **[Learn More](https://github.com/TrakHound/MTConnect.NET/tree/master/libraries/MTConnect.NET-JSON-cppagent/Examples/MTConnectStreamsResponseDocument.json)** : See example MTConnectDevices Response Document Payload + + +## Entity Topic Structure +This topic structure is designed to supplement the Document topic structure and be used for use cases that may require a more simple protocol that requires less payload parsing or the ability to subscribe to specific DataItems. + + +### Devices The **MTConnect/Devices** topics are used to send data that is in an MTConnectDevicesResponse document. ``` MTConnect/Devices/[DEVICE_UUID]/Device ``` -### Device Observations +### Observations Observations may use the **MTConnectMqttFormat.Flat** or **MTConnectMqttFormat.Hierarchy** option to specify how the topics are structured. MTConnectMqttFormat.Flat Format: @@ -49,11 +110,11 @@ Condition messages are sent as an array of Observations since a Condition may ha MTConnect/Devices/[DEVICE_UUID]/Assets/[ASSET_TYPE]/[ASSET_ID] ``` -### Topic Structure (MTConnectMqttFormat.Flat) +### Topics > [Node] = (Payload) -```bash +``` - MTConnect ─ Devices ─ [DEVICE_UUID] @@ -68,7 +129,7 @@ MTConnect/Devices/[DEVICE_UUID]/Assets/[ASSET_TYPE]/[ASSET_ID] ``` ### Example -```bash +``` - MTConnect ─ Devices ─ OKUMA.Lathe.123456 @@ -82,97 +143,3 @@ MTConnect/Devices/[DEVICE_UUID]/Assets/[ASSET_TYPE]/[ASSET_ID] - CuttingTool - 5.12 = {"assetId":"5.12","type":"CuttingTool","timestamp":"2023-02-07T13:36:04.7288143Z","deviceUuid":"OKUMA.Lathe.123456","serialNumber":"12345678946","toolId":"12","cuttingToolLifeCycle":{"cutterStatus":["AVAILABLE","NEW","MEASURED"],"location":{"type":"SPINDLE"},"programToolGroup":"5","programToolNumber":"12","measurements":[{"type":"FunctionalLength","value":7.6543,"units":"MILLIMETER","code":"LF"},{"type":"CuttingDiameterMax","value":0.375,"units":"MILLIMETER","code":"DC"}]}} ``` - -### Topic Structure (MTConnectMqttFormat.Hierarchy) - -> [Node] = (Payload) - -```bash -- MTConnect - ─ Devices - ─ [DEVICE_UUID] - - Device = (JSON) - - Observations - - [COMPONENT_TYPE] - - [COMPONENT_ID] - - Events - - [DATA_ITEM_TYPE] - - [DATA_ITEM_ID] = (JSON) - - SubTypes - - [DATA_ITEM_SUBTYPE] - - [DATA_ITEM_ID] = (JSON) - - Samples - - [DATA_ITEM_TYPE] - - [DATA_ITEM_ID] = (JSON) - - Conditions - - [DATA_ITEM_TYPE] - - [DATA_ITEM_ID] = (JSON Array) - - Assets - - [ASSET_TYPE] - - [ASSET_ID] = (JSON) -``` - -### Example -```bash -- MTConnect - ─ Devices - ─ OKUMA.Lathe.123456 - - Device - - Observations - - Device - - OKUMA.Lathe - - Events - - AVAILABILITY - - L2avail = {"dataItemId":"L2avail","name":"avail","type":"AVAILABILITY","timestamp":"2023-02-07T20:02:26.8978653Z","result":"AVAILABLE"} - - ASSET_CHANGED - - OKUMA.Lathe_assetCount = {"dataItemId":"OKUMA.Lathe_assetCount","name":"assetCount","type":"ASSET_COUNT","timestamp":"2023-02-07T20:02:26.7671421Z","result":"UNAVAILABLE","count":0} - - Controller - - L2ct1 - - Events - - EMERGENCY_STOP - - L2estop = {"dataItemId":"L2estop","name":"estop","type":"EMERGENCY_STOP","timestamp":"2023-02-07T20:02:26.8978653Z","result":"ARMED"} - - Path - - L2p1 - - Events - - EXECUTION - - L2p1execution = {"dataItemId":"L2p1execution","name":"p1execution","type":"EXECUTION","timestamp":"2023-02-07T20:02:26.7671421Z","result":"UNAVAILABLE"} - - Conditions - - SYSTEM - - L2p1system = [{"level":"WARNING","dataItemId":"L2p1system","name":"p1system","type":"SYSTEM","timestamp":"2023-02-07T20:30:16.8639659Z","result":"Not Found","nativeCode":"404"},{"level":"FAULT","dataItemId":"L2p1system","name":"p1system","type":"SYSTEM","timestamp":"2023-02-07T20:30:38.9662297Z","result":"Interval Error","nativeCode":"500"}] - - Samples - - PATH_FEEDRATE - - SubTypes - - ACTUAL - - L2p1Fact = {"dataItemId":"L2p1Fact","name":"p1Fact","type":"PATH_FEEDRATE","subType":"ACTUAL","timestamp":"2023-02-07T20:02:26.7671421Z","result":"UNAVAILABLE"} - - Assets - - CuttingTool - - 5.12 = {"assetId":"5.12","type":"CuttingTool","timestamp":"2023-02-07T13:36:04.7288143Z","deviceUuid":"OKUMA.Lathe.123456","serialNumber":"12345678946","toolId":"12","cuttingToolLifeCycle":{"cutterStatus":["AVAILABLE","NEW","MEASURED"],"location":{"type":"SPINDLE"},"programToolGroup":"5","programToolNumber":"12","measurements":[{"type":"FunctionalLength","value":7.6543,"units":"MILLIMETER","code":"LF"},{"type":"CuttingDiameterMax","value":0.375,"units":"MILLIMETER","code":"DC"}]}} -``` - -## Assets -``` -MTConnect/Assets/[ASSET_TYPE]/[ASSET_ID] -``` -> Note: Assets are sent to two topics. One for the "Global" assets and one for the Device that the Asset was added to - -### Topic Structure - -> [Node] = (Payload) - -```bash -- MTConnect - ─ Assets - ─ [ASSET_TYPE] - - [ASSET_ID] = (JSON) -``` - -### Example -```bash -- MTConnect - - Assets - - CuttingTool - - 5.12 = {"assetId":"5.12","type":"CuttingTool","timestamp":"2023-02-07T13:36:04.7288143Z","deviceUuid":"OKUMA.Lathe.123456","serialNumber":"12345678946","toolId":"12","cuttingToolLifeCycle":{"cutterStatus":["AVAILABLE","NEW","MEASURED"],"location":{"type":"SPINDLE"},"programToolGroup":"5","programToolNumber":"12","measurements":[{"type":"FunctionalLength","value":7.6543,"units":"MILLIMETER","code":"LF"},{"type":"CuttingDiameterMax","value":0.375,"units":"MILLIMETER","code":"DC"}]}} -``` - -## More Information -More information can be found in the MQTT-Protocol document (https://github.com/TrakHound/MTConnect.NET/blob/master/docs/MQTT-Protocol.md). \ No newline at end of file diff --git a/libraries/MTConnect.NET-MQTT/README.md b/libraries/MTConnect.NET-MQTT/README.md index 9664d84e..fd3e7592 100644 --- a/libraries/MTConnect.NET-MQTT/README.md +++ b/libraries/MTConnect.NET-MQTT/README.md @@ -3,8 +3,6 @@ # MTConnect.NET-MQTT MTConnect.NET-MQTT is an extension library to MTConnect.NET that provides an MQTT Broker & Client interface to an IMTConnectAgentBroker interface. -> Updated for Version 6 - ## Nuget
@@ -23,15 +21,16 @@ MTConnect.NET-MQTT is an extension library to MTConnect.NET that provides an MQT
-## Protocols +# Topic Structures +`Document` - Topics are the same as HTTP (Probe, Current, Sample, & Assets). Payloads are the corresponding MTConnect Response Documents. This provides a simple protocol that is performance based for applications with high frequency updates. -[Output](https://github.com/TrakHound/MTConnect.NET/tree/master/libraries/MTConnect.NET-MQTT/README.md#Output) - Protocol for reading the output of an MTConnect Agent +`Entity` - Topics are expanded where each Entity has it's own topic. This provides an easy to read interface for tools such as NodeRed, etc. -[Input](https://github.com/TrakHound/MTConnect.NET/tree/master/libraries/MTConnect.NET-MQTT/README.md#Input) - Protocol for publishing data from a Data Source to an MTConnect Agent -# Output +## Document Topic Structure +This topic structure is the official MQTT based protocol for MTConnect. -## Topic Structures +## Topics The **Document Topic Structure** uses the standard MTConnect Response documents as message payload and the standard MTConnect API endpoints as topics. @@ -57,8 +56,7 @@ Each device is sent in an MTConnectDevices Response document. The message is pub #### Payload The payload currently defaults to use the **json-cppagent** Document Format ID. -> See example MTConnectDevices Response Document Payload: (https://github.com/TrakHound/MTConnect.NET/tree/master/libraries/MTConnect.NET-JSON-cppagent/Examples/MTConnectDevicesResponseDocument.json) - +> **[Learn More](https://github.com/TrakHound/MTConnect.NET/tree/master/libraries/MTConnect.NET-JSON-cppagent/Examples/MTConnectDevicesResponseDocument.json)** : See example MTConnectDevices Response Document Payload ### Current @@ -70,7 +68,7 @@ The payload currently defaults to use the **json-cppagent** Document Format ID. #### Payload The payload currently defaults to use the **json-cppagent** Document Format ID. -> See example MTConnectDevices Response Document Payload: (https://github.com/TrakHound/MTConnect.NET/tree/master/libraries/MTConnect.NET-JSON-cppagent/Examples/MTConnectStreamsResponseDocument.json) +> **[Learn More](https://github.com/TrakHound/MTConnect.NET/tree/master/libraries/MTConnect.NET-JSON-cppagent/Examples/MTConnectStreamsResponseDocument.json)** : See example MTConnectDevices Response Document Payload ### Sample @@ -82,7 +80,7 @@ The payload currently defaults to use the **json-cppagent** Document Format ID. #### Payload The payload currently defaults to use the **json-cppagent** Document Format ID. -> See example MTConnectDevices Response Document Payload: (https://github.com/TrakHound/MTConnect.NET/tree/master/libraries/MTConnect.NET-JSON-cppagent/Examples/MTConnectStreamsResponseDocument.json) +> **[Learn More](https://github.com/TrakHound/MTConnect.NET/tree/master/libraries/MTConnect.NET-JSON-cppagent/Examples/MTConnectStreamsResponseDocument.json)** : See example MTConnectDevices Response Document Payload ### Asset ``` @@ -92,7 +90,74 @@ The payload currently defaults to use the **json-cppagent** Document Format ID. #### Payload The payload currently defaults to use the **json-cppagent** Document Format ID. -> See example MTConnectDevices Response Document Payload: (https://github.com/TrakHound/MTConnect.NET/tree/master/libraries/MTConnect.NET-JSON-cppagent/Examples/MTConnectStreamsResponseDocument.json) +> **[Learn More](https://github.com/TrakHound/MTConnect.NET/tree/master/libraries/MTConnect.NET-JSON-cppagent/Examples/MTConnectStreamsResponseDocument.json)** : See example MTConnectDevices Response Document Payload + + +## Entity Topic Structure +This topic structure is designed to supplement the Document topic structure and be used for use cases that may require a more simple protocol that requires less payload parsing or the ability to subscribe to specific DataItems. + + +### Devices +The **MTConnect/Devices** topics are used to send data that is in an MTConnectDevicesResponse document. + +``` +MTConnect/Devices/[DEVICE_UUID]/Device +``` + +### Observations +Observations may use the **MTConnectMqttFormat.Flat** or **MTConnectMqttFormat.Hierarchy** option to specify how the topics are structured. + +MTConnectMqttFormat.Flat Format: +``` +MTConnect/Devices/[DEVICE_UUID]/Observations/[DATA_ITEM_ID] +``` + +MTConnectMqttFormat.Hierarchy Format: +``` +MTConnect/Devices/[DEVICE_UUID]/Observations/[COMPONENT_TYPE]/[COMPONENT_ID]/[DATA_ITEM_CATEGORY]/[DATA_ITEM_TYPE]/[DATA_ITEM_ID] +MTConnect/Devices/[DEVICE_UUID]/Observations/[COMPONENT_TYPE]/[COMPONENT_ID]/[DATA_ITEM_CATEGORY]/[DATA_ITEM_TYPE]/SubTypes/[DATA_ITEM_SUBTYPE]/[DATA_ITEM_ID] +``` + +The "Flat" format is typically used for brokers that limit the topic depth (number of forward slash "/" characters). For example, AWS IoT Core. + +#### Device Condition Observations +Condition messages are sent as an array of Observations since a Condition may have multiple Fault States. This is similar to how the Current request functions in an HTTP Agent. + +### Device Assets +``` +MTConnect/Devices/[DEVICE_UUID]/Assets/[ASSET_TYPE]/[ASSET_ID] +``` -# Input -The input protocol is used to publish data to an MTConnect Agent using MQTT. This can be either publishing to an external MQTT broker or to the internal MQTT broker (using the MqttBroker Agent Module). +### Topics + +> [Node] = (Payload) + +``` +- MTConnect + ─ Devices + ─ [DEVICE_UUID] + - Device = (JSON) + - Observations + - [DATA_ITEM_ID] = (JSON Array) + - [DATA_ITEM_ID] = (JSON Array) + - [DATA_ITEM_ID] = (JSON Array) + - Assets + - [ASSET_TYPE] + - [ASSET_ID] = (JSON) +``` + +### Example +``` +- MTConnect + ─ Devices + ─ OKUMA.Lathe.123456 + - Device + - Observations + - L2avail = {"dataItemId":"L2avail","name":"avail","type":"AVAILABILITY","timestamp":"2023-02-07T20:02:26.8978653Z","result":"AVAILABLE"} + - L2estop = {"dataItemId":"L2estop","name":"estop","type":"EMERGENCY_STOP","timestamp":"2023-02-07T20:02:26.8978653Z","result":"ARMED"} + - L2p1execution = {"dataItemId":"L2p1execution","name":"p1execution","type":"EXECUTION","timestamp":"2023-02-07T20:02:26.7671421Z","result":"UNAVAILABLE"} + - L2p1system = [{"level":"WARNING","dataItemId":"L2p1system","name":"p1system","type":"SYSTEM","timestamp":"2023-02-07T20:30:16.8639659Z","result":"Not Found","nativeCode":"404"},{"level":"FAULT","dataItemId":"L2p1system","name":"p1system","type":"SYSTEM","timestamp":"2023-02-07T20:30:38.9662297Z","result":"Interval Error","nativeCode":"500"}] + - Assets + - CuttingTool + - 5.12 = {"assetId":"5.12","type":"CuttingTool","timestamp":"2023-02-07T13:36:04.7288143Z","deviceUuid":"OKUMA.Lathe.123456","serialNumber":"12345678946","toolId":"12","cuttingToolLifeCycle":{"cutterStatus":["AVAILABLE","NEW","MEASURED"],"location":{"type":"SPINDLE"},"programToolGroup":"5","programToolNumber":"12","measurements":[{"type":"FunctionalLength","value":7.6543,"units":"MILLIMETER","code":"LF"},{"type":"CuttingDiameterMax","value":0.375,"units":"MILLIMETER","code":"DC"}]}} +``` diff --git a/libraries/MTConnect.NET-SHDR/README-Nuget.md b/libraries/MTConnect.NET-SHDR/README-Nuget.md index edbb7fa4..d9aab268 100644 --- a/libraries/MTConnect.NET-SHDR/README-Nuget.md +++ b/libraries/MTConnect.NET-SHDR/README-Nuget.md @@ -6,20 +6,20 @@ Classes to handle the SHDR Agent Adapter Protocol associated with the MTConnect ## Overview The ShdrAdapter classes handle the TCP connection to the Agent: -- [ShdrAdapter](https://github.com/TrakHound/MTConnect.NET/blob/master/src/MTConnect.NET-SHDR/Adapters/Shdr/ShdrAdapter.cs) : Sends the most recent values On-Demand using the SendChanged() method. This is used when full control of the communication is needed. -- [ShdrIntervalAdapter](https://github.com/TrakHound/MTConnect.NET/blob/master/src/MTConnect.NET-SHDR/Adapters/Shdr/ShdrIntervalAdapter.cs) : Sends the most recent values at the specified Interval. This is used when a set interval is adequate and the most recent value is all that is needed -- [ShdrQueueAdapter](https://github.com/TrakHound/MTConnect.NET/blob/master/src/MTConnect.NET-SHDR/Adapters/Shdr/ShdrQueueAdapter.cs) : Queues all values that are sent from the PLC and sends them all on demand using the SendBuffer() method. This is used when all values are needed and full control of the communication is needed. -- [ShdrIntervalQueueAdapter](https://github.com/TrakHound/MTConnect.NET/blob/master/src/MTConnect.NET-SHDR/Adapters/Shdr/ShdrIntervalQueueAdapter.cs) : Queues all values that are sent from the PLC and sends any queued values at the specified Interval. This is used when all values are needed but an interval is adequate. +- [ShdrAdapter](https://github.com/TrakHound/MTConnect.NET/blob/master/src/MTConnect.NET-SHDR/Adapters/ShdrAdapter.cs) : Sends the most recent values On-Demand using the SendChanged() method. This is used when full control of the communication is needed. +- [ShdrIntervalAdapter](https://github.com/TrakHound/MTConnect.NET/blob/master/src/MTConnect.NET-SHDR/Adapters/ShdrIntervalAdapter.cs) : Sends the most recent values at the specified Interval. This is used when a set interval is adequate and the most recent value is all that is needed +- [ShdrQueueAdapter](https://github.com/TrakHound/MTConnect.NET/blob/master/src/MTConnect.NET-SHDR/Adapters/ShdrQueueAdapter.cs) : Queues all values that are sent from the PLC and sends them all on demand using the SendBuffer() method. This is used when all values are needed and full control of the communication is needed. +- [ShdrIntervalQueueAdapter](https://github.com/TrakHound/MTConnect.NET/blob/master/src/MTConnect.NET-SHDR/Adapters/ShdrIntervalQueueAdapter.cs) : Queues all values that are sent from the PLC and sends any queued values at the specified Interval. This is used when all values are needed but an interval is adequate. SHDR conversion is handled in each individual class: -- [ShdrDataItem](Shdr/ShdrDataItem.cs) : Handles converting Events and/or Samples with a Representation of VALUE to the appropriate SHDR format. -- [ShdrCondition](Shdr/ShdrCondition.cs) : Handles converting Conditions to the appropriate SHDR format -- [ShdrTimeSeries](Shdr/ShdrTimeSeries.cs) : Handles converting Samples with a Representation of TIME_SERIES to the appropriate SHDR format -- [ShdrDataSet](Shdr/ShdrDataSet.cs) : Handles converting Events and/or Samples with a Representation of DATA_SET to the appropriate SHDR format -- [ShdrTable](Shdr/ShdrTable.cs) : Handles converting Events and/or Samples with a Representation of TABLE to the appropriate SHDR format -- [ShdrAsset](Shdr/ShdrAsset.cs) : Handles converting Assets to the appropriate SHDR format - -The [ShdrAdapterClient](Adapters/Shdr/ShdrAdapterClient.cs) class handles the TCP connection to read from the Adapter and add data to an IMTConnectAgent class. +- [ShdrDataItem](https://github.com/TrakHound/MTConnect.NET/blob/master/src/MTConnect.NET-SHDR/Shdr/ShdrDataItem.cs) : Handles converting Events and/or Samples with a Representation of VALUE to the appropriate SHDR format. +- [ShdrCondition](https://github.com/TrakHound/MTConnect.NET/blob/master/src/MTConnect.NET-SHDR/Shdr/ShdrCondition.cs) : Handles converting Conditions to the appropriate SHDR format +- [ShdrTimeSeries](https://github.com/TrakHound/MTConnect.NET/blob/master/src/MTConnect.NET-SHDR/Shdr/ShdrTimeSeries.cs) : Handles converting Samples with a Representation of TIME_SERIES to the appropriate SHDR format +- [ShdrDataSet](https://github.com/TrakHound/MTConnect.NET/blob/master/src/MTConnect.NET-SHDR/Shdr/ShdrDataSet.cs) : Handles converting Events and/or Samples with a Representation of DATA_SET to the appropriate SHDR format +- [ShdrTable](https://github.com/TrakHound/MTConnect.NET/blob/master/src/MTConnect.NET-SHDR/Shdr/ShdrTable.cs) : Handles converting Events and/or Samples with a Representation of TABLE to the appropriate SHDR format +- [ShdrAsset](https://github.com/TrakHound/MTConnect.NET/blob/master/src/MTConnect.NET-SHDR/Shdr/ShdrAsset.cs) : Handles converting Assets to the appropriate SHDR format + +The [ShdrAdapterClient](https://github.com/TrakHound/MTConnect.NET/blob/master/src/MTConnect.NET-SHDR/Adapters/ShdrAdapterClient.cs) class handles the TCP connection to read from the Adapter and add data to an IMTConnectAgent class. ## Usage There are several different ways to setup and add data to the ShdrAdapter diff --git a/libraries/MTConnect.NET-SHDR/README.md b/libraries/MTConnect.NET-SHDR/README.md index 9b9d8541..5e253352 100644 --- a/libraries/MTConnect.NET-SHDR/README.md +++ b/libraries/MTConnect.NET-SHDR/README.md @@ -24,20 +24,20 @@ Classes to handle the SHDR Agent Adapter Protocol associated with the MTConnect ## Overview The ShdrAdapter classes handle the TCP connection to the Agent: -- [ShdrAdapter](https://github.com/TrakHound/MTConnect.NET/blob/master/src/MTConnect.NET-SHDR/Adapters/Shdr/ShdrAdapter.cs) : Sends the most recent values On-Demand using the SendChanged() method. This is used when full control of the communication is needed. -- [ShdrIntervalAdapter](https://github.com/TrakHound/MTConnect.NET/blob/master/src/MTConnect.NET-SHDR/Adapters/Shdr/ShdrIntervalAdapter.cs) : Sends the most recent values at the specified Interval. This is used when a set interval is adequate and the most recent value is all that is needed -- [ShdrQueueAdapter](https://github.com/TrakHound/MTConnect.NET/blob/master/src/MTConnect.NET-SHDR/Adapters/Shdr/ShdrQueueAdapter.cs) : Queues all values that are sent from the PLC and sends them all on demand using the SendBuffer() method. This is used when all values are needed and full control of the communication is needed. -- [ShdrIntervalQueueAdapter](https://github.com/TrakHound/MTConnect.NET/blob/master/src/MTConnect.NET-SHDR/Adapters/Shdr/ShdrIntervalQueueAdapter.cs) : Queues all values that are sent from the PLC and sends any queued values at the specified Interval. This is used when all values are needed but an interval is adequate. +- [ShdrAdapter](https://github.com/TrakHound/MTConnect.NET/blob/master/src/MTConnect.NET-SHDR/Adapters/ShdrAdapter.cs) : Sends the most recent values On-Demand using the SendChanged() method. This is used when full control of the communication is needed. +- [ShdrIntervalAdapter](https://github.com/TrakHound/MTConnect.NET/blob/master/src/MTConnect.NET-SHDR/Adapters/ShdrIntervalAdapter.cs) : Sends the most recent values at the specified Interval. This is used when a set interval is adequate and the most recent value is all that is needed +- [ShdrQueueAdapter](https://github.com/TrakHound/MTConnect.NET/blob/master/src/MTConnect.NET-SHDR/Adapters/ShdrQueueAdapter.cs) : Queues all values that are sent from the PLC and sends them all on demand using the SendBuffer() method. This is used when all values are needed and full control of the communication is needed. +- [ShdrIntervalQueueAdapter](https://github.com/TrakHound/MTConnect.NET/blob/master/src/MTConnect.NET-SHDR/Adapters/ShdrIntervalQueueAdapter.cs) : Queues all values that are sent from the PLC and sends any queued values at the specified Interval. This is used when all values are needed but an interval is adequate. SHDR conversion is handled in each individual class: -- [ShdrDataItem](Shdr/ShdrDataItem.cs) : Handles converting Events and/or Samples with a Representation of VALUE to the appropriate SHDR format. -- [ShdrCondition](Shdr/ShdrCondition.cs) : Handles converting Conditions to the appropriate SHDR format -- [ShdrTimeSeries](Shdr/ShdrTimeSeries.cs) : Handles converting Samples with a Representation of TIME_SERIES to the appropriate SHDR format -- [ShdrDataSet](Shdr/ShdrDataSet.cs) : Handles converting Events and/or Samples with a Representation of DATA_SET to the appropriate SHDR format -- [ShdrTable](Shdr/ShdrTable.cs) : Handles converting Events and/or Samples with a Representation of TABLE to the appropriate SHDR format -- [ShdrAsset](Shdr/ShdrAsset.cs) : Handles converting Assets to the appropriate SHDR format - -The [ShdrAdapterClient](Adapters/Shdr/ShdrAdapterClient.cs) class handles the TCP connection to read from the Adapter and add data to an IMTConnectAgent class. +- [ShdrDataItem](https://github.com/TrakHound/MTConnect.NET/blob/master/src/MTConnect.NET-SHDR/Shdr/ShdrDataItem.cs) : Handles converting Events and/or Samples with a Representation of VALUE to the appropriate SHDR format. +- [ShdrCondition](https://github.com/TrakHound/MTConnect.NET/blob/master/src/MTConnect.NET-SHDR/Shdr/ShdrCondition.cs) : Handles converting Conditions to the appropriate SHDR format +- [ShdrTimeSeries](https://github.com/TrakHound/MTConnect.NET/blob/master/src/MTConnect.NET-SHDR/Shdr/ShdrTimeSeries.cs) : Handles converting Samples with a Representation of TIME_SERIES to the appropriate SHDR format +- [ShdrDataSet](https://github.com/TrakHound/MTConnect.NET/blob/master/src/MTConnect.NET-SHDR/Shdr/ShdrDataSet.cs) : Handles converting Events and/or Samples with a Representation of DATA_SET to the appropriate SHDR format +- [ShdrTable](https://github.com/TrakHound/MTConnect.NET/blob/master/src/MTConnect.NET-SHDR/Shdr/ShdrTable.cs) : Handles converting Events and/or Samples with a Representation of TABLE to the appropriate SHDR format +- [ShdrAsset](https://github.com/TrakHound/MTConnect.NET/blob/master/src/MTConnect.NET-SHDR/Shdr/ShdrAsset.cs) : Handles converting Assets to the appropriate SHDR format + +The [ShdrAdapterClient](https://github.com/TrakHound/MTConnect.NET/blob/master/src/MTConnect.NET-SHDR/Adapters/ShdrAdapterClient.cs) class handles the TCP connection to read from the Adapter and add data to an IMTConnectAgent class. ## Usage There are several different ways to setup and add data to the ShdrAdapter diff --git a/libraries/MTConnect.NET/README-Nuget.md b/libraries/MTConnect.NET/README-Nuget.md index b861f427..78fe303f 100644 --- a/libraries/MTConnect.NET/README-Nuget.md +++ b/libraries/MTConnect.NET/README-Nuget.md @@ -1,5 +1,205 @@ ![MTConnect.NET Logo](https://raw.githubusercontent.com/TrakHound/MTConnect.NET/master/img/mtconnect-net-03-md.png) # MTConnect.NET -Fully featured .NET library for MTConnect Agents, Adapters, and Clients +[![MTConnect.NET](https://github.com/TrakHound/MTConnect.NET/actions/workflows/dotnet.yml/badge.svg)](https://github.com/TrakHound/MTConnect.NET/actions/workflows/dotnet.yml) + +> **New Release 5/13/2024** : Version 6.4 Released with new Agent, Adapter, & SysML Import + + +## Overview +MTConnect.NET is a fully featured and fully Open Source **[.NET](https://dotnet.microsoft.com/)** library for **[MTConnect](https://www.mtconnect.org/)** to develop Agents, Adapters, and Clients. Supports MTConnect Versions up to 2.3. A pre-compiled Agent application is available to download as well as an Adapter application that can be easily customized. + +- .NET Native MTConnect Agent +- Adapter framework used to send data to an MTConnect Agent +- Libraries to easily implement MTConnect Agent, Adapters, or Clients into custom applications + +### Features +- Module based Agent & Adapter architecture + - Supports running as Windows Service with easy to use command line arguments + - Presistent Agent Buffers that are backed up on the File System. Retains state after Agent is restarted +- Fully compatible up to the latest MTConnect v2.3 + - Kept up to date by utilizing the MTConnect SysML Model to generate source files + - Supports multiple MTConnect Version output. Automatically removes data that is not compatible with the requested version +- Full client support for requesting data from any MTConnect Agent (Probe, Current, Sample Stream, Assets, etc.). + - Supports HTTP, MQTT, and SHDR + - Supports compression (polling & streaming) + - Supports XML & JSON + - Supports HTTPS & TLS for secure communication +- Python Input Processors to transform data before loading into Agent +- Full data validation + - Validation on Input + - XML Schema Validation on output + - Configurable Validation Levels +- Fully documented objects using text from the MTConnect Standard. This enables Intellisense in applications such as Visual Studio. +- Fully supports Unit conversion. Default Units and UnitConversion is done automatically when sending Streams and when reading Streams. + +### Integrate +- Easily integrate with cloud services such as AWS and Azure +- Use client libraries to export MTConnect data to a Database (ex. SQL, Redis, MongoDB, etc.) +- Create custom dashboards and data collection applications to utilize equipment data +- Embed an MTConnect Agent into your adapter (remove need for separate SHDR Adapter) + +#### MTConnect Version Compatibility +MTConnect.NET is designed to be fully compatible for all versions of the MTConnect standard. This is done through processing by the [MTConnectAgent](https://github.com/TrakHound/MTConnect.NET/tree/master/libraries/MTConnect.NET-Common/Agents/MTConnectAgent.cs) class before data is output. This allows the version to be a parameter when requesting data from the Agent. More information can be found in the [Devices README](https://github.com/TrakHound/MTConnect.NET/tree/master/libraries/MTConnect.NET-Common/Devices/README.md). + +#### Data Validation +Validation is performed on a Device, Component, Composition, or DataItem level through the classes in [Devices](https://github.com/TrakHound/MTConnect.NET/tree/master/libraries/MTConnect.NET-Common/Devices). This allows for validation without the need to use XML schemas (although XML Validation against XSD schemas is supported). + +## Clients + +#### Client Interfaces +- [IMTConnectClient](https://github.com/TrakHound/MTConnect.NET/blob/master/libraries/MTConnect.NET-Common/Clients/IMTConnectClient.cs) : Interface used to read MTConnect response documents (Probe, Current, Sample, and Assets) +- [IMTConnectEntityClient](https://github.com/TrakHound/MTConnect.NET/blob/master/libraries/MTConnect.NET-Common/Clients/IMTConnectEntityClient.cs) : Interface used to read MTConnect entities (Device, Observation, Asset) + +#### Client Classes +- [MTConnectHttpClient](https://github.com/TrakHound/MTConnect.NET/blob/master/libraries/MTConnect.NET-HTTP/Clients/MTConnectHttpClient.cs) : Reads from MTConnect Agents using the MTConnect HTTP REST Api. Supports both polling and streaming. Supports compression. Supports XML & JSON. +- [MTConnectMqttClient](https://github.com/TrakHound/MTConnect.NET/blob/master/libraries/MTConnect.NET-MQTT/Clients/MTConnectMqttClient.cs) : Reads MTConnect data from an MQTT Broker. Supports the latest MTConnect MQTT Protocol. + +## Agents + +#### Embedded Agent Application +An MTConnect Agent can be embedded into an application where the DataSource(s) can be read and the MTConnect Agent can be combined into the same application. This eliminates the need to transfer data from an Adapter to an Agent (typically using the SHDR protocol). + +##### Option #1 : [DotNet Template](https://github.com/TrakHound/MTConnect.NET/tree/master/templates/mtconnect.net-agent) +``` +dotnet new mtconnect.net-agent +``` + +##### Option #2 : [Nuget Package](https://www.nuget.org/packages/MTConnect.NET-Applications-Agents) +``` +dotnet add package MTConnect.NET-Applications-Agents +``` + +#### Standalone Agent Application +A standalone preconfigured [Application](https://github.com/TrakHound/MTConnect.NET/tree/master/agent/MTConnect.NET-Agent) ready to download is available and supports: +- Modular architecture + - HTTP Server Module + - SHDR Adapter Module + - MQTT Broker Module + - MQTT Relay Module + - etc. +- Easy Windows Installer +- Linux Compatible +- Run as a Windows Service +- Transform input data using Python scripts +- Extensible configuration file and monitors for changes + +#### Agent Classes +- [MTConnectAgent](https://github.com/TrakHound/MTConnect.NET/blob/master/libraries/MTConnect.NET-Common/Agents/MTConnectAgent.cs) : Handles MTConnect Entities (Device, Observation, Asset), Unit Conversion, Filtering, etc. +- [MTConnectAgentBroker](https://github.com/TrakHound/MTConnect.NET/blob/master/libraries/MTConnect.NET-Common/Agents/MTConnectAgent.cs) : Handles MTConnect Requests to respond with Response Documents (Probe, Current, Sample, Assets) specified in the MTConnect Standard, Buffers, etc. + +## Adapters + +#### Standalone Modular Adapter Application +A preconfigured [Application](https://github.com/TrakHound/MTConnect.NET/tree/master/adapter/MTConnect.NET-Adapter) & [Library](https://github.com/TrakHound/MTConnect.NET/tree/master/adapter/MTConnect.NET-Applications-Adapter) to build an Adapter is available and supports: +- Modular architecture + - SHDR Module (export data to an MTConnect Agent using the SHDR protocol) + - MQTT Module (export data to an MQTT Broker to be read by an MTConnect Agent) +- Run as a Windows Service +- Extensible configuration file and monitors for changes +- Customizable Data Source engine (to read from a PLC) +- Updated through a Nuget package (no source code copy & paste required when updating to new versions) + +#### SHDR Adapter Classes +- [ShdrAdapter](https://github.com/TrakHound/MTConnect.NET/blob/master/src/MTConnect.NET-SHDR/Adapters/ShdrAdapter.cs) : Sends the most recent values On-Demand using the SendCurrent() method. This is used when full control of the communication is needed. +- [ShdrIntervalAdapter](https://github.com/TrakHound/MTConnect.NET/blob/master/src/MTConnect.NET-SHDR/Adapters/ShdrIntervalAdapter.cs) : Sends the most recent values at the specified Interval. This is used when a set interval is adequate and the most recent value is all that is needed +- [ShdrQueueAdapter](https://github.com/TrakHound/MTConnect.NET/blob/master/src/MTConnect.NET-SHDR/Adapters/ShdrQueueAdapter.cs) : Queues all values that are sent from the PLC and sends them all on demand using the SendBuffer() method. This is used when all values are needed and full control of the communication is needed. +- [ShdrIntervalQueueAdapter](https://github.com/TrakHound/MTConnect.NET/blob/master/src/MTConnect.NET-SHDR/Adapters/ShdrIntervalQueueAdapter.cs) : Queues all values that are sent from the PLC and sends any queued values at the specified Interval. This is used when all values are needed but an interval is adequate. + +## Nuget Packages +The Nuget packages for the libraries in this repo are listed below: + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameDownloadsLink
MTConnect.NEThttps://www.nuget.org/packages/MTConnect.NET
MTConnect.NET-Commonhttps://www.nuget.org/packages/MTConnect.NET-Common
MTConnect.NET-HTTPhttps://www.nuget.org/packages/MTConnect.NET-HTTP
MTConnect.NET-SHDRhttps://www.nuget.org/packages/MTConnect.NET-SHDR
MTConnect.NET-MQTThttps://www.nuget.org/packages/MTConnect.NET-MQTT
MTConnect.NET-XMLhttps://www.nuget.org/packages/MTConnect.NET-XML
MTConnect.NET-JSONhttps://www.nuget.org/packages/MTConnect.NET-JSON
MTConnect.NET-JSON-cppagenthttps://www.nuget.org/packages/MTConnect.NET-JSON-cppagent
MTConnect.NET-TLShttps://www.nuget.org/packages/MTConnect.NET-TLS
MTConnect.NET-Serviceshttps://www.nuget.org/packages/MTConnect.NET-Services
MTConnect.NET-DeviceFinderhttps://www.nuget.org/packages/MTConnect.NET-DeviceFinder
MTConnect.NET-SysMLhttps://www.nuget.org/packages/MTConnect.NET-SysML
+ +## Supported Frameworks +- .NET 8.0 +- .NET 7.0 +- .NET 6.0 +- .NET 5.0 +- .NET Core 3.1 +- .NET Standard 2.0 +- .NET Framework 4.8 +- .NET Framework 4.7.2 +- .NET Framework 4.7.1 +- .NET Framework 4.7 +- .NET Framework 4.6.2 +- .NET Framework 4.6.1 + +## Developer Notes +This repo along with the libraries and applications are free to use and distribute and hopefully will help those that are looking at either getting started using MTConnect or those that are looking to use MTConnect for both basic and more advanced use cases. + +Feel free to comment, or create pull-requests for anything that could be coded, formatted, or worded better. Attention to detail and continuous improvement are important in manufacturing so they should be just as important for manufacturing software. + +Thanks for your interest in using these libraries and applications and feel free to contribute or give feedback. + +\- Patrick diff --git a/templates/mtconnect.net-agent/content/MTConnect.NET-Embedded-Agent/NLog.config b/templates/mtconnect.net-agent/content/MTConnect.NET-Embedded-Agent/NLog.config index 2cfe9cfa..19ed00c0 100644 --- a/templates/mtconnect.net-agent/content/MTConnect.NET-Embedded-Agent/NLog.config +++ b/templates/mtconnect.net-agent/content/MTConnect.NET-Embedded-Agent/NLog.config @@ -8,23 +8,23 @@ - - - - -