Community.TwinCAT.Mdp 0.2.3

dotnet add package Community.TwinCAT.Mdp --version 0.2.3                
NuGet\Install-Package Community.TwinCAT.Mdp -Version 0.2.3                
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="Community.TwinCAT.Mdp" Version="0.2.3" />                
For projects that support PackageReference, copy this XML node into the project file to reference the package.
paket add Community.TwinCAT.Mdp --version 0.2.3                
#r "nuget: Community.TwinCAT.Mdp, 0.2.3"                
#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 Community.TwinCAT.Mdp as a Cake Addin
#addin nuget:?package=Community.TwinCAT.Mdp&version=0.2.3

// Install Community.TwinCAT.Mdp as a Cake Tool
#tool nuget:?package=Community.TwinCAT.Mdp&version=0.2.3                

TwinCAT MDP Client

GitHub license NuGet Version

Contains a MDP client implementation for the Beckhoff Device Manager communication protocol based on the TwinCAT.Ads.AdsClient. The Root object is the TwinCAT.MDP.MdpClient to communicate with the Beckhoff Device Manager via ADS. Use TwinCAT.Mdp.Reactive for reactive extensions.

Since the official Beckhoff MDP client for C# only allows local access, remote access is also possible with TwinCAT.Mdp.MdpClient

Requirements

.NET 5.0, .NET Core 3.1, .NET Framework 4.61 or .NET Standard 2.0 compatible SDK or later. A TwinCAT 3.1.4024 Build (XAE, XAR or ADS Setup) or alternatively the Beckhoff.TwinCAT.AdsRouterConsole Application on Non-TwinCAT systems to route ADS communication.

TwinCAT Version >= 4024.10

Because the Beckhoff.TwinCAT.Ads Version 5.X uses internal interfaces that are available only from TwinCAT 4024.10 on, an appropriate version must be installed locally. The package doesn't work with older installations. An alternativ approach for some use cases is to use the 'Beckhoff.TwinCAT.Ads.AdsRouterConsole' / 'Beckhoff.TwinCAT.TcpIpRouter' packages to establish your own router.

Systems without TwinCAT Installation

Install the 'Beckhoff.TwinCAT.Ads.AdsRouterConsole' package from Nuget.org:

PS> nuget install Beckhoff.TwinCAT.Ads.AdsRouterConsole

See Beckhoff.TwinCAT.Ads for further documentation.

Usage

see Beckhoff Infosys for detailed information

Basic

using( MdpClient client = new MdpClient() ) 
{
    client.Connect("192.168.1.244.1.1");

    var cpuUsage = client.ReadParameter<ushort>(ModuleType.CPU, 1, 2);
    var cpuUsageAsync = await client.ReadParameterAsync<ushort>(ModuleType.CPU, 1, 2, CancellationToken.None);
    var cpuTemp = client.ReadParameter(ModuleType.CPU, 1, 3, typeof(short));
    var cpuTempAsync = await client.ReadParameterAsync(ModuleType.CPU, 1, 3, typeof(short), CancellationToken.None);
    var osVersion = client.ReadParameter<uint>(ModuleType.OS, 1, 3);

}

Reactive

using( MdpClient client = new MdpClient() ) 
{
    client.Connect("192.168.1.244.1.1");

    client.WhenConnectionStateChanges()
          .Subscribe(x => Console.WriteLine(x));

    client
        .PollParameter(ModuleType.CPU, 1, 1, typeof(int), TimeSpan.FromSeconds(1))
        .Subscribe(i => Console.WriteLine(i));

    client.WhenValueChanged(ModuleType.OS, 2, 1, typeof(ulong))
          .Subscribe(i => Console.WriteLine(i));
}

How to determine table und sub index

see MDP information model

mdp-information-model

License

Product Compatible and additional computed target framework versions.
.NET net5.0 was computed.  net5.0-windows was computed.  net6.0 was computed.  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 was computed. 
.NET Standard netstandard2.0 is compatible.  netstandard2.1 was computed. 
.NET Framework net461 was computed.  net462 was computed.  net463 was computed.  net47 was computed.  net471 was computed.  net472 was computed.  net48 was computed.  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 Community.TwinCAT.Mdp:

Package Downloads
Community.TwinCAT.Mdp.Reactive

Contains a MDP client implementation for the Beckhoff Device Manager communication protocol based on the TwinCAT.Ads.AdsClient. The Root object is the TwinCAT.MDP.MdpClient to communicate with the Beckhoff Device Manager via ADS. Use TwinCAT.Mdp.Reactive for reactive extensions.

GitHub repositories

This package is not used by any popular GitHub repositories.

Version Downloads Last updated
0.2.3 288 2/24/2024
0.2.2 246 2/24/2024
0.2.1 226 2/22/2024
0.2.1-beta 205 2/14/2024
0.2.0-beta 155 2/2/2024