MTConnect.NET
4.5.0
See the version list below for details.
dotnet add package MTConnect.NET --version 4.5.0
NuGet\Install-Package MTConnect.NET -Version 4.5.0
<PackageReference Include="MTConnect.NET" Version="4.5.0" />
paket add MTConnect.NET --version 4.5.0
#r "nuget: MTConnect.NET, 4.5.0"
// Install MTConnect.NET as a Cake Addin #addin nuget:?package=MTConnect.NET&version=4.5.0 // Install MTConnect.NET as a Cake Tool #tool nuget:?package=MTConnect.NET&version=4.5.0
MTConnect.NET
10/18/2022 Updated to add new MQTT Agents
Overview
MTConnect.NET is a fully featured .NET library for MTConnect to develop Agents, Adapters, and Clients. Supports MTConnect Versions up to 2.0.
The Agent, Buffers, and Adapter are separated into individual classes in order to allow for modular implementations such as the following :
- A traditional Agent that uses a REST Api, in-memory buffer, and Adapters that communicate using the SHDR protocol
- An agent imbedded with the Adapter (which elminates the need for the Adapter TCP communication)
- Supports SHDR Apdaters
- Supports HTTP and MQTT
- Integration with cloud services such as AWS and Azure
Other features of MTConnect.NET :
- Extensible through plugin libraries to extend Types
- Presistent Buffers that are backed up on the File System. Retains state after Agent is restarted
- Supports multiple MTConnect Version output. Automatically removes data that is not compatible with the requested version
- Supports running as Windows Service with easy to use command line arguments
- 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.
- Full list of Device, Component, Composition, and DataItem types. See Devices for more information.
- Full list of Asset types. See Devices for more information.
- Fully supports Unit conversion. Default Units and UnitConversion is done automatically when sending Streams and when reading Streams.
- Full client support for requesting data from any MTConnect Agent (Probe, Current, Sample Stream, Assets, etc.). See Clients for more information.
- (In-Progress) Models framework for setting and accessing data using an object model as opposed to DataItem ID's and Types
Agent Applications
Recommended (Windows / Linux)
MTConnect HTTP Agent : MTConnect Agent application is fully compatible with the latest Version 2.0 of the MTConnect Standard. It uses the SHDR protocol to receive data from Adapters, an in-memory buffer with an optional durable file system based buffer, and an Http REST interface for retrieving data.
MTConnect HTTP Gateway Agent : MTConnect Agent application is fully compatible with the latest Version 2.0 of the MTConnect Standard. It receives data from other MTConnect Agents using HTTP, an in-memory buffer with an optional durable file system based buffer, and an Http REST interface for retrieving data.
MTConnect MQTT Relay Agent : This MTConnect Agent application is fully compatible with the latest Version 2.0 of the MTConnect Standard. It uses the SHDR protocol to receive data from Adapters, an in-memory buffer with an optional durable file system based buffer, and an MQTT client to publish messages to an external MQTT Broker.
MTConnect MQTT Broker Agent : This MTConnect Agent application is fully compatible with the latest Version 2.0 of the MTConnect Standard. It uses the SHDR protocol to receive data from Adapters, an in-memory buffer with an optional durable file system based buffer, and a built-in MQTT broker.
Specialized (IIS)
MTConnect HTTP Agent - AspNetCore : Similar to the MTConnect Agent application but uses either the built-in Kestrel server or can be setup through IIS (Internet Information Services). This allows the agent to be used with all of the features available through ASP.NET and IIS such as security, permissions, monitoring, etc.
MTConnect HTTP Gateway Agent - AspNetCore : An Agent that runs mulitple MTConnectClients on the backend and passes that data to an MTConnectAgent. This can be used to access MTConnect data on a central server. Uses either the built-in Kestrel server or can be setup through IIS (Internet Information Services). This allows the agent to be used with all of the features available through ASP.NET and IIS such as security, permissions, monitoring, etc.
In Progress
- MTConnect MQTT Gateway Agent : (In-Progress) An MTConnect Gateway Agent with an MQTT broker built-in.
Live Demo
A live demo of the MTConnect Gateway HTTP Agent (AspNetCore) application is running at https://mtconnect.trakhound.com.
- https://mtconnect.trakhound.com/current
- https://mtconnect.trakhound.com/sample
- https://mtconnect.trakhound.com/assets
Docker
Docker images are located at :
- MTConnect HTTP Agent : https://hub.docker.com/r/trakhound/mtconnect-agent-http
Nuget Packages
The Nuget packages for the libraries in this repo are listed below:
- MTConnect.NET
- MTConnect.NET-Common
- MTConnect.NET-HTTP
- MTConnect.NET-HTTP-AspNetCore
- MTConnect.NET-XML
- MTConnect.NET-JSON
- MTConnect.NET-SHDR
- MTConnect.NET-MQTT
- MTConnect.NET-Applications-Agents
- MTConnect.NET-Applications-Agents-MQTT
Supported Frameworks
.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
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 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.
Data Validation
Validation is performed on a Device, Component, Composition, or DataItem level through the classes in Devices. This allows for validation without the need to use XML schemas (although XML Validation against XSD schemas is supported).
Releases
Releases are available at : Releases
Agents
Agents are implemented using the MTConnectAgent class and IMTConnectAgent interface. The MTConnectAgent class implements the MTConnect standard and is inteded to be full implemenation. More information about agents can be found at Agents and Agent Applications can be found at Agent Applications.
SHDR > HTTP Implementation
A SHDR to HTTP implementation is the traditional MTConnect Agent configuration. The agent reads from one or more Adapter applications that implement the SHDR Protocol. Data is then read from the Agent using the HTTP REST protocol. The agent and adapter(s) are typically separate applications. The agent and adapter(s) can still be run on the same PC (or HMI) but there is still TCP communication between them.
HTTP > HTTP Implementation
An HTTP to HTTP implementation reads from other MTConnect Agents and forwards that data to a central MTConnect Agent. This implementation can be used to create a "Gateway" that multiple other MTConnect Agents can be forwarded to. This can be used to provide a single access point, implement stricter security policies, or upgrade an older agent without effecting other applications that may already be using the older version.
SHDR > MQTT Implementation
A SHDR to MQTT implementation uses MQTT to send and receive messages. The agent reads from one or more Adapter applications that implement the SHDR Protocol. Data is then read from the Agent using the MQTT protocol. The agent and adapter(s) are typically separate applications. The agent and adapter(s) can still be run on the same PC (or HMI) but there is still TCP communication between them.
Embedded Implementation
An embedded implementation uses the MTConnect.NET library to implement an MTConnect Agent in the same application that is reading from the machine PLC. This creates a simple and compact solution that can be deployed as a single application/product. When compared to a SHDR to HTTP implementation, this eliminates the need to use the SHDR protocol as well as eliminates the TCP communication between the Adapter and the Agent. Implementation is simplified using the MTConnect.NET-Applications-Agents Library that can be as simple as a few lines of code and can be kept up to date using Nuget.
Adapters
SHDR Adapter
Adapters are used to convert data read from a machine or PLC to the SHDR Protocol that can then be sent over TCP to an MTConnect Agent. There are several adapter types available in the MTConnect.NET-SHDR library that are listed below:
- ShdrAdapter : Sends the most recent values On-Demand using the SendCurrent() method. This is used when full control of the communication is needed.
- ShdrIntervalAdapter : 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 : 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 : 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.
Developer Notes
This repo along with the libraries and applications are free to use and hopefully will help those that are looking at either getting started using MTConnect or those that are looking to use MTConnect for more advanced use cases. The Models framework will hopefully make using MTConnect much easier and straight forward and promote better usage of the standard's lesser used features.
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.
One of this project's goals is to expand the use cases for MTConnect and by breaking apart the functionalities of the agent, hopefully that will allow others to be creative in how to use the MTConnect standard.
Hopefully this repo will serve as a "one stop shop" for .NET developers looking to use MTConnect. If anyone is interested in developing a similar repo for another framework or language, feel free to use this as a guide as I imagine some of the classes (which is the most tedious part of the code) could be converted to other languages fairly easily.
This MTConnect.NET update is Part 1 of The TrakHound Project which is a project to provide open source code as well as products for each part of a full IIOT implementation. Please show support for our project at www.TrakHound.com.
Thanks for your interest in using these libraries and applications and feel free to contribute or give feedback.
- Patrick
Product | Versions Compatible and additional computed target framework versions. |
---|---|
.NET | net5.0 is compatible. net5.0-windows was computed. net6.0 is compatible. net6.0-android was computed. net6.0-ios was computed. net6.0-maccatalyst was computed. net6.0-macos was computed. net6.0-tvos was computed. net6.0-windows was computed. net7.0 was computed. net7.0-android was computed. net7.0-ios was computed. net7.0-maccatalyst was computed. net7.0-macos was computed. net7.0-tvos was computed. net7.0-windows was computed. net8.0 was computed. net8.0-android was computed. net8.0-browser was computed. net8.0-ios was computed. net8.0-maccatalyst was computed. net8.0-macos was computed. net8.0-tvos was computed. net8.0-windows was computed. |
.NET Core | netcoreapp2.0 was computed. netcoreapp2.1 was computed. netcoreapp2.2 was computed. netcoreapp3.0 was computed. netcoreapp3.1 is compatible. |
.NET Standard | netstandard2.0 is compatible. netstandard2.1 was computed. |
.NET Framework | net461 is compatible. net462 is compatible. net463 was computed. net47 is compatible. net471 is compatible. net472 is compatible. net48 is compatible. net481 was computed. |
MonoAndroid | monoandroid was computed. |
MonoMac | monomac was computed. |
MonoTouch | monotouch was computed. |
Tizen | tizen40 was computed. tizen60 was computed. |
Xamarin.iOS | xamarinios was computed. |
Xamarin.Mac | xamarinmac was computed. |
Xamarin.TVOS | xamarintvos was computed. |
Xamarin.WatchOS | xamarinwatchos was computed. |
-
.NETCoreApp 3.1
- MTConnect.NET-Common (>= 4.5.0)
- MTConnect.NET-HTTP (>= 4.5.0)
- MTConnect.NET-JSON (>= 4.5.0)
- MTConnect.NET-Services (>= 4.5.0)
- MTConnect.NET-SHDR (>= 4.5.0)
- MTConnect.NET-XML (>= 4.5.0)
-
.NETFramework 4.6.1
- MTConnect.NET-Common (>= 4.5.0)
- MTConnect.NET-HTTP (>= 4.5.0)
- MTConnect.NET-JSON (>= 4.5.0)
- MTConnect.NET-Services (>= 4.5.0)
- MTConnect.NET-SHDR (>= 4.5.0)
- MTConnect.NET-XML (>= 4.5.0)
-
.NETFramework 4.6.2
- MTConnect.NET-Common (>= 4.5.0)
- MTConnect.NET-HTTP (>= 4.5.0)
- MTConnect.NET-JSON (>= 4.5.0)
- MTConnect.NET-Services (>= 4.5.0)
- MTConnect.NET-SHDR (>= 4.5.0)
- MTConnect.NET-XML (>= 4.5.0)
-
.NETFramework 4.7
- MTConnect.NET-Common (>= 4.5.0)
- MTConnect.NET-HTTP (>= 4.5.0)
- MTConnect.NET-JSON (>= 4.5.0)
- MTConnect.NET-Services (>= 4.5.0)
- MTConnect.NET-SHDR (>= 4.5.0)
- MTConnect.NET-XML (>= 4.5.0)
-
.NETFramework 4.7.1
- MTConnect.NET-Common (>= 4.5.0)
- MTConnect.NET-HTTP (>= 4.5.0)
- MTConnect.NET-JSON (>= 4.5.0)
- MTConnect.NET-Services (>= 4.5.0)
- MTConnect.NET-SHDR (>= 4.5.0)
- MTConnect.NET-XML (>= 4.5.0)
-
.NETFramework 4.7.2
- MTConnect.NET-Common (>= 4.5.0)
- MTConnect.NET-HTTP (>= 4.5.0)
- MTConnect.NET-JSON (>= 4.5.0)
- MTConnect.NET-Services (>= 4.5.0)
- MTConnect.NET-SHDR (>= 4.5.0)
- MTConnect.NET-XML (>= 4.5.0)
-
.NETFramework 4.8
- MTConnect.NET-Common (>= 4.5.0)
- MTConnect.NET-HTTP (>= 4.5.0)
- MTConnect.NET-JSON (>= 4.5.0)
- MTConnect.NET-Services (>= 4.5.0)
- MTConnect.NET-SHDR (>= 4.5.0)
- MTConnect.NET-XML (>= 4.5.0)
-
.NETStandard 2.0
- MTConnect.NET-Common (>= 4.5.0)
- MTConnect.NET-HTTP (>= 4.5.0)
- MTConnect.NET-JSON (>= 4.5.0)
- MTConnect.NET-Services (>= 4.5.0)
- MTConnect.NET-SHDR (>= 4.5.0)
- MTConnect.NET-XML (>= 4.5.0)
-
net5.0
- MTConnect.NET-Common (>= 4.5.0)
- MTConnect.NET-HTTP (>= 4.5.0)
- MTConnect.NET-JSON (>= 4.5.0)
- MTConnect.NET-Services (>= 4.5.0)
- MTConnect.NET-SHDR (>= 4.5.0)
- MTConnect.NET-XML (>= 4.5.0)
-
net6.0
- MTConnect.NET-Common (>= 4.5.0)
- MTConnect.NET-HTTP (>= 4.5.0)
- MTConnect.NET-JSON (>= 4.5.0)
- MTConnect.NET-Services (>= 4.5.0)
- MTConnect.NET-SHDR (>= 4.5.0)
- MTConnect.NET-XML (>= 4.5.0)
NuGet packages
This package is not used by any NuGet packages.
GitHub repositories (1)
Showing the top 1 popular GitHub repositories that depend on MTConnect.NET:
Repository | Stars |
---|---|
IOT-CS/IOTCS
工业智能网关,基于.net core3.1的跨平台物联网网关。支持不同设备驱动(PLC、CNC、数据库、串口设备、上位机、OPC UA、MQTT)具备二次开发驱动的能力实现与Thingsboard进行数据通讯。同时支持多资源配置化管理,MQTT、MYSQL、WEBHOOK等多种类型,实现数据的快速推送,提供简单的驱动开发接口。
|
Version | Downloads | Last updated |
---|---|---|
6.5.0 | 255 | 10/21/2024 |
6.4.7 | 646 | 8/21/2024 |
6.4.6 | 327 | 8/7/2024 |
6.4.5 | 71 | 8/2/2024 |
6.4.4 | 278 | 7/16/2024 |
6.4.3 | 242 | 6/14/2024 |
6.4.2 | 103 | 6/12/2024 |
6.4.1 | 303 | 5/17/2024 |
6.4.0 | 107 | 5/14/2024 |
6.3.2-beta | 91 | 5/2/2024 |
6.3.1-beta | 103 | 4/24/2024 |
6.3.0-beta | 103 | 4/17/2024 |
6.2.2-beta | 108 | 4/5/2024 |
6.2.1-beta | 113 | 4/3/2024 |
6.2.0-beta | 119 | 3/27/2024 |
6.1.3-beta | 131 | 3/15/2024 |
6.1.2-beta | 132 | 3/15/2024 |
6.0.11-beta | 340 | 2/2/2024 |
6.0.10-beta | 271 | 1/26/2024 |
6.0.9-beta | 369 | 12/28/2023 |
6.0.8-beta | 349 | 12/27/2023 |
6.0.7-beta | 374 | 12/19/2023 |
6.0.5-beta | 411 | 12/14/2023 |
6.0.3-beta | 382 | 12/12/2023 |
6.0.1-beta | 426 | 12/7/2023 |
5.4.4 | 3,373 | 6/6/2023 |
5.4.3 | 2,343 | 5/20/2023 |
5.4.1 | 1,147 | 3/28/2023 |
5.4.0 | 1,229 | 3/20/2023 |
5.3.0 | 864 | 3/14/2023 |
5.2.0 | 982 | 3/5/2023 |
5.1.0 | 1,031 | 3/3/2023 |
5.0.0 | 3,121 | 2/3/2023 |
4.6.0 | 1,164 | 11/28/2022 |
4.5.0 | 1,375 | 10/18/2022 |
4.4.0 | 1,332 | 10/5/2022 |
4.3.0 | 1,359 | 9/20/2022 |
4.2.0 | 1,208 | 9/13/2022 |
4.1.0 | 1,254 | 8/30/2022 |
4.0.0 | 1,228 | 8/26/2022 |
3.4.2 | 1,788 | 6/20/2022 |
3.4.1 | 1,100 | 6/17/2022 |
3.4.0 | 961 | 6/16/2022 |
3.3.1 | 1,415 | 4/27/2022 |
3.3.0 | 1,025 | 4/13/2022 |
3.2.0 | 1,133 | 3/29/2022 |
3.0.1 | 1,081 | 2/1/2022 |
3.0.0 | 1,364 | 1/31/2022 |
2.9.1.28314 | 3,417 | 1/29/2020 |
2.8.1.29291 | 2,346 | 4/23/2018 |
2.7.0.28439 | 1,793 | 10/19/2017 |
2.6.1.25011 | 2,130 | 8/8/2017 |
2.6.0.2197 | 1,798 | 4/1/2017 |
2.5.0.22963 | 2,376 | 3/15/2017 |
2.4.1.8078 | 1,639 | 3/2/2017 |
2.4.0.35373 | 1,916 | 2/13/2017 |
2.2.0.8480 | 1,538 | 2/1/2017 |
2.1.0.15682 | 2,581 | 1/11/2017 |
2.0.2.11350 | 1,774 | 1/1/2017 |
2.0.1.7322 | 2,467 | 12/20/2016 |
2.0.0.2922 | 1,680 | 12/16/2016 |
1.0.0 | 2,441 | 5/25/2016 |
1.0.0-CI00000 | 1,341 | 5/25/2016 |