AnyTypeExtensions Class
Extension class for IAdsConnection to provide reactive ADS extensions (accessing symbol value sequences with the ANY_TYPE concept)
Inheritance Hierarchy
SystemObject
TwinCAT.Ads.ReactiveAnyTypeExtensions
Namespace: TwinCAT.Ads.Reactive
Assembly: TwinCAT.Ads.Reactive (in
TwinCAT.Ads.Reactive.dll) Version:
7.0.0+e56d35ccc4675faac24789a4aab60071fc61d470
Syntax
C#
public static class AnyTypeExtensionsThe AnyTypeExtensions type exposes the following members.
Methods
|
|
Name |
Description |
|---|---|---|
|
|
Polls the symbol values on timepoints where the polling observable streams data / triggers | |
|
|
Polls the symbol as value sequence of object values with a specified period time. | |
|
|
Polls the symbol values on timepoints where the polling observable streams data / triggers | |
|
|
Polls the symbol as value sequence of object values with a specified period time. | |
|
|
Polls the symbol as value sequence of object values with a specified period time. | |
|
|
PollValues(IAdsConnection, String, Type, IObservableUnit, FuncException, Object) |
Polls the symbol values on timepoints where the polling observable streams data / triggers |
|
|
PollValues(IAdsConnection, String, Type, TimeSpan, FuncException, Object) |
Polls the symbol as value sequence of object values with a specified period time. |
|
|
Polls the symbol as value sequence of object values with a specified period time. | |
|
|
PollValues(IAdsConnection, ISymbol, Type, IObservableUnit, FuncException, Object) |
Polls the symbol values on timepoints where the polling observable streams data / triggers |
|
|
PollValues(IAdsConnection, ISymbol, Type, TimeSpan, FuncException, Object) |
Polls the symbol as value sequence of object values with a specified period time. |
|
|
PollValues(IAdsConnection, String, Type, Int32, IObservableUnit, FuncException, Object) |
Polls the symbol values on time points where the polling observable streams data / triggers |
|
|
PollValues(IAdsConnection, String, Type, Int32, TimeSpan, FuncException, Object) |
Polls the symbol as value sequence of object values with a specified period time. |
|
|
PollValues(IAdsConnection, ISymbol, Type, Int32, IObservableUnit, FuncException, Object) |
Polls the symbol values on time points where the polling observable streams data / triggers |
|
|
PollValues(IAdsConnection, ISymbol, Type, Int32, TimeSpan, FuncException, Object) |
Polls the symbol as value sequence of object values with a specified period time. |
|
|
Polls the symbol values on timepoints where the polling observable streams data / triggers | |
|
|
Polls the symbol as value sequence of object values with a specified period time. | |
|
|
Polls the symbol values on timepoints where the polling observable streams data / triggers | |
|
|
Polls the symbol as value sequence of object values with a specified period time. | |
|
|
Polls the symbol values on time points where the polling observable streams data / triggers | |
|
|
Polls the symbol as value sequence of object values with a specified period time. | |
|
|
PollValuesT(IAdsConnection, String, IObservableUnit, FuncException, T) |
Polls the symbol values on timepoints where the polling observable streams data / triggers |
|
|
PollValuesT(IAdsConnection, String, TimeSpan, FuncException, T) |
Polls the symbol as value sequence of object values with a specified period time. |
|
|
PollValuesT(IAdsConnection, ISymbol, Int32, IObservableUnit) |
Polls the symbol values on time points where the polling observable streams data / triggers |
|
|
Polls the symbol as value sequence of object values with a specified period time. | |
|
|
PollValuesT(IAdsConnection, ISymbol, IObservableUnit, FuncException, T) |
Polls the symbol values on timepoints where the polling observable streams data / triggers |
|
|
PollValuesT(IAdsConnection, ISymbol, TimeSpan, FuncException, T) |
Polls the symbol as value sequence of object values with a specified period time. |
|
|
PollValuesT(IAdsConnection, String, Int32, IObservableUnit, FuncException, T) |
Polls the symbol values on timepoints where the polling observable streams data / triggers |
|
|
PollValuesT(IAdsConnection, String, Int32, TimeSpan, FuncException, T) |
Polls the symbol as value sequence of object values with a specified period time. |
|
|
PollValuesT(IAdsConnection, ISymbol, Int32, IObservableUnit, FuncException, T) |
Polls the symbol values on timepoints where the polling observable streams data / triggers |
|
|
PollValuesT(IAdsConnection, ISymbol, Int32, TimeSpan, FuncException, T) |
Polls the symbol as value sequence of object values with a specified period time. |
|
|
PollValues2T(IAdsConnection, String, Int32, IObservableUnit) |
Polls the symbol values on time points where the polling observable streams data / triggers |
|
|
PollValues2T(IAdsConnection, ISymbol, Int32, IObservableUnit) |
Polls the symbol values on timepoints where the polling observable streams data / triggers |
|
|
WhenNotification(IAdsConnection, String, Type, NotificationSettings) |
Creates an observable sequence of values that are created by ADS Notifications. |
|
|
WhenNotificationT(IAdsConnection, String, NotificationSettings) |
Creates an observable sequence of values that are created by ADS Notifications. |
|
|
Writes the sequence of values to the symbol specified by the instance path. | |
|
|
WriteValuesT(IAdsConnection, String, IObservableT, ActionException) |
Writes the sequence of values to the symbol specified by the instance path. |
Remarks
Reactive Extensions (Rx) are a 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. The ADS reactive extensions are build on top of this library to enable ADS Symbol and State Observables, seamlessly bound to the reactive extensions. To use the ADS reactive extensions the TwinCAT.Ads.Reactive Nuget package (or the included TwinCAT.Ads.Reactive.dll) must be referenced. (Beckhoff.TwinCAT.Ads.Reactive package on Nuget).
Example
Example1: Observe Value changed Notifications with the reactive AnyTypeExtensions
Observe a single changing ADS Symbols (Extended AdsNotifications, ANY_TYPE)
// 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
}Reference
TwinCAT.Ads.Reactive Namespace AdsClientExtensions ValueSymbolExtensions
Beckhoff Automation GmbH & Co. KG 2001-2026
- AnyTypeExtensions.PollValues Method (IAdsConnection, String, Type, IObservable.Unit.)
- AnyTypeExtensions.PollValues Method (IAdsConnection, String, Type, TimeSpan)
- AnyTypeExtensions.PollValues Method (IAdsConnection, String, Type, .Int32., TimeSpan)
- AnyTypeExtensions.PollValues Method (IAdsConnection, String, Type, IObservable.Unit., Func.Exception, Object.)
- AnyTypeExtensions.PollValues Method (IAdsConnection, String, Type, TimeSpan, Func.Exception, Object.)
- AnyTypeExtensions.PollValues Method (IAdsConnection, String, Type, .Int32., IObservable.Unit., Func.Exception, Object.)
- AnyTypeExtensions.PollValues Method (IAdsConnection, String, Type, .Int32., TimeSpan, Func.Exception, Object.)
- AnyTypeExtensions.PollValues.T. Method (IAdsConnection, String, IObservable.Unit.)
- AnyTypeExtensions.PollValues.T. Method (IAdsConnection, String, TimeSpan)
- AnyTypeExtensions.PollValues.T. Method (IAdsConnection, String, .Int32., IObservable.Unit.)
- AnyTypeExtensions.PollValues.T. Method (IAdsConnection, String, .Int32., TimeSpan)
- AnyTypeExtensions.PollValues.T. Method (IAdsConnection, String, IObservable.Unit., Func.Exception, T.)
- AnyTypeExtensions.PollValues.T. Method (IAdsConnection, String, TimeSpan, Func.Exception, T.)
- AnyTypeExtensions.PollValues.T. Method (IAdsConnection, String, .Int32., IObservable.Unit., Func.Exception, T.)
- AnyTypeExtensions.PollValues.T. Method (IAdsConnection, String, .Int32., TimeSpan, Func.Exception, T.)
- AnyTypeExtensions.WhenNotification Method (IAdsConnection, String, Type, NotificationSettings)
- AnyTypeExtensions.WhenNotification.T. Method (IAdsConnection, String, NotificationSettings)
- AnyTypeExtensions.WriteValues.T. Method (IAdsConnection, String, IObservable.T.)
- AnyTypeExtensions.WriteValues.T. Method (IAdsConnection, String, IObservable.T., Action.Exception.)
- AnyTypeExtensions.PollValues Method (IAdsConnection, ISymbol, Type, IObservable.Unit.)
- AnyTypeExtensions.PollValues Method (IAdsConnection, ISymbol, Type, TimeSpan)
- AnyTypeExtensions.PollValues Method (IAdsConnection, ISymbol, Type, .Int32., TimeSpan)
- AnyTypeExtensions.PollValues Method (IAdsConnection, ISymbol, Type, IObservable.Unit., Func.Exception, Object.)
- AnyTypeExtensions.PollValues Method (IAdsConnection, ISymbol, Type, TimeSpan, Func.Exception, Object.)
- AnyTypeExtensions.PollValues Method (IAdsConnection, ISymbol, Type, .Int32., IObservable.Unit., Func.Exception, Object.)
- AnyTypeExtensions.PollValues Method (IAdsConnection, ISymbol, Type, .Int32., TimeSpan, Func.Exception, Object.)
- AnyTypeExtensions.PollValues.T. Method (IAdsConnection, ISymbol, IObservable.Unit.)
- AnyTypeExtensions.PollValues.T. Method (IAdsConnection, ISymbol, TimeSpan)
- AnyTypeExtensions.PollValues.T. Method (IAdsConnection, ISymbol, .Int32., IObservable.Unit.)
- AnyTypeExtensions.PollValues.T. Method (IAdsConnection, ISymbol, .Int32., TimeSpan)
- AnyTypeExtensions.PollValues.T. Method (IAdsConnection, ISymbol, IObservable.Unit., Func.Exception, T.)
- AnyTypeExtensions.PollValues.T. Method (IAdsConnection, ISymbol, TimeSpan, Func.Exception, T.)
- AnyTypeExtensions.PollValues.T. Method (IAdsConnection, ISymbol, .Int32., IObservable.Unit., Func.Exception, T.)
- AnyTypeExtensions.PollValues.T. Method (IAdsConnection, ISymbol, .Int32., TimeSpan, Func.Exception, T.)
- AnyTypeExtensions.PollValues2.T. Method (IAdsConnection, String, .Int32., IObservable.Unit.)
- AnyTypeExtensions.PollValues2.T. Method (IAdsConnection, ISymbol, .Int32., IObservable.Unit.)