MTConnect.NET-AgentProcessor-Python 6.2.0-beta

This is a prerelease version of MTConnect.NET-AgentProcessor-Python.
There is a newer version of this package available.
See the version list below for details.
dotnet add package MTConnect.NET-AgentProcessor-Python --version 6.2.0-beta                
NuGet\Install-Package MTConnect.NET-AgentProcessor-Python -Version 6.2.0-beta                
This command is intended to be used within the Package Manager Console in Visual Studio, as it uses the NuGet module's version of Install-Package.
<PackageReference Include="MTConnect.NET-AgentProcessor-Python" Version="6.2.0-beta" />                
For projects that support PackageReference, copy this XML node into the project file to reference the package.
paket add MTConnect.NET-AgentProcessor-Python --version 6.2.0-beta                
#r "nuget: MTConnect.NET-AgentProcessor-Python, 6.2.0-beta"                
#r directive can be used in F# Interactive and Polyglot Notebooks. Copy this into the interactive tool or source code of the script to reference the package.
// Install MTConnect.NET-AgentProcessor-Python as a Cake Addin
#addin nuget:?package=MTConnect.NET-AgentProcessor-Python&version=6.2.0-beta&prerelease

// Install MTConnect.NET-AgentProcessor-Python as a Cake Tool
#tool nuget:?package=MTConnect.NET-AgentProcessor-Python&version=6.2.0-beta&prerelease                

MTConnect.NET Logo

MTConnect Python Agent Processor

This Agent Processor uses individual Python script files to transform input data

Configuration

- python:
    directory: processors
  • directory - The directory to load and monitor for ".py" script files.

Scripts

Scripts are implemented using IronPython and supports Python v3. Both the MTConnect Entity to process and the MTConnect Agent are both accessible from the script.

Example 1

Change the Result for a DataItem with a Type = "EMERGENCY_STOP"

def process(observation):

    if observation.DataItem.Type == 'EMERGENCY_STOP':

        result = observation.GetValue('Result')

        if result.lower() == 'TRUE'.lower():
            observation.AddValue('Result', 'ARMED')
        else:
            observation.AddValue('Result', 'TRIGGERED')

    return observation

Example 2

Change the Result for a DataItem with a Type = "PATH_FEEDRATE_OVERRIDE" from a Percentage to an Integer by multiplying by 100

def process(observation):

    if observation.DataItem.Type == 'PATH_FEEDRATE_OVERRIDE':

        result = float(observation.GetValue('Result'))
        observation.AddValue('Result', result * 100)

    return observation

Example 3

Add a new TimeSeries observation for any time a DataItem with an ID = "L2p1Fact" changes

import clr
clr.AddReference("MTConnect.NET-Common")
import MTConnect.Input

def process(observation):

    if observation.DataItem.Id == "L2p1Fact": 

        timeseries = MTConnect.Input.TimeSeriesObservationInput()
        timeseries.DataItemKey = 'L2p1Sensor'
        timeseries.SampleRate = 100

        n = 15
        samples = [0] * n

        for x in range(n):
            samples[x] = float(x)

        timeseries.Samples = samples

        observation.Agent.AddObservation(observation.DataItem.Device.Uuid, timeseries)

    return observation

Contribution / Feedback

  • Please use the Issues tab to create issues for specific problems that you may encounter
  • Please feel free to use the Pull Requests tab for any suggested improvements to the source code
  • For any other questions or feedback, please contact TrakHound directly at info@trakhound.com.

License

This application and it's source code is licensed under the MIT License and is free to use.

Product Compatible and additional computed target framework versions.
.NET net5.0 was computed.  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 is compatible.  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 is compatible.  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 was computed. 
.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. 
Compatible target framework(s)
Included target framework(s) (in package)
Learn more about Target Frameworks and .NET Standard.

NuGet packages (1)

Showing the top 1 NuGet packages that depend on MTConnect.NET-AgentProcessor-Python:

Package Downloads
MTConnect.NET-Applications-Agents

MTConnect.NET-Applications-Agents contains classes to fully implement an MTConnect Agent application. Supports MTConnect Versions up to 2.3. Supports .NET Framework 4.6.1 up to .NET 8

GitHub repositories

This package is not used by any popular GitHub repositories.

Version Downloads Last updated
6.5.0 110 10/21/2024
6.4.7 177 8/21/2024
6.4.6 144 8/7/2024
6.4.5 114 8/2/2024
6.4.4 131 7/16/2024
6.4.3 166 6/14/2024
6.4.2 146 6/12/2024
6.4.1 159 5/17/2024
6.4.0 148 5/14/2024
6.3.2-beta 129 5/2/2024
6.3.1-beta 277 4/24/2024
6.3.0-beta 136 4/17/2024
6.2.2-beta 137 4/5/2024
6.2.1-beta 132 4/3/2024
6.2.0-beta 132 3/27/2024
6.1.3-beta 138 3/15/2024
6.1.2-beta 136 3/15/2024
6.0.11-beta 160 2/2/2024
6.0.10-beta 141 1/26/2024
6.0.9-beta 181 12/28/2023
6.0.8-beta 137 12/27/2023
6.0.7-beta 160 12/19/2023
6.0.5-beta 164 12/14/2023
6.0.3-beta 153 12/12/2023
6.0.1-beta 189 12/7/2023