Beckhoff.TwinCAT.Ads.Reactive 5.0.476 Prefix Reserved

Install-Package Beckhoff.TwinCAT.Ads.Reactive -Version 5.0.476
dotnet add package Beckhoff.TwinCAT.Ads.Reactive --version 5.0.476
<PackageReference Include="Beckhoff.TwinCAT.Ads.Reactive" Version="5.0.476" />
For projects that support PackageReference, copy this XML node into the project file to reference the package.
paket add Beckhoff.TwinCAT.Ads.Reactive --version 5.0.476
The NuGet Team does not provide support for this client. Please contact its maintainers for support.
#r "nuget: Beckhoff.TwinCAT.Ads.Reactive, 5.0.476"
#r directive can be used in F# Interactive, C# scripting and .NET Interactive. Copy this into the interactive tool or source code of the script to reference the package.
// Install Beckhoff.TwinCAT.Ads.Reactive as a Cake Addin
#addin nuget:?package=Beckhoff.TwinCAT.Ads.Reactive&version=5.0.476

// Install Beckhoff.TwinCAT.Ads.Reactive as a Cake Tool
#tool nuget:?package=Beckhoff.TwinCAT.Ads.Reactive&version=5.0.476
The NuGet Team does not provide support for this client. Please contact its maintainers for support.

Description

The package 'Beckhoff.TwinCAT.Ads.Reactive' implements reactive extensions for the TwinCAT.Ads.AdsClient class included in the 'Beckhoff.TwinCAT.Ads' package.

Reactive Extensions (Rx) is a .NET library for composing asynchronous and event-based programs using observable sequences and LINQ-style query operators. Using Rx, developers represent asynchronous data streams with Observables, query asynchronous data streams using LINQ operators, and parameterize the concurrency in the asynchronous data streams using Schedulers.

Simply put, Rx = Observables + LINQ + Schedulers.

In ADS terms, not only the reading and writing data or symbol values can be put into reactive data streams, also ADS Notifications or polling of values are a perfect fit for reactive code. With the help of this package not only data binding to reactive frameworks (e.g. reactive UI) is simplified but also enhanced data manipulation via synchronous and asynchronous observers. Multithreaded and parallelized code paths that support multiple CPU cores can be written very easily without the burden of deadlock and synchronization issues.

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
  • Installed Nuget package manager (for systems without Visual Studio installation)

Installation

The 'Beckhoff.TwinCAT.Ads.Reactive' depends on the 'Beckhoff.TwinCAT.Ads' packages and inherits the same requirements (>= TwinCAT 4024.10).

First Steps

The following code instantiates an AdsClient object, connects to the local PLC System Port 851 and subscribes fir the first 20 change notifications of the Task cycle count and writes the value to the Console.

// To Test the Observer run a project on the local PLC System (Port 851)
using (AdsClient client = new AdsClient())
{
    // Connect to target
    client.Connect(new AmsAddress(AmsNetId.Local, 851));

    // Reactive Notification Handler
    var valueObserver = Observer.Create<ushort>(val =>
    {
        Console.WriteLine(string.Format("Value: {0}", val.ToString()));
    }
    );

    // Turning ADS Notifications into sequences of Value Objects (Taking 20 Values)
    // and subscribe to them.
    IDisposable subscription = client.WhenNotification<ushort>("TwinCAT_SystemInfoVarList._TaskInfo.CycleCount", NotificationSettings.Default).Take(20).Subscribe(valueObserver);

    Console.ReadKey(); // Wait for Key press
    subscription.Dispose(); // Dispose the Subscription
}

Further documentation

The actual version of the documentation is available in the Beckhoff Infosys. Beckhoff Information System

NuGet packages (1)

Showing the top 1 NuGet packages that depend on Beckhoff.TwinCAT.Ads.Reactive:

Package Downloads
PlcInterface.Ads

A PLC communication implementation for Beckhoff ADS

GitHub repositories

This package is not used by any popular GitHub repositories.

Version Downloads Last updated
5.0.476 96 9/21/2021
5.0.458 297 8/12/2021
5.0.442 154 7/23/2021
5.0.411 445 6/18/2021
4.4.17 74 9/22/2021
4.4.16 60 8/12/2021
4.4.15 64 7/23/2021
4.4.13 114 5/21/2021