Beckhoff.TwinCAT.Ads.Reactive 6.0.404

Prefix Reserved
There is a newer version of this package available.
See the version list below for details.
dotnet add package Beckhoff.TwinCAT.Ads.Reactive --version 6.0.404                
NuGet\Install-Package Beckhoff.TwinCAT.Ads.Reactive -Version 6.0.404                
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="Beckhoff.TwinCAT.Ads.Reactive" Version="6.0.404" />                
For projects that support PackageReference, copy this XML node into the project file to reference the package.
paket add Beckhoff.TwinCAT.Ads.Reactive --version 6.0.404                
#r "nuget: Beckhoff.TwinCAT.Ads.Reactive, 6.0.404"                
#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 Beckhoff.TwinCAT.Ads.Reactive as a Cake Addin
#addin nuget:?package=Beckhoff.TwinCAT.Ads.Reactive&version=6.0.404

// Install Beckhoff.TwinCAT.Ads.Reactive as a Cake Tool
#tool nuget:?package=Beckhoff.TwinCAT.Ads.Reactive&version=6.0.404                

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 6.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).

Version Support lifecycle

Package Description .NET Framework TwinCAT Active Support
6.1 Package basing on .NET 7.0/6.0 net7.0, net6.0, netstandard2.0 >= 3.1.4024.10 [^1] X
6.0 Package basing on .NET 6.0 net6.0, netcoreapp3.1, netstandard2.0, net461 >= 3.1.4024.10 [^1] X
5.x Package basing on .NET 5.0[^3] net5.0, netcoreapp3.1, netstandard2.0, net461 >= 3.1.4024.10 [^1]
4.x Package basing on .NET Framework 4.0 net4 All X

[^1]: Requirement on the Host system. No version limitation in remote system communication.

[^2]: Microsoft support for .NET5 ends with May 8, 2022. Therefore it is recommended to update Beckhoff.TwinCAT packages from Version 5 to Version 6.

Migrate from ASP.NET Core 5.0 to 6.0

migrating to the latest .NET Microsoft .NET support lifecycle

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

Sample Code

Beckhoff GitHub BaseSamples Beckhoff GitHub ClientSamples

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 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 is compatible. 
.NET Standard netstandard2.0 is compatible.  netstandard2.1 was computed. 
.NET Framework net461 is compatible.  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 (2)

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

Package Downloads
PlcInterface.Ads

A PLC communication implementation for Beckhoff ADS

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
6.1.304 247 11/20/2024
6.1.298 1,045 11/7/2024
6.1.294 1,740 10/18/2024
6.1.290 673 10/7/2024
6.1.272 3,760 9/3/2024
6.1.266 1,603 8/28/2024
6.1.260 3,027 8/6/2024
6.1.244 1,682 6/20/2024
6.1.231 969 5/27/2024
6.1.203 4,349 3/15/2024
6.0.404 83 11/7/2024
6.0.380 86 8/6/2024
6.0.356 878 2/12/2024
4.4.37 85 11/7/2024
4.4.32 115 8/6/2024
4.4.26 1,133 7/27/2023

### 6.0.378
Fix: Build process sometimes creates Version Number 1.0.0.0 for Package assemblies.
Enh: Implementation of Write-AdsControl Cmdlet
Enh: Info output for Get-AdsState Cmdlet
Enh: Implementation of Set-RTimeCpuSettings Cmdlet
Enh: Adding TwinCAT.Ads.Vision.VisionExtension Extension class to access TwinCAT Vision Images.
Enh: Adds Repeated Read/Write/ReadWrite methods to TwinCAT.Ads.AdsClientExtensions
Enh: Adds Read/Write/ReadWrite methods with Fallback functions to TwinCAT.Ads.AdsClientExtensions
### 6.0.216
Fix: PollValue handlers are called mixed up in blocking scenarios, GitHub: 36, #111031
### 6.0.212
Fix: AssemblyVersion and FileVersion of the Package Dlls are 1.0.0.0 for netcoreapp3.1 instead of 6.X. Netcoreapp3.1 Package dependencies were broken.
### 5.0.528
Enh: Internal optimizations for ValueSymbolExtensions.PollValues using less roundtrips (caching symbol handle)
Enh: Added implementation of ValueSymbolExtensions.PollValues2 to remain observing values on communication errors
Enh: Additional ValueSymbolExtensions.PollValues overload ignoreErrors to remain observing values on communication errors
Enh: Additional ValueSymbolExtensions.PollValues overload for SumSymbolRead command for optimized polling of multiple values
### 5.0.327
Fix: Parallel usage of ADS notifications and Reactive extension leads to problems, fixes #34108
### 5.0.320
Enh: Updated Package Dependencies to 5.0 Versions

### 5.0.297

### 5.0.1-preview.12

### 5.0.1-preview.11
Enh: Target change dotnet core 3.0 --> 3.1

### 5.0.1-preview.10
Enh: Adding .NET Core 5.0 as platform

### 5.0.0-preview9
Enh: Null-Reference awareness in API Interfaces c# 8.0 (see [Nullable Reference Types ](https://docs.microsoft.com/en-us/dotnet/csharp/language-reference/builtin-types/nullable-reference-types))

### 5.0.0-preview8

### 5.0.0-preview7

### 5.0.0-preview6
Enh: Reactive extension methods WhenNotification, WhenNotificationEx, WhenAdsStateChanges, PollAdsState, PollValues, WriteValues now detect the SymbolVersionChanged event and recreate internally stored
handles. This enables the Observables to survive an upload of PlcPrograms (with still existing symbols.)
Enh: Added WhenSymbolVersionChanges Observable.

### 5.0.0-preview5
Breaking Change: Removing the explicit .net core 2.0 platform support, .NET Standard 2.0 should be used instead.

### 5.0.0-preview4

### 5.0.0-preview3
Enh: Framework dependency changed net462 --> net461
Enh: Adding Framework target netcoreapp2.0
Enh: Optimizing Nuget Package dependencies

### 5.0.0-beta10
BreakingChange: Renaming TwinCAT.Ads.Reactive.SymbolNotification to TwinCAT.Ads.Reactive.SymbolValueNotification
Enh: Streamlining Notification classes to the INotification interface.
Enh: Using the optimized AdsSumNotification for observers.

### 5.0.0-beta9
Enh: Referencing .NET Core 3.0 instead of .NET Core 2.2