Skip to content

Commit

Permalink
Updated ReadMe files for v6.4.0
Browse files Browse the repository at this point in the history
  • Loading branch information
PatrickRitchie committed May 14, 2024
1 parent dd1f148 commit c75223e
Show file tree
Hide file tree
Showing 44 changed files with 843 additions and 488 deletions.
42 changes: 18 additions & 24 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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
<table>
Expand Down Expand Up @@ -39,7 +39,7 @@
</table>

## 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
Expand Down Expand Up @@ -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
Expand All @@ -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)
Expand All @@ -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:
Expand Down
4 changes: 2 additions & 2 deletions adapter/MTConnect.NET-Applications-Adapter/NLog.config
Original file line number Diff line number Diff line change
Expand Up @@ -8,15 +8,15 @@
<target name="logconsole" xsi:type="Console" />

<!--Application Log File-->
<target xsi:type="File" name="application-file" fileName="logs\application-${shortdate}.log"
<target xsi:type="File" name="application-file" fileName="logs\application-${shortdate}.log" maxArchiveFiles="90" archiveEvery="Day"
layout="${longdate}|${event-properties:item=EventId_Id:whenEmpty=0}|${uppercase:${level}}|${logger}|${message} ${exception:format=tostring}" />

<!--Adapter Log File-->
<!--<target xsi:type="File" name="adapter-file" fileName="logs\adapter-${shortdate}.log"
layout="${longdate}|${event-properties:item=EventId_Id:whenEmpty=0}|${uppercase:${level}}|${logger}|${message} ${exception:format=tostring}" />-->

<!--Module Log File-->
<target xsi:type="File" name="module-file" fileName="logs\${logger}-${shortdate}.log"
<target xsi:type="File" name="module-file" fileName="logs\${logger}-${shortdate}.log" maxArchiveFiles="90" archiveEvery="Day"
layout="${longdate}|${event-properties:item=EventId_Id:whenEmpty=0}|${uppercase:${level}}|${logger}|${message} ${exception:format=tostring}" />

</targets>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
2 changes: 1 addition & 1 deletion adapter/Modules/MTConnect.NET-AdapterModule-MQTT/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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
<table>
Expand Down
10 changes: 5 additions & 5 deletions agent/MTConnect.NET-Agent/NLog.config
Original file line number Diff line number Diff line change
Expand Up @@ -8,23 +8,23 @@
<target name="logconsole" xsi:type="Console" />

<!--Application Log File-->
<target xsi:type="File" name="application-file" fileName="logs\application-${shortdate}.log"
<target xsi:type="File" name="application-file" fileName="logs\application-${shortdate}.log" maxArchiveFiles="90" archiveEvery="Day"
layout="${longdate}|${event-properties:item=EventId_Id:whenEmpty=0}|${uppercase:${level}}|${logger}|${message} ${exception:format=tostring}" />

<!--Agent Log File-->
<target xsi:type="File" name="agent-file" fileName="logs\agent-${shortdate}.log"
<target xsi:type="File" name="agent-file" fileName="logs\agent-${shortdate}.log" maxArchiveFiles="90" archiveEvery="Day"
layout="${longdate}|${event-properties:item=EventId_Id:whenEmpty=0}|${uppercase:${level}}|${logger}|${message} ${exception:format=tostring}" />

<!--Agent Validation Log File-->
<target xsi:type="File" name="agent-validation-file" fileName="logs\agent-validation-${shortdate}.log"
<target xsi:type="File" name="agent-validation-file" fileName="logs\agent-validation-${shortdate}.log" maxArchiveFiles="90" archiveEvery="Day"
layout="${longdate}|${event-properties:item=EventId_Id:whenEmpty=0}|${uppercase:${level}}|${logger}|${message} ${exception:format=tostring}" />

<!--Module Log File-->
<target xsi:type="File" name="module-file" fileName="logs\${logger}-${shortdate}.log"
<target xsi:type="File" name="module-file" fileName="logs\${logger}-${shortdate}.log" maxArchiveFiles="90" archiveEvery="Day"
layout="${longdate}|${event-properties:item=EventId_Id:whenEmpty=0}|${uppercase:${level}}|${logger}|${message} ${exception:format=tostring}" />

<!--Processor Log File-->
<target xsi:type="File" name="processor-file" fileName="logs\${logger}-${shortdate}.log"
<target xsi:type="File" name="processor-file" fileName="logs\${logger}-${shortdate}.log" maxArchiveFiles="90" archiveEvery="Day"
layout="${longdate}|${event-properties:item=EventId_Id:whenEmpty=0}|${uppercase:${level}}|${logger}|${message} ${exception:format=tostring}" />

</targets>
Expand Down
2 changes: 1 addition & 1 deletion agent/MTConnect.NET-Agent/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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 |
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -78,23 +78,4 @@
<Compile Update="Service.cs" />
</ItemGroup>

<ItemGroup>
<Content Include="agent.config.default.yaml">
<CopyToOutputDirectory>Always</CopyToOutputDirectory>
<CopyToOutput>true</CopyToOutput>
<IncludeInPackage>true</IncludeInPackage>
<Pack>True</Pack>
<PackagePath>contentFiles\any\any;content</PackagePath>
<PackageCopyToOutput>true</PackageCopyToOutput>
</Content>
<Content Include="NLog.default.config">
<CopyToOutputDirectory>Always</CopyToOutputDirectory>
<CopyToOutput>true</CopyToOutput>
<IncludeInPackage>true</IncludeInPackage>
<Pack>True</Pack>
<PackagePath>contentFiles\any\any;content</PackagePath>
<PackageCopyToOutput>true</PackageCopyToOutput>
</Content>
</ItemGroup>

</Project>
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
27 changes: 22 additions & 5 deletions agent/Modules/MTConnect.NET-AgentModule-HttpAdapter/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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)
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
using Ceen;
using MTConnect.Agents;
using MTConnect.Configurations;
using MTConnect.Http;
using MTConnect.Logging;
using MTConnect.Servers.Http;
using System;
Expand Down
Loading

0 comments on commit c75223e

Please sign in to comment.