MTConnect.NET-AgentProcessor-Python 6.4.4

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.4.4                
NuGet\Install-Package MTConnect.NET-AgentProcessor-Python -Version 6.4.4                
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.4.4" />                
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.4.4                
#r "nuget: MTConnect.NET-AgentProcessor-Python, 6.4.4"                
#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.4.4

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

MTConnect.NET Logo

MTConnect Python Agent Processor

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

Configuration

processors:
  - 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.1 117 12/3/2024
6.5.0 240 10/21/2024
6.4.7 185 8/21/2024
6.4.6 156 8/7/2024
6.4.5 122 8/2/2024
6.4.4 142 7/16/2024
6.4.3 175 6/14/2024
6.4.2 157 6/12/2024
6.4.1 168 5/17/2024
6.4.0 155 5/14/2024
6.3.2-beta 132 5/2/2024
6.3.1-beta 313 4/24/2024
6.3.0-beta 143 4/17/2024
6.2.2-beta 140 4/5/2024
6.2.1-beta 135 4/3/2024
6.2.0-beta 135 3/27/2024
6.1.3-beta 141 3/15/2024
6.1.2-beta 141 3/15/2024
6.0.11-beta 163 2/2/2024
6.0.10-beta 144 1/26/2024
6.0.9-beta 184 12/28/2023
6.0.8-beta 140 12/27/2023
6.0.7-beta 163 12/19/2023
6.0.5-beta 167 12/14/2023
6.0.3-beta 156 12/12/2023
6.0.1-beta 192 12/7/2023