Skip to content

Commit

Permalink
Added ReadMe files
Browse files Browse the repository at this point in the history
  • Loading branch information
PatrickRitchie committed Nov 29, 2023
1 parent 2b8107d commit 969dedd
Show file tree
Hide file tree
Showing 10 changed files with 280 additions and 79 deletions.
131 changes: 52 additions & 79 deletions agent/MTConnect-Agent/README.md
Original file line number Diff line number Diff line change
@@ -1,19 +1,20 @@
![MTConnect.NET Logo](https://raw.githubusercontent.com/TrakHound/MTConnect.NET/dev/img/mtconnect-net-03-md.png)

# MTConnect Http Agent
# MTConnect Agent

[![MTConnect.NET](https://github.com/TrakHound/MTConnect.NET/actions/workflows/dotnet.yml/badge.svg)](https://github.com/TrakHound/MTConnect.NET/actions/workflows/dotnet.yml)

## Overview
This project is a full implementation of an MTConnect Agent used to read data from industrial machine tools and devices. This MTConnect Agent application is fully compatible with the latest **Version 2.2 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.
This project is a full implementation of an MTConnect Agent used to read data from industrial machine tools and devices. This MTConnect Agent application is fully compatible with the latest **Version 2.2 of the MTConnect Standard**.

#### Features
- Easy setup with Windows Installers availble in the latest [Releases](https://github.com/TrakHound/MTConnect.NET/releases)
- Plugin architecture to support Http Server, Mqtt Server, SHDR Adapters, etc.
- Processors for transforming input data using simple Python scripts
- Easy setup with Windows Installers
- Options to run as Windows Service or as a console application (typically for testing/debugging)
- Optional 'Durable' buffer used to retain the Agent data between application/machine restarts
- High performance / Low resource usage
- Flexible Device configurations (traditional 'devices.xml' file or 'devices' directory with individual Device files)
- SHDR protocol compatibility for easy implementation with existing MTConnect Adapters
- On-Demand MTConnect Versioning allowing for older clients to request the version of MTConnect they are compatible with using HTTP Url parameters
- 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
Expand Down Expand Up @@ -129,24 +130,53 @@ More information about [Configurations](https://github.com/TrakHound/MTConnect.N
# - Device Configuration -
devices: devices

# - SHDR Adapter Configuration -
# The Agent is able to receive data through a TCP port using the SHDR protocol
adapters:
- hostname: localhost
port: 7878
reconnectInterval: 1000
# - Modules -
- modules:

# - Add HTTP Server module
- http-server:
hostname: localhost
port: 7878
allowPut: true
indentOutput: true
documentFormat: xml
responseCompression:
- gzip
- br
files:
- path: schemas
location: schemas
- path: styles
location: styles
- path: styles/favicon.ico
location: favicon.ico

# - Add MQTT Relay module
- mqtt2-relay:
server: localhost
port: 1883
currentInterval: 5000
sampleInterval: 500

# - Add SHDR Adapter module for Device = M12346 and Port = 7878
- shdr-adapter:
deviceKey: M12346
hostname: localhost
port: 7878

# - Add SHDR Adapter module for Device = OKUMA-Lathe and Port = 7879
- shdr-adapter:
deviceKey: OKUMA-Lathe
hostname: localhost
port: 7879

# - Add MQTT Adapter module for Device = M12346 and Topic = cnc-01
- mqtt-adapter:
deviceKey: M12346
server: localhost
port: 1883
topic: cnc-01

# The server Hostname to bind to.
# Change this to the server's IP Address or hostname
server: localhost

# The port number the agent binds to for requests.
port: 5000

# Configuration for Static Files that can be served from the Http Server
files:
- path: schemas
location: schemas

# The maximum number of Observations the agent can hold in its buffer
observationBufferSize: 150000
Expand All @@ -161,29 +191,6 @@ durable: false
defaultVersion: 2.2
```
#### HTTP Configuration
* `port` - The port number the agent binds to for requests.

* `serverIp` - The server IP Address to bind to. Can be used to select the interface in IPV4 or IPV6.

* `responseCompression` - Sets the List of Encodings (ex. gzip, br, deflate) to pass to the Accept-Encoding HTTP Header

* `maxStreamingThreads` - The maximum number of Threads to use for the Http Stream Requests

* `allowPut` - Allow HTTP PUT or POST of data item values or assets.

* `allowPutFrom` - Allow HTTP PUT or POST from a specific host or list of hosts.

* `indentOutput` - Sets the default response document indendation

* `outputComments` - Sets the default response document comments output. Comments contain descriptions from the MTConnect standard

* `outputValidationLevel` - Sets the default response document validation level. 0 = Ignore, 1 = Warning, 2 = Strict

* `files` - Sets the configuration for Static Files that can be served from the Http Server. For more information see ()


#### Agent Configuration
* `observationBufferSize` - The maximum number of Observations the agent can hold in its buffer
Expand Down Expand Up @@ -215,38 +222,6 @@ defaultVersion: 2.2

* `devices` - The Path to look for the file(s) that represent the Device Information Models to load into the Agent. The path can either be a single file or a directory. The path can be absolute or relative to the executable's directory

#### Adapter Configuration

* `adapters` - List of SHDR Adapter connection configurations. For more information see()

* `allowShdrDevice` - Sets whether a Device Model can be sent from an SHDR Adapter

* `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.

* `suppressIpAddress` - Suppress the Adapter IP Address and port when creating the Agent Device ids and names for 1.7. This applies to all adapters.

* `timeout` - 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.

#### XML Configuration

* `devicesNamespaces` - List of extended XML namespaces to use with MTConnectDevicesResponse documents

* `streamsNamespaces` - List of extended XML namespaces to use with MTConnectStreamsResponse documents

* `assetsNamespaces` - List of extended XML namespaces to use with MTConnectAssetsResponse documents

* `errorNamespaces` - List of extended XML namespaces to use with MTConnectErrorResponse documents


* `devicesStyle` - List of XSLT Stylesheets to use with MTConnectDevicesResponse documents

* `streamsStyle` - List of XSLT Stylesheets to use with MTConnectStreamsResponse documents

* `assetsStyle` - List of XSLT Stylesheets to use with MTConnectAssetsResponse documents

* `errorStyle` - List of XSLT Stylesheets to use with MTConnectErrorResponse documents

#### Windows Service Configuration

Expand All @@ -259,9 +234,7 @@ defaultVersion: 2.2
Logging is done using [NLog](https://github.com/NLog/NLog) which allows for customized logging through the NLog.config file located in the application's install directory. The loggers are setup so that there is a separate logger for:
- **(agent-logger)** MTConnect Agent
- **(agent-validation-logger)** MTConnect Data Validation Errors
- **(http-logger)** Http Server
- **(adapter-logger)** MTConnect Adapters
- **(adapter-shdr-logger)** Raw SHDR lines read by the Adapter (used for debugging adapters)
- **(module-logger)** Modules

The default [NLog Configuration File](https://github.com/TrakHound/MTConnect.NET/blob/master/src/MTConnect.NET-Applications-Agents/NLog.config) is shown below:

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -59,6 +59,7 @@ public class MTConnectAgentApplication : IMTConnectAgentApplication

public IMTConnectAgentBroker Agent => _mtconnectAgent;


public event EventHandler<AgentConfiguration> OnRestart;


Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -61,4 +61,11 @@
<ProjectReference Include="..\..\..\libraries\MTConnect.NET-HTTP\MTConnect.NET-HTTP.csproj" />
</ItemGroup>

<ItemGroup>
<None Update="README.md">
<PackagePath>\</PackagePath>
<Pack>True</Pack>
</None>
</ItemGroup>

</Project>
28 changes: 28 additions & 0 deletions agent/Modules/MTConnect.NET-AgentModule-HttpAdapter/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
![MTConnect.NET Logo](https://raw.githubusercontent.com/TrakHound/MTConnect.NET/dev/img/mtconnect-net-03-md.png)

# MTConnect HTTP Adapter Agent Module

## Description
This Agent Module implements an adapter to read from other MTConnect Agents using the MTConnect REST Protocol

## Configuration
```yaml
- http-adapter:
address: localhost
port: 5001
deviceKey: M12346
interval: 100
```
* `address` - The client Agent IP Address or Hostname to read from.

* `port` - The port number to read from.


## Contribution / Feedback
- Please use the [Issues](https://github.com/TrakHound/MTConnect.NET/issues) tab to create issues for specific problems that you may encounter
- Please feel free to use the [Pull Requests](https://github.com/TrakHound/MTConnect.NET/pulls) tab for any suggested improvements to the source code
- For any other questions or feedback, please contact TrakHound directly at **[email protected]**.

## License
This application and it's source code is licensed under the [MIT License](https://choosealicense.com/licenses/mit/) and is free to use.
Original file line number Diff line number Diff line change
Expand Up @@ -62,4 +62,11 @@
<ProjectReference Include="..\..\..\libraries\MTConnect.NET-SHDR\MTConnect.NET-SHDR.csproj" />
</ItemGroup>

<ItemGroup>
<None Update="README.md">
<PackagePath>\</PackagePath>
<Pack>True</Pack>
</None>
</ItemGroup>

</Project>
55 changes: 55 additions & 0 deletions agent/Modules/MTConnect.NET-AgentModule-HttpServer/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,55 @@
![MTConnect.NET Logo](https://raw.githubusercontent.com/TrakHound/MTConnect.NET/dev/img/mtconnect-net-03-md.png)

# MTConnect HTTP Server Agent Module

## Description
This Agent Module implements the MTConnect REST Protocol

## Configuration
```yaml
- http-server:
hostname: localhost
port: 7878
allowPut: true
indentOutput: true
documentFormat: xml
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.

* `port` - The port number the agent binds to for requests.

* `responseCompression` - Sets the List of Encodings (ex. gzip, br, deflate) to pass to the Accept-Encoding HTTP Header

* `maxStreamingThreads` - The maximum number of Threads to use for the Http Stream Requests

* `allowPut` - Allow HTTP PUT or POST of data item values or assets.

* `allowPutFrom` - Allow HTTP PUT or POST from a specific host or list of hosts.

* `indentOutput` - Sets the default response document indendation

* `outputComments` - Sets the default response document comments output. Comments contain descriptions from the MTConnect standard

* `outputValidationLevel` - Sets the default response document validation level. 0 = Ignore, 1 = Warning, 2 = Strict

* `files` - Sets the configuration for Static Files that can be served from the Http Server.


## Contribution / Feedback
- Please use the [Issues](https://github.com/TrakHound/MTConnect.NET/issues) tab to create issues for specific problems that you may encounter
- Please feel free to use the [Pull Requests](https://github.com/TrakHound/MTConnect.NET/pulls) tab for any suggested improvements to the source code
- For any other questions or feedback, please contact TrakHound directly at **[email protected]**.

## License
This application and it's source code is licensed under the [MIT License](https://choosealicense.com/licenses/mit/) and is free to use.
Original file line number Diff line number Diff line change
Expand Up @@ -61,4 +61,11 @@
<ProjectReference Include="..\..\..\libraries\MTConnect.NET-SHDR\MTConnect.NET-SHDR.csproj" />
</ItemGroup>

<ItemGroup>
<None Update="README.md">
<PackagePath>\</PackagePath>
<Pack>True</Pack>
</None>
</ItemGroup>

</Project>
33 changes: 33 additions & 0 deletions agent/Modules/MTConnect.NET-AgentModule-ShdrAdapter/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
![MTConnect.NET Logo](https://raw.githubusercontent.com/TrakHound/MTConnect.NET/dev/img/mtconnect-net-03-md.png)

# MTConnect SHDR Adapter Agent Module

## Description
This Agent Module implements the MTConnect REST Protocol

## Configuration
```yaml
- shdr-adapter:
deviceKey: M12346
hostname: localhost
port: 7878
```
* `allowShdrDevice` - Sets whether a Device Model can be sent from an SHDR Adapter

* `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.

* `suppressIpAddress` - Suppress the Adapter IP Address and port when creating the Agent Device ids and names for 1.7. This applies to all adapters.

* `timeout` - 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.


## Contribution / Feedback
- Please use the [Issues](https://github.com/TrakHound/MTConnect.NET/issues) tab to create issues for specific problems that you may encounter
- Please feel free to use the [Pull Requests](https://github.com/TrakHound/MTConnect.NET/pulls) tab for any suggested improvements to the source code
- For any other questions or feedback, please contact TrakHound directly at **[email protected]**.

## License
This application and it's source code is licensed under the [MIT License](https://choosealicense.com/licenses/mit/) and is free to use.
Original file line number Diff line number Diff line change
Expand Up @@ -62,4 +62,11 @@
<ProjectReference Include="..\..\..\libraries\MTConnect.NET-Common\MTConnect.NET-Common.csproj" />
</ItemGroup>

<ItemGroup>
<None Update="README.md">
<PackagePath>\</PackagePath>
<Pack>True</Pack>
</None>
</ItemGroup>

</Project>
Loading

0 comments on commit 969dedd

Please sign in to comment.