IoT-Driver.S7PlcRx.Reactive
1.0.2
dotnet add package IoT-Driver.S7PlcRx.Reactive --version 1.0.2
NuGet\Install-Package IoT-Driver.S7PlcRx.Reactive -Version 1.0.2
<PackageReference Include="IoT-Driver.S7PlcRx.Reactive" Version="1.0.2" />
<PackageVersion Include="IoT-Driver.S7PlcRx.Reactive" Version="1.0.2" />
<PackageReference Include="IoT-Driver.S7PlcRx.Reactive" />
paket add IoT-Driver.S7PlcRx.Reactive --version 1.0.2
#r "nuget: IoT-Driver.S7PlcRx.Reactive, 1.0.2"
#:package IoT-Driver.S7PlcRx.Reactive@1.0.2
#addin nuget:?package=IoT-Driver.S7PlcRx.Reactive&version=1.0.2
#tool nuget:?package=IoT-Driver.S7PlcRx.Reactive&version=1.0.2
<p align="center"> <img src="https://github.com/ChrisPulman/IoT-DriverCore/blob/main/images/s7-plc-rx.png" alt="S7PlcRx package logo" width="320" /> </p>
S7PlcRx
Reactive Siemens S7 PLC communication for .NET. IoT-Driver.S7PlcRx provides tag-based S7 reads/writes, Primitives-based observable streams, optimized batch helpers, caching, diagnostics, production reliability helpers, high-availability helpers, PLC byte conversion utilities, and source-generator assisted property bindings. Version 3 moves the core package to ReactiveUI.Primitives and adds a companion IoT-Driver.S7PlcRx.Reactive package for System.Reactive-compatible applications.
Siemens and S7 are trademarks of Siemens AG. This project is independent and is not affiliated with or endorsed by Siemens AG. Test all automation code against a simulator or safe test rig before using production equipment.
Overview
The NuGet package is named IoT-Driver.S7PlcRx, while the migrated runtime namespace is IoT.Driver.S7PlcRx; IoT-Driver.S7PlcRx.Reactive uses IoT.Driver.S7PlcRx.Reactive. This guide is the contract for both packages: the reactive variant has the same PLC, tag, binding, optimisation, production, and logical-tag features, with its namespace segment .Reactive and ReactiveUI.Primitives Reactive dependencies.
Every read is asynchronous or observable, and every write is a command sent to a PLC. A tag must be registered before it can be observed, read by name, batched, bound, cached, or written. A nullable read result means that the operation did not yield a value; it is not a safe substitute for inspecting connection and error streams.
Safety
- Prove IP, CPU model, rack/slot, PUT/GET permissions, address, data type, byte order, and machine interlocks in a simulator or isolated cell first.
- Treat
Value, generated property setters, batch writes, and watchdog configuration as potentially actuating operations. Validate an acknowledgement/tag read after a command and always subscribe toLastErrorandLastErrorCode. - Use a bounded cancellation token for each call path that accepts one. Dispose the
IRxS7connection, subscriptions, binding sessions, pools, tag groups, and manager objects you create. - Do not enable the watchdog until the PLC program explicitly owns its DB word, validates its value/range, and defines the safe result when communication stops.
Package matrix and variant choice
| Package | Runtime namespace | Use it when | Generator delivery |
|---|---|---|---|
IoT-Driver.S7PlcRx |
IoT.Driver.S7PlcRx |
New Primitives-based code | Install IoT-Driver.S7PlcRx.Generators separately when generated bindings are required. |
IoT-Driver.S7PlcRx.Reactive |
IoT.Driver.S7PlcRx.Reactive |
Existing System.Reactive-oriented applications | Install the standalone generator separately when generated bindings are required. |
IoT-Driver.S7PlcRx.Generators |
IoT.Driver.S7PlcRx.SourceGenerators |
Explicit analyzer dependency or generator development | Add as an analyzer, not as a normal runtime service. |
The runtime packages target net462, net472, net481, net8.0, net9.0, net10.0, and net11.0. Do not pass core-package objects to the reactive-package API or vice versa.
Lifecycle and error model
IRxS7 exposes connection and operation state as IsConnected, IsConnectedValue, IsPaused, Status, LastError, LastErrorCode, and ReadTime. Subscribe before starting command traffic. A failed/invalid operation is reported by its return value, the nullable result of an async read, and/or these streams; do not infer success merely because a write was queued.
IRxS7 inherits ReactiveUI.Primitives.Disposables.ICancelable, which in turn is disposable. Therefore factory results must be disposed: using IRxS7 plc = S71500.Create(...) is the preferred scope. Dispose subscriptions before the PLC scope ends, pass cancellation tokens to the supported read and logical-tag operations, and scope owned auxiliary objects (S7TagBindingSession, ConnectionPool, HighPerformanceTagGroup<T>, and high-availability managers) with their own documented disposal contracts.
using IoT.Driver.Core;
using IoT.Driver.S7PlcRx;
using IRxS7 plc = S71500.Create("192.168.10.20", rack: 0, slot: 1, interval: 100);
using var errors = plc.LastError.Subscribe(message => Console.Error.WriteLine(message));
using var codes = plc.LastErrorCode.Subscribe(code => Console.Error.WriteLine($"S7: {code}"));
using var state = plc.IsConnected.Subscribe(connected => Console.WriteLine($"Connected: {connected}"));
using var timeout = new CancellationTokenSource(TimeSpan.FromSeconds(2));
var level = await plc.ReadAsync(new LogicalTagKey<float>("Level"), timeout.Token);
if (level is null)
throw new InvalidOperationException("No level value; inspect LastError/LastErrorCode.");
Contents
- V3 release highlights and breaking changes
- Supported PLCs and frameworks
- PLC prerequisites
- Installation
- Choosing S7PlcRx or S7PlcRx.Reactive
- R3 ReactiveUI.Primitives bridge
- Quick start
- Addressing and data types
- Core tag API
- Reactive reading
- Manual reads and writes
- Batch, async, and optimized APIs
- Source generator property binding
- Performance and cache features
- Enterprise features
- Production reliability and diagnostics
- PLC type conversion helpers
- Error handling
- Full API examples and documentation map
- Public API reference
- Build and test
V3 release highlights and breaking changes
V3 is a reactive dependency migration release. The PLC API surface remains tag-oriented, but the package model is now explicit:
IoT-Driver.S7PlcRxis the lean package for new code. It usesReactiveUI.Primitives,ReactiveUI.Primitives.Async, andReactiveUI.Primitives.Extensions; it no longer depends onSystem.ReactiveorReactiveUI.Extensions.IoT-Driver.S7PlcRx.Reactiveis the System.Reactive-compatible package for existing Rx consumers. It shares the same implementation sources, compiles them withREACTIVE_SHIM, and publishes the API underIoT.Driver.S7PlcRx.Reactive.*namespaces.- The source generator supports both namespace families. Generated attributes are emitted under
IoT.Driver.S7PlcRx.SourceGenerationfor the core package andIoT.Driver.S7PlcRx.Reactive.SourceGenerationfor the reactive package. - The core package uses Primitives conventions such as
ReactiveUI.Primitives.RxVoidandISequencer. The reactive package uses the.Reactivepackage variants and intentionally exposes System.Reactive conventions such asSystem.Reactive.Unit. - Both runtime packages now target
net462,net472,net481,net8.0,net9.0,net10.0, andnet11.0. - Analyzer coverage is stricter in V3. StyleSharp.Analyzers and the existing analyzer set are expected to run cleanly without
NoWarnsuppressions for fixable issues.
Breaking changes to check during migration:
- Replace
ReactiveUI.Extensionspackage references in consuming projects with the relevantReactiveUI.Primitives.Extensionspackage family. - If application code imports
System.Reactive.Linq,System.Reactive.Disposables,System.Reactive.Subjects,System.Reactive.Concurrency, or depends onSystem.Reactive.Unit, referenceIoT-Driver.S7PlcRx.Reactiveand update namespaces toIoT.Driver.S7PlcRx.Reactive.*. - If application code only consumes
IObservable<T>streams and Primitives extension methods, referenceIoT-Driver.S7PlcRxand useReactiveUI.Primitives/ReactiveUI.Primitives.Extensionsimports. - Do not mix objects from
IoT-Driver.S7PlcRxandIoT-Driver.S7PlcRx.Reactivein the same object graph. They are compiled as separate assemblies with parallel namespaces.
Supported PLCs and frameworks
| PLC family | API |
|---|---|
| S7-1500 | CpuType.S71500, S71500.Create(...) |
| S7-1200 | CpuType.S71200, S71200.Create(...) |
| S7-400 | CpuType.S7400, S7400.Create(...) |
| S7-300 | CpuType.S7300, S7300.Create(...) |
| S7-200 | CpuType.S7200, S7200.Create(...) |
| Logo 0BA8 | enum support where supported by the protocol path |
IoT-Driver.S7PlcRx and IoT-Driver.S7PlcRx.Reactive target net462, net472, net481, net8.0, net9.0, net10.0, and net11.0.
IoT-Driver.S7PlcRx.Generators targets netstandard2.0 and runs as a Roslyn analyzer/source generator. Install it explicitly only when using generated bindings.
PLC prerequisites
For absolute DB addressing such as DB1.DBD0 on modern Siemens CPUs:
- Enable PUT/GET communication.
- Use non-optimized DB layout for directly addressed DBs.
- Confirm IP address, rack, and slot.
- Keep write tests away from live actuators until proven safe.
- For source-generated byte-array batching, place related tags in the same DB and adjacent byte ranges.
Installation
Core Primitives package:
Install-Package IoT-Driver.S7PlcRx
dotnet add package IoT-Driver.S7PlcRx
# Add this separately only when using [S7PlcBinding]/[S7Tag] generated bindings.
dotnet add package IoT-Driver.S7PlcRx.Generators
System.Reactive-compatible package:
Install-Package IoT-Driver.S7PlcRx.Reactive
dotnet add package IoT-Driver.S7PlcRx.Reactive
Repository/analyzer usage for the source generator:
<ProjectReference Include="..\S7PlcRx.Generators\S7PlcRx.Generators.csproj"
OutputItemType="Analyzer"
ReferenceOutputAssembly="false"
PrivateAssets="all" />
Use this package split deliberately:
| Package | Main namespaces | Reactive model | Choose when |
|---|---|---|---|
IoT-Driver.S7PlcRx |
IoT.Driver.S7PlcRx, IoT.Driver.S7PlcRx.Advanced, IoT.Driver.S7PlcRx.PlcTypes |
Lean ReactiveUI.Primitives over System.IObservable<T> |
New applications, libraries that should avoid a System.Reactive runtime dependency, or code already using Primitives operators. |
IoT-Driver.S7PlcRx.Reactive |
IoT.Driver.S7PlcRx.Reactive, IoT.Driver.S7PlcRx.Reactive.Advanced, IoT.Driver.S7PlcRx.Reactive.PlcTypes |
ReactiveUI.Primitives .Reactive packages and System.Reactive conventions |
Existing Rx applications that need System.Reactive Unit, scheduler conventions, or minimal migration churn. |
If an application also uses R3, reference R3 plus the relevant Primitives package. Do not add ReactiveUI.Primitives.R3Bridge.Generator directly; the bridge generator is packed by ReactiveUI.Primitives and ReactiveUI.Primitives.Async.
dotnet add package R3
# Required only for the R3Async bridge example.
dotnet add package R3Async
dotnet add package ReactiveUI.Primitives
dotnet add package ReactiveUI.Primitives.Async
Choosing S7PlcRx or S7PlcRx.Reactive
Use the core package when the application can standardize on ReactiveUI.Primitives:
using ReactiveUI.Primitives;
using IoT.Driver.Core;
using ReactiveUI.Primitives.Extensions;
using IoT.Driver.Core;
using IoT.Driver.S7PlcRx;
using IoT.Driver.S7PlcRx.Enums;
using IRxS7 plc = S71500.Create("192.168.1.100", rack: 0, slot: 1, interval: 100);
TagOperations.AddUpdateTagItem(plc, typeof(float), "Temperature", "DB1.DBD0");
using var subscription = plc.Observe(new LogicalTagKey<float>("Temperature"))
.Where(value => value.HasValue)
.Subscribe(value => Console.WriteLine(value));
Use the reactive package when the consuming application is still System.Reactive-first:
using ReactiveUI.Primitives.Extensions.Reactive;
using ReactiveUI.Primitives.Reactive;
using IoT.Driver.Core;
using IoT.Driver.S7PlcRx.Reactive;
using IoT.Driver.S7PlcRx.Reactive.Enums;
using IRxS7 plc = S71500.Create("192.168.1.100", rack: 0, slot: 1, interval: 100);
TagOperations.AddUpdateTagItem(plc, typeof(float), "Temperature", "DB1.DBD0");
using var subscription = plc.Observe(new LogicalTagKey<float>("Temperature"))
.Where(value => value.HasValue)
.Subscribe(value => Console.WriteLine(value));
The two packages expose the same PLC concepts and helper methods. The differences are assembly identity, namespace prefix, and reactive dependency conventions.
| Concern | IoT-Driver.S7PlcRx |
IoT-Driver.S7PlcRx.Reactive |
|---|---|---|
| Assembly/package | S7PlcRx / IoT-Driver.S7PlcRx |
S7PlcRx.Reactive / IoT-Driver.S7PlcRx.Reactive |
| Root namespace | IoT.Driver.S7PlcRx |
IoT.Driver.S7PlcRx.Reactive |
| Extension namespaces | IoT.Driver.S7PlcRx.Advanced, IoT.Driver.S7PlcRx.Optimization, IoT.Driver.S7PlcRx.Production |
IoT.Driver.S7PlcRx.Reactive.Advanced, IoT.Driver.S7PlcRx.Reactive.Optimization, IoT.Driver.S7PlcRx.Reactive.Production |
| Reactive packages | ReactiveUI.Primitives, .Async, .Extensions |
ReactiveUI.Primitives.Reactive, .Async.Reactive, .Extensions.Reactive |
| Unit convention | ReactiveUI.Primitives.RxVoid |
System.Reactive.Unit |
| Scheduler/sequencer convention | ReactiveUI.Primitives.Concurrency.ISequencer |
System.Reactive scheduler-compatible .Reactive conventions |
| Best fit | New or migrated Primitives applications | Existing System.Reactive applications |
R3 ReactiveUI.Primitives bridge
The R3 bridge is generated into the consuming assembly when the required R3 symbols are referenced. Add using ReactiveUI.Primitives.R3Bridge; and bridge at application boundaries only. Keep PLC code in one reactive model after conversion.
Core S7PlcRx stream to R3:
using R3;
using ReactiveUI.Primitives;
using ReactiveUI.Primitives.R3Bridge;
using IoT.Driver.Core;
using IoT.Driver.S7PlcRx;
using IoT.Driver.S7PlcRx.Enums;
var options = new RxS7Options(new S7ConnectionOptions(CpuType.S71500, "192.168.1.100", rack: 0, slot: 1));
using var plc = new RxS7(options);
TagOperations.AddUpdateTagItem(plc, typeof(float), "Temperature", "DB1.DBD0");
System.IObservable<float?> primitivesTemperature = plc.Observe(new LogicalTagKey<float>("Temperature"));
Observable<float?> r3Temperature = primitivesTemperature.AsR3Observable();
using var subscription = r3Temperature.Subscribe(value =>
{
Console.WriteLine($"R3 temperature: {value}");
});
R3 stream back to Primitives:
using R3;
using ReactiveUI.Primitives.R3Bridge;
Observable<float?> r3Temperature = Observable.Interval(TimeSpan.FromSeconds(1))
.Select(_ => 72.5f);
System.IObservable<float?> primitivesTemperature = r3Temperature.AsPrimitivesSignal();
Async observable bridge:
using R3;
using ReactiveUI.Primitives.Async;
using ReactiveUI.Primitives.R3Bridge;
using IoT.Driver.S7PlcRx.Advanced;
IObservableAsync<float?> asyncTemperature = AsyncExtensions.ObserveValue(plc, default(float), "Temperature");
Observable<float?> r3Temperature = asyncTemperature.AsR3Observable();
IObservableAsync<float?> backToAsync = r3Temperature.AsPrimitivesAsyncObservable();
R3Async bridge:
using R3Async;
using ReactiveUI.Primitives.Async;
using ReactiveUI.Primitives.R3Bridge;
using IoT.Driver.S7PlcRx.Advanced;
IObservableAsync<float?> asyncTemperature = AsyncExtensions.ObserveValue(plc, default(float), "Temperature");
AsyncObservable<float?> r3AsyncTemperature = asyncTemperature.AsR3AsyncObservable();
IObservableAsync<float?> backToPrimitives = r3AsyncTemperature.AsPrimitivesAsyncObservable();
Generated bridge methods:
| Available symbols | Generated methods |
|---|---|
R3.Observable<T> and System.IObservable<T> |
AsR3Observable<T>(this System.IObservable<T>), AsPrimitivesSignal<T>(this R3.Observable<T>) |
R3.Observable<T> and ReactiveUI.Primitives.Async.IObservableAsync<T> |
AsR3Observable<T>(this IObservableAsync<T>), AsPrimitivesAsyncObservable<T>(this R3.Observable<T>) |
R3Async.AsyncObservable<T> and IObservableAsync<T> |
AsR3AsyncObservable<T>(this IObservableAsync<T>), AsPrimitivesAsyncObservable<T>(this R3Async.AsyncObservable<T>) |
Quick start
using ReactiveUI.Primitives;
using IoT.Driver.Core;
using IoT.Driver.S7PlcRx;
using IoT.Driver.S7PlcRx.Enums;
var options = new RxS7Options(new S7ConnectionOptions(CpuType.S71500, "192.168.1.100", rack: 0, slot: 1));
using var plc = new RxS7(options);
TagOperations.AddUpdateTagItem(plc, typeof(float), "Temperature", "DB1.DBD0");
TagOperations.AddUpdateTagItem(plc, typeof(bool), "Running", "DB1.DBX4.0");
TagOperations.AddUpdateTagItem(plc, typeof(float), "TemperatureSetPoint", "DB1.DBD8");
using var connected = plc.IsConnected
.DistinctUntilChanged()
.Subscribe(x => Console.WriteLine($"Connected: {x}"));
using var temperature = plc.Observe(new LogicalTagKey<float>("Temperature"))
.Where(x => x.HasValue)
.Subscribe(x => Console.WriteLine($"Temperature: {x:F1} deg C"));
plc.Value("TemperatureSetPoint", 72.5f);
Factory equivalent:
using IRxS7 plc = S71500.Create("192.168.1.100", rack: 0, slot: 1, interval: 100);
Addressing and data types
| Area | Examples | Notes |
|---|---|---|
| DB bit | DB1.DBX0.0, DB1.DBX4.7 |
Bit index must be 0-7. |
| DB byte | DB1.DBB0 |
byte, byte[], generated raw ranges. |
| DB word | DB1.DBW2 |
short, ushort. |
| DB double word | DB1.DBD4 |
int, uint, float; double uses 8 bytes from the start offset. |
| Inputs | I0.0, IB0, IW0, ID0; E aliases |
Input area. |
| Outputs | Q0.0, QB0, QW0, QD0; A aliases |
Output area. |
| Memory | M0.0, MB0, MW0, MD0 |
Marker memory. |
| Timers | T1 |
S7 timers. |
| Counters | C1, Z1 |
S7 counters. |
| S7 representation | C# type | Address example | Bytes |
|---|---|---|---|
| BOOL | bool |
DB1.DBX0.0 |
bit in byte |
| BYTE | byte |
DB1.DBB1 |
1 |
| BYTE array | byte[] |
DB1.DBB100, arrayLength: 64 |
length |
| INT | short |
DB1.DBW2 |
2 |
| WORD | ushort |
DB1.DBW4 |
2 |
| DINT | int |
DB1.DBD6 |
4 |
| DWORD | uint |
DB1.DBD10 |
4 |
| REAL | float |
DB1.DBD14 |
4 |
| LREAL | double |
DB1.DBD18 |
8 |
| STRING | string |
DB1.DBB40 |
variable |
| Arrays | short[], ushort[], int[], uint[], float[], double[] |
first element address plus arrayLength |
element size x length |
Core tag API
Register tags:
TagOperations.AddUpdateTagItem(plc, typeof(float), "Temperature", "DB1.DBD0");
TagOperations.AddUpdateTagItem(plc, typeof(bool), "Running", "DB1.DBX4.0");
TagOperations.AddUpdateTagItem(plc, typeof(byte[]), "RecipeBytes", "DB10.DBB0", 64);
TagOperations.AddUpdateTagItem(plc, typeof(float[]), "Curve", "DB20.DBD0", 16);
Fluent registration and polling control:
TagOperations.AddUpdateTagItem(plc, typeof(float), "Temp1", "DB1.DBD0");
TagOperations.AddUpdateTagItem(plc, typeof(float), "Temp2", "DB1.DBD4");
TagOperations.AddUpdateTagItem(plc, typeof(bool), "Alarm", "DB1.DBX8.0")
.SetPolling(false); // disables polling for Alarm
TagOperations.GetTag(plc, "Temp1").SetPolling(false);
TagOperations.GetTag(plc, "Temp1").SetPolling(true);
TagOperations.RemoveTagItem(plc, "Temp1");
Tag stream projections:
using IoT.Driver.S7PlcRx;
using var dictionary = TagOperations.TagToDictionary(plc.ObserveAll)
.Subscribe(values => Console.WriteLine(values.Count));
using var namedValue = TagOperations.ToTagValue(
plc.Observe(new IoT.Driver.Core.LogicalTagKey<float>("Temperature")),
"Temperature")
.Subscribe(item => Console.WriteLine($"{item.Tag}={item.Value}"));
Reactive reading
using ReactiveUI.Primitives;
using IoT.Driver.Core;
using var highTemp = plc.Observe(new LogicalTagKey<float>("Temperature"))
.Where(x => x > 80.0f)
.Subscribe(x => Console.WriteLine($"High temperature: {x:F1}"));
using var sampledPressure = plc.Observe(new LogicalTagKey<float>("Pressure"))
.Sample(TimeSpan.FromSeconds(5))
.Subscribe(x => Console.WriteLine($"Pressure: {x:F2}"));
using var averageFlow = plc.Observe(new LogicalTagKey<float>("FlowRate"))
.Buffer(TimeSpan.FromMinutes(1))
.Where(values => values.Count > 0)
.Select(values => values.Average())
.Subscribe(avg => Console.WriteLine($"Average flow: {avg:F2}"));
Connection and diagnostic streams:
plc.IsConnected.Subscribe(x => Console.WriteLine($"Connected: {x}"));
plc.LastError.Subscribe(Console.WriteLine);
plc.LastErrorCode.Subscribe(code => Console.WriteLine($"Error code: {code}"));
plc.Status.Subscribe(Console.WriteLine);
plc.IsPaused.Subscribe(paused => Console.WriteLine($"Paused: {paused}"));
plc.ReadTime.Subscribe(ticks => Console.WriteLine($"Read ticks: {ticks}"));
CPU information:
using ReactiveUI.Primitives;
var cpuInfo = await plc.GetCpuInfo().FirstAsync();
Console.WriteLine($"AS name: {cpuInfo[0]}, Module: {cpuInfo[1]}");
Manual reads and writes
using IoT.Driver.Core;
var temperature = await plc.ReadAsync(new LogicalTagKey<float>("Temperature"));
using var cts = new CancellationTokenSource(TimeSpan.FromSeconds(2));
var pressure = await plc.ReadAsync(new LogicalTagKey<float>("Pressure"), cts.Token);
plc.Value("SetPoint", 72.5f);
plc.Value("Enabled", true);
plc.Value("RecipeNumber", (short)12);
plc.Value("RecipeBytes", new byte[] { 0x01, 0x02, 0x03 });
Watchdog:
var options = new RxS7Options(
new S7ConnectionOptions(CpuType.S71500, "192.168.1.100", rack: 0, slot: 1),
new S7PollingOptions(intervalMilliseconds: 100),
new S7WatchdogOptions("DB100.DBW0", valueToWrite: 4500, intervalSeconds: 10));
using var plcWithWatchdog = new RxS7(options);
plcWithWatchdog.ShowWatchDogWriting = true;
Batch, async, and optimized APIs
Advanced batch helpers:
using IoT.Driver.S7PlcRx.Advanced;
var values = await AdvancedExtensions.ValueBatchAsync(plc, default(float), "Temp1", "Temp2", "Temp3");
await AdvancedExtensions.ValueBatchAsync(plc, new Dictionary<string, float>
{
["SetPoint1"] = 70.0f,
["SetPoint2"] = 75.0f,
});
using var batchSub = AdvancedExtensions.ObserveBatch(plc, default(float), "Temp1", "Temp2")
.Subscribe(snapshot => Console.WriteLine(snapshot.Count));
Dictionary batch helpers:
var tagMap = new Dictionary<string, string>
{
["Temperature"] = "DB1.DBD0",
["Pressure"] = "DB1.DBD4",
};
var read = await AdvancedExtensions.ReadBatchOptimizedAsync(plc, default(float), tagMap, timeoutMs: 5000);
var write = await AdvancedExtensions.WriteBatchOptimizedAsync(plc,
new Dictionary<string, float> { ["Temperature"] = 22.5f },
verifyWrites: false,
enableRollback: false);
Async-first ValueTask helpers:
using IoT.Driver.S7PlcRx.Advanced;
using var readCancellation = new CancellationTokenSource(TimeSpan.FromSeconds(2));
var current = await AsyncExtensions.ReadValueAsync(plc, default(float), "Temperature", readCancellation.Token);
var many = await AsyncExtensions.ReadValuesAsync(
plc, default(float), new[] { "Temp1", "Temp2" }, readCancellation.Token);
await AsyncExtensions.WriteValuesAsync(plc, new Dictionary<string, float>
{
["SetPoint1"] = 72.5f,
["SetPoint2"] = 73.0f,
}, readCancellation.Token);
.NET 8+ async observable helpers:
using ReactiveUI.Primitives.Async;
using ReactiveUI.Primitives.Async.Advanced;
using IoT.Driver.S7PlcRx.Advanced;
var observer = new CallbackWitnessAsync<float>(
async (value, cancellationToken) =>
{
Console.WriteLine($"Async temperature: {value}" );
await Task.CompletedTask;
},
static (error, cancellationToken) => ValueTask.FromException(error),
static result => ValueTask.CompletedTask);
await using var sub = await AsyncExtensions.ObserveValue(plc, default(float), "Temperature")
.SubscribeAsync(
observer,
CancellationToken.None);
Source generator property binding
IoT-Driver.S7PlcRx.Generators generates PLC-bound properties from attributes. It removes repetitive tag registration, polling assignment, and setter write hooks.
Generated compile-time attributes
The generator injects this namespace into the consuming compilation:
namespace IoT.Driver.S7PlcRx.SourceGeneration;
[AttributeUsage(AttributeTargets.Class)]
public sealed class S7PlcBindingAttribute : Attribute;
[AttributeUsage(AttributeTargets.Property)]
public sealed class S7TagAttribute : Attribute
{
public S7TagAttribute(string address);
public string Address { get; }
public int PollIntervalMs { get; set; } = 100;
public S7TagDirection Direction { get; set; } = S7TagDirection.ReadWrite;
public int ArrayLength { get; set; } = 1;
}
public enum S7TagDirection
{
ReadWrite,
ReadOnly,
WriteOnly
}
Generated binding example
using IoT.Driver.S7PlcRx;
using IoT.Driver.S7PlcRx.SourceGeneration;
[S7PlcBinding]
public partial class MachineTags
{
[S7Tag("DB1.DBD0", PollIntervalMs = 100)]
public partial float Temperature { get; set; }
[S7Tag("DB1.DBX4.0", PollIntervalMs = 100)]
public partial bool Running { get; set; }
[S7Tag("DB1.DBW6", PollIntervalMs = 250, Direction = S7TagDirection.ReadOnly)]
public partial short ActualSpeed { get; set; }
[S7Tag("DB1.DBD8", Direction = S7TagDirection.WriteOnly)]
public partial float SetPoint { get; set; }
}
using IRxS7 plc = S71500.Create("192.168.1.100");
var tags = new MachineTags();
using var binding = tags.Bind(plc);
tags.SetPoint = 72.5f; // queues a PLC write
Reactive package source-generator usage is the same shape with reactive namespaces:
using IoT.Driver.S7PlcRx.Reactive;
using IoT.Driver.S7PlcRx.Reactive.SourceGeneration;
[S7PlcBinding]
public partial class ReactiveMachineTags
{
[S7Tag("DB1.DBD0", PollIntervalMs = 100)]
public partial float Temperature { get; set; }
}
using IRxS7 plc = S71500.Create("192.168.1.100", rack: 0, slot: 1, interval: 100);
var tags = new ReactiveMachineTags();
using var binding = tags.Bind(plc);
Generator rules and behavior
- The class must be
partialand marked with[S7PlcBinding]. - Each bound property must be
partialand marked with[S7Tag("...")]. - The generator emits backing fields, property implementations, a write hook, a read-apply hook, and
IDisposable Bind(IRxS7 plc). - Property setters call the runtime write hook when the value changes.
- PLC reads update backing fields without creating write-back loops.
PollIntervalMs > 0enables interval reads;PollIntervalMs = 0disables interval reads.ReadOnlydisables property writes;WriteOnlydisables interval reads;ReadWriteenables both.ArrayLengthdefines array/string/byte range length.- Generated byte-array batching supports DB addresses:
DBX,DBB,DBW,DBD.
Efficient byte-array DB grouping
For same-DB nearby tags, the runtime reads one DB byte range and decodes properties locally:
DB1.DBD0 Temperature float bytes 0..3
DB1.DBD4 Pressure float bytes 4..7
DB1.DBX8.0 Running bool byte 8 bit 0
Runtime range tag:
TagOperations.AddUpdateTagItem(plc, typeof(byte[]), "__s7_binding_db1_0_9", "DB1.DBB0", 9);
Writes are coalesced on a short flush timer. The runtime performs read-modify-write byte-array writes so unrelated bytes/bits in the same range are preserved.
Manual runtime binding API
using IoT.Driver.S7PlcRx.Binding;
var definitions = new[]
{
new S7TagDefinition("Temperature", "DB1.DBD0", typeof(float), 100, S7TagDirection.ReadWrite),
new S7TagDefinition("Running", "DB1.DBX4.0", typeof(bool), 100, S7TagDirection.ReadWrite),
};
using var runtime = S7TagRuntimeBinding.Bind(
plc,
definitions,
(name, value) => Console.WriteLine($"{name}={value}"));
runtime.Write("Temperature", 25.5f);
Performance and cache features
using IoT.Driver.S7PlcRx.Optimization;
using IoT.Driver.S7PlcRx.Performance;
var cached = await OptimizationExtensions.ValueCachedAsync(
plc, "Temperature", fallbackValue: default(float), cacheTimeout: TimeSpan.FromSeconds(1));
var cacheStats = OptimizationExtensions.GetCacheStatistics(plc);
OptimizationExtensions.ClearCache(plc, "Temperature");
using var smart = OptimizationExtensions.MonitorTagSmart(
plc, "Temperature", EqualityComparer<float>.Default, changeThreshold: 0.5, debounceMs: 100)
.Subscribe(change => Console.WriteLine($"{change.TagName}: {change.PreviousValue} -> {change.CurrentValue}"));
using var perf = PerformanceExtensions.MonitorPerformance(plc, TimeSpan.FromSeconds(30))
.Subscribe(metrics => Console.WriteLine($"{metrics.OperationsPerSecond:F1} ops/sec"));
var optimizedReads = await PerformanceExtensions.ReadOptimizedAsync(
plc, new[] { "Temp1", "Temp2" }, typeMarker: default(float), optimizationConfig: null);
var optimizedWrite = await PerformanceExtensions.WriteOptimizedAsync(plc, new Dictionary<string, float>
{
["SetPoint1"] = 72.5f,
["SetPoint2"] = 73.0f,
}, optimizationConfig: null);
var benchmark = await PerformanceExtensions.RunBenchmarkAsync(plc, new BenchmarkConfig
{
LatencyTestCount = 10,
ThroughputTestDuration = TimeSpan.FromSeconds(10),
ReliabilityTestCount = 20,
});
var stats = PerformanceExtensions.GetPerformanceStatistics(plc);
High-performance tag groups:
using IoT.Driver.S7PlcRx.Advanced;
using IoT.Driver.S7PlcRx.Performance;
using var group = AdvancedExtensions.CreateTagGroup(plc, default(float), "Process", "Temperature", "Pressure", "Flow");
using var groupSub = group.ObserveGroup().Subscribe(snapshot => Console.WriteLine(snapshot.Count));
var allValues = await group.ReadAllAsync();
await group.WriteAllAsync(new Dictionary<string, float>
{
["Temperature"] = 21.0f,
["Pressure"] = 1.2f,
});
Enterprise features
Symbol tables:
using IoT.Driver.S7PlcRx.Enterprise;
var csv = """
Name,Address,DataType,Length,Description
Temperature,DB1.DBD0,REAL,1,Process temperature
Running,DB1.DBX4.0,BOOL,1,Machine running
Recipe,DB10.DBB0,ARRAY,64,Recipe bytes
""";
var table = await EnterpriseExtensions.LoadSymbolTableAsync(plc, csv, SymbolTableFormat.Csv);
var temperature = await EnterpriseExtensions.ReadSymbolAsync(plc, "Temperature");
EnterpriseExtensions.WriteSymbol(plc, "Running", true);
High availability:
using IoT.Driver.S7PlcRx.Enterprise;
using IRxS7 primary = S71500.Create("192.168.1.100");
var backups = new List<IRxS7>
{
S71500.Create("192.168.1.101"),
S71500.Create("192.168.1.102"),
};
using var ha = EnterpriseExtensions.CreateHighAvailabilityConnection(primary, backups, TimeSpan.FromSeconds(10));
using var failoverSub = ha.FailoverEvents.Subscribe(evt => Console.WriteLine(evt.Reason));
IRxS7 active = ha.ActivePLC;
await ha.TriggerFailoverAsync();
Connection pool:
using IoT.Driver.S7PlcRx.Core;
using IoT.Driver.S7PlcRx.Enterprise;
using IoT.Driver.S7PlcRx.Enums;
using var pool = EnterpriseExtensions.CreateConnectionPool(
new[]
{
new PlcConnectionConfig
{
PLCType = CpuType.S71500,
IPAddress = "192.168.1.100",
Rack = 0,
Slot = 1,
ConnectionName = "Line1Primary",
},
},
new ConnectionPoolConfig
{
MaxConnections = 10,
EnableConnectionReuse = true,
HealthCheckInterval = TimeSpan.FromMinutes(1),
});
IRxS7 connection = pool.Connection;
Production reliability and diagnostics
using IoT.Driver.Core;
using IoT.Driver.S7PlcRx.Advanced;
using IoT.Driver.S7PlcRx.Production;
var diagnostics = await AdvancedExtensions.GetDiagnosticsAsync(plc);
Console.WriteLine($"Connected: {diagnostics.IsConnected}, latency: {diagnostics.ConnectionLatencyMs:F0} ms");
var analysis = await AdvancedExtensions.AnalyzePerformanceAsync(plc, TimeSpan.FromMinutes(5));
Console.WriteLine($"Total changes: {analysis.TotalTagChanges}" );
var validation = await ProductionExtensions.ValidateProductionReadinessAsync(plc, new ProductionValidationConfig
{
MaxAcceptableResponseTime = TimeSpan.FromMilliseconds(500),
MinimumReliabilityRate = 0.95,
ReliabilityTestCount = 10,
MinimumProductionScore = 80.0,
});
var result = await ProductionExtensions.ExecuteWithErrorHandlingAsync(
plc,
() => plc.ReadAsync(new LogicalTagKey<float>("CriticalSensor")),
new ProductionErrorConfig
{
MaxRetryAttempts = 3,
BaseRetryDelayMs = 1000,
UseExponentialBackoff = true,
CircuitBreakerThreshold = 5,
CircuitBreakerTimeout = TimeSpan.FromMinutes(1),
});
var handler = ProductionExtensions.EnableProductionErrorHandling(plc, new ProductionErrorConfig());
var guarded = await handler.ExecuteAsync(() => plc.ReadAsync(new LogicalTagKey<float>("Temperature")));
PLC type conversion helpers
All conversion helpers use Siemens S7 byte ordering and are useful for codecs, tests, and generated/runtime byte-array binding logic.
| Type/helper | Purpose | Common functions |
|---|---|---|
Bit |
Bit extraction/mutation from byte spans | FromByte, FromSpan, ToBitArray, SetBit, GetBits, SetBits |
Boolean |
Single byte bit helpers | GetValue, SetBit, ClearBit |
Byte |
Byte conversion | ToByteArray, ToSpan, FromByteArray, FromSpan |
ByteArray |
Growable pooled byte buffer | Add, Clear, TryCopyTo, Span, Memory, Array, Length |
Int / Word |
16-bit signed/unsigned | FromByteArray, FromSpan, ToArray, ToByteArray, ToSpan |
DInt / DWord |
32-bit signed/unsigned | FromByteArray, FromSpan, ToArray, ToByteArray, ToSpan |
Real / LReal |
32/64-bit floating point | FromByteArray, FromSpan, ToArray, ToByteArray, ToSpan |
Counter / Timer |
S7 counter/timer formats | FromByteArray, FromSpan, ToArray, ToByteArray, ToSpan |
DateTime / DateTimeLong |
S7 date/time formats | FromByteArray, FromSpan, ToArray, ToByteArray, ToSpan |
TimeSpan |
S7 time span conversion | FromByteArray, FromSpan, ToArray, ToByteArray, ToSpan |
String, S7String, S7WString |
String encodings | FromByteArray, FromSpan, ToByteArray, ToSpan, TryToSpan |
Struct, Class |
Reflection-based complex type conversion | GetStructSize/GetClassSize, FromBytes, ToBytes |
using IoT.Driver.S7PlcRx.PlcTypes;
Span<byte> bytes = stackalloc byte[4];
Real.ToSpan(12.5f, bytes);
float roundTrip = Real.FromSpan(bytes);
Error handling
plc.LastError.Subscribe(message => Console.WriteLine(message));
plc.LastErrorCode.Subscribe(code => Console.WriteLine(code));
PlcExceptioncarries anErrorCodefor PLC communication failures.S7Exceptionis a general S7 exception type.TagAddressOutOfRangeExceptionis thrown for invalid tag addresses.- Production error handling adds retries and circuit-breaker behavior.
Full API examples and documentation map
The examples above cover the public API groups used by most applications. Use this map to find the detailed member reference and a working C# pattern for each group.
| API group | Main namespaces | Example section |
|---|---|---|
PLC factories, IRxS7, RxS7, tags, lifecycle |
IoT.Driver.S7PlcRx |
Quick start, Core tag API, lifecycle example below |
| Reactive streams and diagnostics | IoT.Driver.S7PlcRx, ReactiveUI.Primitives |
Reactive reading, R3 ReactiveUI.Primitives bridge |
| Manual reads, writes, cancellation | IoT.Driver.S7PlcRx |
Manual reads and writes, lifecycle example below |
| Batch and async observables | IoT.Driver.S7PlcRx.Advanced, ReactiveUI.Primitives.Async |
Batch, async, and optimized APIs |
| Source generator and runtime binding | IoT.Driver.S7PlcRx.SourceGeneration, IoT.Driver.S7PlcRx.Binding |
Source generator property binding |
| Optimization and cache | IoT.Driver.S7PlcRx.Optimization, IoT.Driver.S7PlcRx.Cache, IoT.Driver.S7PlcRx.Performance |
Performance and cache features, optimization config example below |
| Enterprise, symbols, failover, pooling | IoT.Driver.S7PlcRx.Enterprise, IoT.Driver.S7PlcRx.Core |
Enterprise features, connection pool example below |
| Production reliability | IoT.Driver.S7PlcRx.Production |
Production reliability and diagnostics |
| PLC type conversion | IoT.Driver.S7PlcRx.PlcTypes |
PLC type conversion helpers |
| Reactive shim package | IoT.Driver.S7PlcRx.Reactive.* |
Choosing S7PlcRx or S7PlcRx.Reactive |
Lifecycle and cancellation:
using ReactiveUI.Primitives;
using IoT.Driver.Core;
using IoT.Driver.S7PlcRx;
using IRxS7 plc = S71500.Create("192.168.1.100", rack: 0, slot: 1, interval: 100);
using var status = plc.Status.Subscribe(Console.WriteLine);
using var errors = plc.LastError.Subscribe(error => Console.WriteLine($"PLC error: {error}"));
using var cts = new CancellationTokenSource(TimeSpan.FromSeconds(2));
float? temperature = await plc.ReadAsync(new LogicalTagKey<float>("Temperature"), cts.Token);
Console.WriteLine($"Temperature: {temperature}");
// Dispose every subscription and cancellation source that the application owns.
// `using IRxS7` disposes the factory result through ICancelable/IDisposable.
Direct connection pool:
using IoT.Driver.S7PlcRx;
using IoT.Driver.S7PlcRx.Core;
using IoT.Driver.S7PlcRx.Enterprise;
using IoT.Driver.S7PlcRx.Enums;
using var pool = new ConnectionPool(
new[]
{
new PlcConnectionConfig
{
PLCType = CpuType.S71500,
IPAddress = "192.168.1.100",
Rack = 0,
Slot = 1,
ConnectionName = "Line1",
},
new PlcConnectionConfig
{
PLCType = CpuType.S71500,
IPAddress = "192.168.1.101",
Rack = 0,
Slot = 1,
ConnectionName = "Line2",
},
},
new ConnectionPoolConfig
{
MaxConnections = 2,
EnableLoadBalancing = true,
EnableConnectionReuse = true,
ConnectionTimeout = TimeSpan.FromSeconds(10),
});
IRxS7 selected = pool.Connection;
Console.WriteLine($"Pool active: {pool.ActiveConnections}/{pool.MaxConnections}");
Optimized read/write configuration:
using IoT.Driver.S7PlcRx.Optimization;
using IoT.Driver.S7PlcRx.Performance;
var readConfig = new ReadOptimizationConfig
{
EnableParallelReads = true,
MaxConcurrentReads = 4,
ReadTimeoutMs = 3000,
InterGroupDelayMs = 10,
};
var values = await PerformanceExtensions.ReadOptimizedAsync(
plc,
new[] { "Temperature", "Pressure", "Flow" },
typeMarker: default(float),
optimizationConfig: readConfig);
var writeConfig = new WriteOptimizationConfig
{
EnableParallelWrites = true,
VerifyWrites = true,
MaxConcurrentWrites = 2,
WriteTimeoutMs = 3000,
InterGroupDelayMs = 25,
};
var writeResult = await PerformanceExtensions.WriteOptimizedAsync(
plc,
new Dictionary<string, float>
{
["SetPoint1"] = 72.5f,
["SetPoint2"] = 73.0f,
},
writeConfig);
Console.WriteLine($"Wrote {writeResult.SuccessfulWrites.Count} tags in {writeResult.TotalDuration.TotalMilliseconds:F0} ms");
Diagnostics through public APIs:
using IoT.Driver.S7PlcRx.Advanced;
using IoT.Driver.S7PlcRx.Production;
var diagnostics = await AdvancedExtensions.GetDiagnosticsAsync(plc);
Console.WriteLine($"Connected: {diagnostics.IsConnected}");
Console.WriteLine($"Latency: {diagnostics.ConnectionLatencyMs:F1} ms");
foreach (var recommendation in diagnostics.Recommendations)
{
Console.WriteLine(recommendation);
}
Low-level socket transport is internal implementation detail. Use IRxS7 connection streams, performance metrics, production diagnostics, and connection pools for public monitoring and reliability code.
Public API reference
This section is generated from the public C# surface in src/S7PlcRx and src/S7PlcRx.Generators, then paired with the usage guidance above. It lists the core assembly type names; IoT-Driver.S7PlcRx.Reactive shares the same implementation and publishes the equivalent surface under IoT.Driver.S7PlcRx.Reactive.* namespaces.
Reactive namespace equivalents:
| Core namespace | Reactive package namespace |
|---|---|
IoT.Driver.S7PlcRx |
IoT.Driver.S7PlcRx.Reactive |
IoT.Driver.S7PlcRx.Advanced |
IoT.Driver.S7PlcRx.Reactive.Advanced |
IoT.Driver.S7PlcRx.BatchOperations |
IoT.Driver.S7PlcRx.Reactive.BatchOperations |
IoT.Driver.S7PlcRx.Binding |
IoT.Driver.S7PlcRx.Reactive.Binding |
IoT.Driver.S7PlcRx.Cache |
IoT.Driver.S7PlcRx.Reactive.Cache |
IoT.Driver.S7PlcRx.Core |
IoT.Driver.S7PlcRx.Reactive.Core |
IoT.Driver.S7PlcRx.Enterprise |
IoT.Driver.S7PlcRx.Reactive.Enterprise |
IoT.Driver.S7PlcRx.Enums |
IoT.Driver.S7PlcRx.Reactive.Enums |
IoT.Driver.S7PlcRx.Optimization |
IoT.Driver.S7PlcRx.Reactive.Optimization |
IoT.Driver.S7PlcRx.Performance |
IoT.Driver.S7PlcRx.Reactive.Performance |
IoT.Driver.S7PlcRx.PlcTypes |
IoT.Driver.S7PlcRx.Reactive.PlcTypes |
IoT.Driver.S7PlcRx.Production |
IoT.Driver.S7PlcRx.Reactive.Production |
IoT.Driver.S7PlcRx.SourceGeneration |
IoT.Driver.S7PlcRx.Reactive.SourceGeneration |
Source generator generated API
The source generator emits these compile-time-only types into consumer projects:
IoT.Driver.S7PlcRx.SourceGeneration.S7PlcBindingAttribute/IoT.Driver.S7PlcRx.Reactive.SourceGeneration.S7PlcBindingAttribute- marks apartial classfor PLC property binding generation.IoT.Driver.S7PlcRx.SourceGeneration.S7TagAttribute/IoT.Driver.S7PlcRx.Reactive.SourceGeneration.S7TagAttribute- marks apartialproperty with an S7 address; properties:Address,PollIntervalMs,Direction,ArrayLength.IoT.Driver.S7PlcRx.SourceGeneration.S7TagDirection/IoT.Driver.S7PlcRx.Reactive.SourceGeneration.S7TagDirection-ReadWrite,ReadOnly,WriteOnly.- Generated instance method:
public IDisposable Bind(IRxS7 plc)on each[S7PlcBinding]class.
Runtime public surface
<details open> <summary>All public types and members</summary>
Namespace IoT.Driver.S7PlcRx
IoT.Driver.S7PlcRx.IRxS7
Source: IRxS7.cs:19
Defines an interface for reactive communication with a Siemens S7 PLC, providing observable access to connection status, errors, tag values, and PLC information, as well as methods for reading and writing variables asynchronously. <remarks>The IRxS7 interface exposes members for monitoring and interacting with a PLC in a reactive manner using observables. It supports observing connection state, errors, and tag values, as well as reading and writing variables with optional cancellation support. Implementations are expected to handle connection management and provide up-to-date PLC information. Thread safety and subscription management depend on the specific implementation.</remarks>
| Member | Summary |
|---|---|
public string IP get; } |
Gets the IP address associated with the current instance. |
public IObservable<bool> IsConnected get; } |
Gets an observable sequence that indicates whether the connection is currently established. <remarks>Subscribers receive updates whenever the connection state changes. The sequence emits <see langword="true"/> when connected and <see langword="false"/> when disconnected.</remarks> |
public bool IsConnectedValue get; } |
Gets a value indicating whether the connection is currently established. |
public IObservable<string> LastError get; } |
Gets an observable sequence that provides error messages encountered during operation. <remarks>Subscribers receive error messages as they occur. The sequence completes when the underlying process completes or is disposed. No errors are pushed after completion.</remarks> |
public IObservable<ErrorCode> LastErrorCode get; } |
Gets an observable sequence that provides notifications of the most recent error code encountered by the component. <remarks>Subscribers receive updates whenever a new error occurs. The sequence completes when the component is disposed or no longer reports errors. Thread safety and emission timing depend on the implementation of the observable.</remarks> |
public IObservable<Tag?> ObserveAll get; } |
Gets an observable sequence that emits all tag updates as they occur. <remarks>Subscribers receive notifications for every tag, including additions, updates, and removals. The sequence emits a value of <see langword="null"/> when a tag is removed.</remarks> |
public CpuType PLCType get; } |
Gets the type of programmable logic controller (PLC) associated with this instance. |
public short Rack get; } |
Gets the rack number associated with the device or connection. |
public short Slot get; } |
Gets the slot number associated with the current instance. |
public IObservable<bool> IsPaused get; } |
Gets an observable sequence that indicates whether the operation is currently paused. <remarks>Subscribers receive a value of <see langword="true"/> when the operation is paused and <see langword="false"/> when it is active. The sequence emits updates whenever the paused state changes.</remarks> |
public IObservable<string> Status get; } |
Gets an observable sequence that provides status updates as strings. <remarks>Subscribers receive status notifications as they occur. The sequence may complete or error depending on the underlying implementation.</remarks> |
public Tags TagList get; } |
Gets the collection of tags associated with the current instance. |
public bool ShowWatchDogWriting get; set; } |
Gets or sets a value indicating whether WatchDog writing operations are displayed. |
public string? WatchDogAddress get; } |
Gets the network address of the WatchDog service, if configured. |
public ushort WatchDogValueToWrite get; set; } |
Gets or sets the value to be written to the watchdog register. |
public int WatchDogWritingTime get; } |
Gets the time interval, in milliseconds, used by the watchdog for writing operations. |
public IObservable<long> ReadTime get; } |
Gets an observable sequence that provides the current read time in ticks. <remarks>Subscribers receive updates whenever the read time changes. The value represents the number of ticks elapsed, where one tick equals 100 nanoseconds.</remarks> |
IObservable<T?> Observe<T>(LogicalTagKey<T> tag) |
Observes updates for a registered typed key. Construct new LogicalTagKey<T>(name) with the same CLR type used in registration. |
Task<T?> ReadAsync<T>(LogicalTagKey<T> tag) / ReadAsync<T>(LogicalTagKey<T>, CancellationToken) |
Performs a typed direct read. A null result means no compatible value was obtained; it is not a successful zero value. |
public void Value<T>(string? variable, T? value); |
Sets the value of a variable with the specified name and value. <typeparam name="T">The type of the value to assign to the variable.</typeparam> <param name="variable">The name of the variable to set. Can be null to indicate an unnamed or default variable.</param> <param name="value">The value to assign to the variable. Can be null if the variable type allows null values.</param> |
bool IsDisposed (inherited ICancelable lifecycle) |
IRxS7 is disposable through ICancelable; use using IRxS7 plc = ... or call Dispose when the connection is no longer needed. |
public IObservable<string[]> GetCpuInfo(); |
Retrieves an observable sequence containing information about the system's CPU. <remarks>Subscribers receive updates as the CPU information changes. The format and content of each string array may vary depending on the platform or implementation.</remarks> <returns>An observable sequence of string arrays, where each array contains details about the CPU. The sequence emits new arrays when CPU information is updated.</returns> |
IoT.Driver.S7PlcRx.ITag
Source: Tags/ITag.cs:9
Represents a tag that can be configured to control polling behavior.
| Member | Summary |
|---|---|
public void SetDoNotPoll(bool value); |
Sets whether the object should be excluded from polling operations. <param name="value">true to prevent the object from being polled; otherwise, false.</param> |
IoT.Driver.S7PlcRx.PlcException
Source: PlcException.cs:16
| Member | Summary |
|---|---|
public PlcException(ErrorCode errorCode) : this(errorCode, $"PLC communication failed with error '{errorCode}'.") |
Initializes a new instance of the <see cref="PlcException"/> class. <param name="errorCode">The error code.</param> |
public PlcException(ErrorCode errorCode, Exception? innerException) : this(errorCode, innerException?.Message, innerException) |
Initializes a new instance of the <see cref="PlcException"/> class. <param name="errorCode">The error code.</param> <param name="innerException">The inner exception.</param> |
public PlcException(ErrorCode errorCode, string? message) : base(message) => ... |
Initializes a new instance of the <see cref="PlcException"/> class. <param name="errorCode">The error code.</param> <param name="message">The message.</param> |
public PlcException(ErrorCode errorCode, string? message, Exception? inner) : base(message, inner) => ... |
Initializes a new instance of the <see cref="PlcException"/> class. <param name="errorCode">The error code.</param> <param name="message">The message.</param> <param name="inner">The inner.</param> |
public ErrorCode ErrorCode get; } |
Gets the error code. <value> The error code. </value> |
IoT.Driver.S7PlcRx.RxS7
Source: RxS7.cs:32
Provides an observable, reactive interface for reading from and writing to Siemens S7 PLCs, supporting tag-based access, status monitoring, and asynchronous operations. <remarks>The RxS7 class enables integration with Siemens S7 programmable logic controllers (PLCs) using a tag-based model and reactive programming patterns. It exposes observables for PLC data, connection status, errors, and operational metrics, allowing clients to subscribe to real-time updates. The class supports both synchronous and asynchronous read/write operations, as well as advanced features such as watchdog monitoring and batch variable access. Thread safety is maintained for concurrent operations. Dispose the instance when no longer needed to release resources and terminate background operations.</remarks>
| Member | Summary |
|---|---|
public RxS7(RxS7Options options) |
Initializes a new PLC connection from composed endpoint, polling, and optional watchdog settings. |
public IObservable<Tag?> ObserveAll => ... |
Gets an observable sequence that emits all tag updates as they occur. <remarks>Each observer receives tag updates in real time as they are published. The sequence is shared among all subscribers, and subscriptions are managed automatically. Observers may receive null values if a tag is removed or unavailable.</remarks> |
public IObservable<bool> IsPaused => ... |
Gets an observable sequence that indicates whether the operation is currently paused. <remarks>The returned observable emits a value of <see langword="true"/> when the operation enters a paused state, and <see langword="false"/> when it resumes. Subscribers receive updates only when the paused state changes. The sequence is shared among all subscribers.</remarks> |
public string IP get; } |
Gets the IP address associated with the current instance. |
public IObservable<bool> IsConnected get; } |
Gets an observable sequence that indicates whether the connection is currently established. <remarks>Subscribers receive updates whenever the connection state changes. The sequence emits <see langword="true"/> when connected and <see langword="false"/> when disconnected.</remarks> |
public bool IsConnectedValue get; private set; } |
Gets a value indicating whether the connection is currently established. |
public IObservable<string> LastError => ... |
Gets an observable sequence that provides the most recent error messages encountered by the component. <remarks>Subscribers receive error messages as they occur. The sequence is shared among all subscribers, and each subscriber receives messages from the point of subscription onward.</remarks> |
public IObservable<ErrorCode> LastErrorCode => ... |
Gets an observable sequence that emits the most recent error code reported by the system. <remarks>Subscribers receive updates whenever a new error code is reported. The sequence is shared among all subscribers and only remains active while there is at least one active subscription.</remarks> |
public CpuType PLCType get; } |
Gets the type of PLC (Programmable Logic Controller) associated with this instance. |
public short Rack get; } |
Gets the rack number associated with the device or component. |
public bool ShowWatchDogWriting get; set; } |
Gets or sets a value indicating whether WatchDog writing output is displayed. |
public short Slot get; } |
Gets the slot number associated with this instance. |
public IObservable<string> Status => ... |
Gets an observable sequence that provides status updates as strings. <remarks>Subscribers receive status updates as they occur. The observable sequence is shared among all subscribers, and subscriptions are managed automatically. Status updates are pushed to observers in real time.</remarks> |
public Tags TagList get; } = []; |
Gets the collection of tags associated with the current instance. |
public string? WatchDogAddress get; } |
Gets the network address of the WatchDog service, if configured. |
public ushort WatchDogValueToWrite get; set; } = 4500; |
Gets or sets the value to be written to the watchdog timer. |
public int WatchDogWritingTime get; } = 10; |
Gets the interval, in seconds, that the watchdog uses when writing status updates. |
public bool IsDisposed get; private set; } |
Gets a value indicating whether gets a value that indicates whether the object is disposed. |
public IObservable<long> ReadTime => ... |
Gets an observable sequence that emits the current read time in ticks whenever a read operation occurs. <remarks>The observable sequence is shared among all subscribers. Each subscriber receives notifications when a read operation is performed, with the value representing the read time in ticks. The sequence completes when the underlying source completes.</remarks> |
public IObservable<T?> Observe<T>(LogicalTagKey<T> tag) |
Typed observable surface; tag-name overloads were removed. |
public Task<T?> ReadAsync<T>(LogicalTagKey<T> tag) / ReadAsync<T>(LogicalTagKey<T>, CancellationToken) |
Typed direct read surface; use the cancellation overload for caller-controlled timeouts. |
public void Value<T>(string? variable, T? value) |
Sets the value of the specified variable if it exists and the value is compatible with the variable's type. <remarks>If the variable does not exist or the value is null, this method does nothing. The value is only set if its type matches the variable's expected type or if the type parameter is object.</remarks> <typeparam name="T">The type of the value to assign to the variable.</typeparam> <param name="variable">The name of the variable whose value is to be set. Cannot be null.</param> <param name="value">The value to assign to the variable. Must be compatible with the variable's type.</param> |
public void Dispose() |
Performs application-defined tasks associated with freeing, releasing, or resetting unmanaged resources. |
public IObservable<string[]> GetCpuInfo() => ... |
Retrieves detailed information about the connected CPU as an observable sequence. <remarks>The method waits until a connection is established before retrieving CPU information. If the required data is not immediately available, the method will retry until successful or until the subscription is disposed. The order and content of the returned string array correspond to specific CPU information fields. This method is intended for use in reactive programming scenarios where CPU information is needed asynchronously.</remarks> <returns>An observable sequence that emits a string array containing CPU information fields, such as the AS name, module name, copyright, serial number, module type name, order code, and version numbers. The sequence completes after emitting the data.</returns> |
IoT.Driver.S7PlcRx.S71200
Source: Create/S71200.cs:9
Provides factory methods for creating connections to Siemens S7-1200 PLC devices.
| Member | Summary |
|---|---|
public static IRxS7 Create(string ip, short rack = 0, string? watchDogAddress = null, double interval = 100, ushort watchDogValueToWrite = 4500, int watchDogInterval = 100) |
Creates a new instance of an S7 PLC connection with the specified configuration parameters. <param name="ip">The IP address of the S7 PLC to connect to.</param> <param name="rack">The rack number of the PLC. Must be between 0 and 7. The default is 0.</param> <param name="watchDogAddress">The address of the watchdog variable in the PLC memory. If null, the watchdog feature is disabled.</param> <param name="interval">The polling interval, in milliseconds, for reading data from the PLC. The default is 100 milliseconds.</param> <param name="watchDogValueToWrite">The value to write to the watchdog variable, if specified. The default is 4500.</param> <param name="watchDogInterval">The interval, in milliseconds, at which the watchdog value is written. The default is 100 milliseconds.</param> <returns>An object implementing the IRxS7 interface that represents the configured PLC connection.</returns> <exception cref="ArgumentOutOfRangeException">Thrown if the value of rack is less than 0 or greater than 7.</exception> |
IoT.Driver.S7PlcRx.S71500
Source: Create/S71500.cs:9
Provides factory methods for creating connections to Siemens S7-1500 PLC devices.
| Member | Summary |
|---|---|
public static IRxS7 Create(string ip, short rack = 0, short slot = 1, string? watchDogAddress = null, double interval = 100, ushort watchDogValueToWrite = 4500, int watchDogInterval = 10) |
Creates a new instance of an S7 PLC client configured for the specified IP address, rack, slot, and optional watchdog monitoring. <remarks>If <paramref name="watchDogAddress"/> is specified, the client will periodically write <paramref name="watchDogValueToWrite"/> to the given address at the specified <paramref name="watchDogInterval"/>. This can be used to implement a heartbeat or keep-alive mechanism with the PLC.</remarks> <param name="ip">The IP address of the S7 PLC to connect to.</param> <param name="rack">The rack number of the PLC. Must be between 0 and 7.</param> <param name="slot">The slot number of the PLC CPU module. Must be between 1 and 31.</param> <param name="watchDogAddress">The address of the watchdog variable in the PLC memory to monitor. If null, watchdog monitoring is disabled.</param> <param name="interval">The polling interval, in milliseconds, for communication with the PLC. Must be positive.</param> <param name="watchDogValueToWrite">The value to write to the watchdog variable when monitoring is enabled.</param> <param name="watchDogInterval">The interval, in seconds, at which the watchdog value is written. Must be positive.</param> <returns>An IRxS7 instance configured to communicate with the specified S7 PLC and optional watchdog monitoring.</returns> <exception cref="ArgumentOutOfRangeException">Thrown when the value of <paramref name="rack"/> is not between 0 and 7, or <paramref name="slot"/> is not between 1 and 31.</exception> |
IoT.Driver.S7PlcRx.S7200
Source: Create/S7200.cs:9
Provides factory methods for creating connections to Siemens S7-200 PLC devices.
| Member | Summary |
|---|---|
public static IRxS7 Create(string ip, short rack, short slot, string? watchDogAddress = null, double interval = 100, ushort watchDogValueToWrite = 4500, int watchDogInterval = 100) => ... |
Creates a new instance of an S7-200 PLC client for communication over TCP/IP with optional watchdog monitoring. <remarks>If a watchdog address is specified, the client will periodically write the specified value to the PLC at the given interval to support connection monitoring or fail-safe logic. Ensure that the PLC is configured to handle the watchdog mechanism as expected.</remarks> <param name="ip">The IP address of the S7-200 PLC to connect to. Cannot be null or empty.</param> <param name="rack">The rack number of the PLC CPU module. Typically 0 for S7-200 devices.</param> <param name="slot">The slot number of the PLC CPU module. Typically 0 or 1 for S7-200 devices.</param> <param name="watchDogAddress">The address in the PLC memory to use for the watchdog mechanism, or null to disable watchdog monitoring.</param> <param name="interval">The polling interval, in milliseconds, for regular communication with the PLC. Must be greater than 0.</param> <param name="watchDogValueToWrite">The value to write to the watchdog address during each watchdog cycle.</param> <param name="watchDogInterval">The interval, in milliseconds, at which the watchdog value is written. Must be greater than 0.</param> <returns>An IRxS7 instance configured to communicate with the specified S7-200 PLC, with optional watchdog monitoring enabled.</returns> |
IoT.Driver.S7PlcRx.S7300
Source: Create/S7300.cs:9
Provides factory methods for creating connections to Siemens S7-300 PLC devices.
| Member | Summary |
|---|---|
public static IRxS7 Create(string ip, short rack, short slot, string? watchDogAddress = null, double interval = 100, ushort watchDogValueToWrite = 4500, int watchDogInterval = 100) |
Creates a new instance of an S7 PLC connection with the specified configuration parameters. <param name="ip">The IP address of the S7 PLC to connect to.</param> <param name="rack">The rack number of the PLC. Must be between 0 and 7, inclusive.</param> <param name="slot">The slot number of the PLC. Must be between 1 and 31, inclusive.</param> <param name="watchDogAddress">The address in the PLC memory to use for the watchdog mechanism, or null to disable the watchdog.</param> <param name="interval">The polling interval, in milliseconds, for communication with the PLC. Must be greater than 0.</param> <param name="watchDogValueToWrite">The value to write to the watchdog address during each interval.</param> <param name="watchDogInterval">The interval, in milliseconds, at which the watchdog value is written. Must be greater than 0.</param> <returns>An object implementing the IRxS7 interface that represents the configured PLC connection.</returns> <exception cref="ArgumentOutOfRangeException">Thrown when the value of <paramref name="rack"/> is not between 0 and 7, or when the value of <paramref name="slot"/> is not between 1 and 31.</exception> |
IoT.Driver.S7PlcRx.S7400
Source: Create/S7400.cs:9
Provides factory methods for creating S7-400 PLC connections.
| Member | Summary |
|---|---|
public static IRxS7 Create(string ip, short rack, short slot, string? watchDogAddress = null, double interval = 100, ushort watchDogValueToWrite = 4500, int watchDogInterval = 100) |
Creates a new instance of an S7 PLC client configured for the specified IP address, rack, slot, and optional watchdog monitoring parameters. <remarks>If watchdog monitoring is enabled by specifying a non-null watchDogAddress, the client will periodically write the specified value to the given address at the defined interval. This can be used to implement a heartbeat or keep-alive mechanism with the PLC.</remarks> <param name="ip">The IP address of the S7 PLC to connect to.</param> <param name="rack">The rack number of the PLC. Must be between 0 and 7.</param> <param name="slot">The slot number of the PLC CPU. Must be between 1 and 31.</param> <param name="watchDogAddress">The address in the PLC memory to use for the watchdog mechanism, or null to disable watchdog monitoring.</param> <param name="interval">The polling interval, in milliseconds, for reading data from the PLC. Must be greater than 0.</param> <param name="watchDogValueToWrite">The value to write to the watchdog address during each interval if watchdog monitoring is enabled.</param> <param name="watchDogInterval">The interval, in milliseconds, at which the watchdog value is written if watchdog monitoring is enabled. Must be greater than 0.</param> <returns>An IRxS7 instance configured to communicate with the specified S7 PLC and optional watchdog monitoring.</returns> <exception cref="ArgumentOutOfRangeException">Thrown if rack is not between 0 and 7, or if slot is not between 1 and 31.</exception> |
IoT.Driver.S7PlcRx.S7Exception
Source: S7Exception.cs:13
| Member | Summary |
|---|---|
public S7Exception() |
Initializes a new instance of the <see cref="S7Exception"/> class. |
public S7Exception(string message) : base(message) |
Initializes a new instance of the <see cref="S7Exception"/> class. <param name="message">The message that describes the error.</param> |
public S7Exception(string message, Exception innerException) : base(message, innerException) |
Initializes a new instance of the <see cref="S7Exception"/> class. <param name="message">The error message that explains the reason for the exception.</param> <param name="innerException">The exception that is the cause of the current exception, or a null reference (<see langword="Nothing" /> in Visual Basic) if no inner exception is specified.</param> |
IoT.Driver.S7PlcRx.Tag
Source: Tags/Tag.cs:15
| Member | Summary |
|---|---|
public Tag() |
Initializes a new instance of the <see cref="Tag"/> class. |
public Tag(string address, Type type) |
Initializes a new instance of the <see cref="Tag" /> class. <param name="address">The address.</param> <param name="type">The type.</param> |
public Tag(string address, Type type, int arrayLength) |
Initializes a new instance of the <see cref="Tag"/> class. <param name="address">The address.</param> <param name="type">The type.</param> <param name="arrayLength">Length of the array.</param> |
public Tag(string name, string address, Type type) |
Initializes a new instance of the <see cref="Tag" /> class. <param name="name">The name.</param> <param name="address">The address.</param> <param name="type">The type.</param> |
public Tag(string name, string address, Type type, int arrayLength) |
Initializes a new instance of the <see cref="Tag"/> class. <param name="name">The name.</param> <param name="address">The address.</param> <param name="type">The type.</param> <param name="arrayLength">Length of the array.</param> |
public Tag(string name, string address, object value, Type type) |
Initializes a new instance of the <see cref="Tag" /> class. <param name="name">The name.</param> <param name="address">The address.</param> <param name="value">The value.</param> <param name="type">The type.</param> |
public string? Address get; set; } |
Gets or sets the address associated with the entity. |
public string? Name get; set; } |
Gets or sets the name associated with the object. |
public object? Value get; set; } |
Gets or sets the value associated with this instance. |
public object? NewValue get; internal set; } |
Gets the new value associated with the change event. |
public Type Type get; internal set; } |
Gets the runtime type information associated with the current instance. |
public int? ArrayLength get; internal set; } |
Gets the length of the array, if known. |
public bool DoNotPoll get; internal set; } |
Gets a value indicating whether polling operations should be suppressed for this instance. |
public void SetDoNotPoll(bool value) => ... |
Sets a value indicating whether polling operations should be disabled. <param name="value">true to disable polling; otherwise, false.</param> |
IoT.Driver.S7PlcRx.TagAddressOutOfRangeException
Source: Tags/TagAddressOutOfRangeException.cs:15
No public instance/static members declared directly on this type.
IoT.Driver.S7PlcRx.TagOperations
Source: Tags/TagOperations.cs
Provides static operations for registering, retrieving, removing, and projecting S7 tags. Register through TagOperations and retain the returned TagRegistration when polling configuration is required.
| Member | Summary |
|---|---|
TagOperations.AddUpdateTagItem(IRxS7, Type, string, string[, int]) |
Static registration with scalar, fixed-length, and nullable-length overloads; returns TagRegistration. |
TagRegistration.SetPolling() / SetPolling(bool) |
Enables or disables polling for the registration returned by TagOperations.AddUpdateTagItem or GetTag; this is the current replacement for the removed tuple helper. |
TagOperations.GetTag(IRxS7, string) |
Returns a TagRegistration; its Tag is null when no tag is registered. |
TagOperations.RemoveTagItem(IRxS7, string) |
Removes a named registration from a concrete RxS7 instance. |
TagOperations.TagToDictionary(IObservable<Tag?>) |
Produces dictionary snapshots of all non-null tag values. |
TagOperations.ToTagValue<T>(IObservable<T?>, string) |
Associates each non-null typed value with the supplied tag name. |
IoT.Driver.S7PlcRx.Tags
Source: Tags/Tags.cs:18
| Member | Summary |
|---|---|
public Tags() |
Initializes a new instance of the <see cref="Tags"/> class. |
public object? this[object key, bool isEnd = false] #pragma warning restore RCS1163 // Unused parameter. |
|
public Tag? this[string name] => ... |
Gets the tag with the specified name, if it exists. <param name="name">The name of the tag to retrieve. The comparison may be case-sensitive depending on the implementation.</param> <returns>The tag associated with the specified name, or null if no tag with that name exists.</returns> |
public Tag? this[Tag? tag] => ... |
Gets the tag from the collection that matches the specified tag's name, if present. <remarks>This indexer performs a lookup based on the name of the provided tag. If the specified tag is null, the result is null.</remarks> <param name="tag">The tag whose name is used to locate the corresponding tag in the collection. Can be null.</param> <returns>The tag from the collection that has the same name as the specified tag, or null if no such tag exists.</returns> |
public new void Add(object key, object value) |
Adds an element with the specified key and value to the collection in a thread-safe manner. <remarks>This method ensures that the add operation is thread-safe. If an element with the same key already exists, an exception is thrown.</remarks> <param name="key">The key of the element to add. Cannot be null.</param> <param name="value">The value of the element to add. Can be null.</param> |
public void Add(object key, Tag tag) |
Adds the specified tag to the collection with the associated key. <remarks>If the collection already contains an element with the same key, an exception may be thrown depending on the underlying implementation. This method is thread-safe.</remarks> <param name="key">The key with which the specified tag is to be associated. Cannot be null.</param> <param name="tag">The tag to add to the collection. Cannot be null.</param> |
public void Add(Tag tag) |
Adds the specified tag to the collection. <param name="tag">The tag to add to the collection. Cannot be null.</param> |
public void Add(object key, Tags tags) |
Adds the specified key and associated tags to the collection. <param name="key">The key with which the specified tags are to be associated. Cannot be null.</param> <param name="tags">The tags to associate with the specified key. Cannot be null.</param> |
public void AddRange(IEnumerable<Tag> tags) |
Adds a collection of tags to the current instance, including only those tags whose values are not null. <param name="tags">The collection of <see cref="Tag"/> objects to add. Only tags with non-null values are added.</param> <exception cref="ArgumentNullException">Thrown if <paramref name="tags"/> is null.</exception> |
public Tags GetTags() |
Retrieves a collection of tags that have non-null values. <returns>A <see cref="Tags"/> collection containing all tags with non-null values. The collection will be empty if no such tags exist.</returns> |
public List<Tag> ToList() |
Returns a list containing all tags in the collection. <remarks>The returned list is a snapshot of the collection at the time of the call. Subsequent modifications to the collection are not reflected in the returned list. This method is thread-safe.</remarks> <returns>A list of <see cref="Tag"/> objects representing the tags in the collection. The list is empty if the collection contains no tags or if an error occurs while retrieving the tags.</returns> |
Namespace IoT.Driver.S7PlcRx.Advanced
IoT.Driver.S7PlcRx.Advanced.AdvancedExtensions
Source: Advanced/AdvancedExtensions.cs:22
Provides advanced extension methods for efficient batch operations, diagnostics, and performance analysis on PLC (Programmable Logic Controller) instances using the IRxS7 interface. <remarks>These extension methods enable high-performance reading, writing, monitoring, and analysis of PLC variables, supporting scenarios such as batch updates, optimized data access, and system diagnostics. Methods are designed to simplify complex PLC interactions and provide recommendations for optimization. All methods require a valid IRxS7 instance and may throw exceptions if invalid arguments are supplied. Thread safety and performance considerations are addressed where relevant in individual method documentation.</remarks>
Current V3 names. Use the
*Asyncstatic methods below. Earlier migration drafts used extension-style, non-Async names; those names are not part of the current public surface.
| Current member | Required arguments and result |
|---|---|
AdvancedExtensions.ObserveBatch<T> |
(IRxS7 plc, T typeValue, params string[] variables) returns observable snapshots. |
AdvancedExtensions.ValueBatchAsync<T> |
(IRxS7 plc, T typeValue, params string[] variables) reads; (IRxS7 plc, Dictionary<string,T> values) writes. |
AdvancedExtensions.ReadBatchOptimizedAsync<T> |
(IRxS7 plc, T typeValue, Dictionary<string,string> tagMapping, int timeoutMs) returns per-tag BatchReadResult<T>. |
AdvancedExtensions.WriteBatchOptimizedAsync<T> |
(IRxS7 plc, Dictionary<string,T> values, bool verifyWrites, bool enableRollback) returns BatchWriteResult. |
AdvancedExtensions.GetDiagnosticsAsync / AnalyzePerformanceAsync |
Accept IRxS7; analysis also accepts the observation duration. |
AdvancedExtensions.CreateTagGroup<T> |
(IRxS7 plc, T typeValue, string groupName, params string[] tagNames) creates a disposable group. |
| Member | Summary |
|---|---|
AdvancedExtensions.ObserveBatch<T>(IRxS7 plc, T typeValue, params string[] variables) |
Produces batch snapshots and enables polling for newly registered tags. Pass a marker such as default(float) so the compiler can infer T. |
AdvancedExtensions.ValueBatchAsync<T>(IRxS7 plc, T typeValue, params string[] variables) |
Reads a same-type named set; use ValueBatchAsync(IRxS7, Dictionary<string,T>) to issue a batch write. |
AdvancedExtensions.ValueBatchAsync<T>(IRxS7 plc, Dictionary<string,T> values) |
Writes a named set; it does not imply a transactional PLC commit. |
AdvancedExtensions.ReadBatchOptimizedAsync<T>(IRxS7, T typeValue, Dictionary<string,string>, int timeoutMs) |
Registers mapped addresses as necessary, groups work by DB, and returns per-tag BatchReadResult<T>. |
AdvancedExtensions.WriteBatchOptimizedAsync<T>(IRxS7, Dictionary<string,T>, bool verifyWrites, bool enableRollback) |
Writes mapped tags with optional readback and best-effort rollback; inspect every result field. |
AdvancedExtensions.GetDiagnosticsAsync(IRxS7) |
Asynchronously gathers connection, CPU/tag, and recommendation diagnostics. |
AdvancedExtensions.AnalyzePerformanceAsync(IRxS7, TimeSpan) |
Observes tag changes for the supplied duration and returns frequencies and recommendations. |
AdvancedExtensions.CreateTagGroup<T>(IRxS7, T typeValue, string groupName, params string[] tagNames) |
Creates a disposable group with ObserveGroup, ReadAllAsync, and WriteAllAsync. |
IoT.Driver.S7PlcRx.Advanced.AsyncExtensions
Source: Advanced/AsyncExtensions.cs:18
Provides additional async-first helpers for reading, writing, and observing PLC values without changing the base <see cref="IRxS7"/> API surface. <remarks>These helpers layer <see cref="ValueTask"/> and async-observable patterns over the existing PLC API. Where possible, they complete synchronously from cached tag values or the existing multi-variable read/write paths to reduce avoidable allocations.</remarks>
| Member | Summary |
|---|---|
AsyncExtensions.ReadValueAsync<T>(IRxS7, T typeValue, string variable, CancellationToken) |
ValueTask read with a type marker and caller cancellation. It can satisfy a compatible cached value synchronously. |
AsyncExtensions.ReadValuesAsync<T>(IRxS7, T typeValue, IReadOnlyList<string>, CancellationToken) |
ValueTask multi-read with a type marker and cancellation. |
AsyncExtensions.WriteValuesAsync<T>(IRxS7, IReadOnlyDictionary<string,T>, CancellationToken) |
ValueTask batch write. It uses the multi-variable path when available and still requires application-level command acknowledgement. |
AsyncExtensions.ObserveValue<T>(IRxS7, T typeValue, string variable) |
.NET 8+ async observable for one typed key. Subscribe with a Primitives async observer and dispose the async subscription. |
AsyncExtensions.ObserveValues<T>(IRxS7, T typeValue, params string[] variables) |
.NET 8+ async observable batch projection. |
IoT.Driver.S7PlcRx.Advanced.DictionaryEqualityComparer<TKey, TValue>
Source: Advanced/DictionaryEqualityComparer.cs:15
Provides an equality comparer for dictionaries that determines equality based on their key-value pairs. <remarks>This comparer considers two dictionaries equal if they contain the same number of key-value pairs and each key in one dictionary exists in the other with an equal value, as determined by the default equality comparer for the value type. The order of key-value pairs does not affect equality. This comparer can be used to compare dictionaries in collections such as hash sets or as keys in other dictionaries.</remarks> <typeparam name="TKey">The type of keys in the dictionaries. Must be non-nullable.</typeparam> <typeparam name="TValue">The type of values in the dictionaries.</typeparam>
No public instance/static members declared directly on this type.
Namespace IoT.Driver.S7PlcRx.BatchOperations
IoT.Driver.S7PlcRx.BatchOperations.BatchOperationResult
Source: BatchOperations/BatchOperationResult.cs:14
Represents the result of executing a batch operation, including summary statistics and details for each operation. <remarks>Use this class to access aggregate information such as the number of successful and failed operations, processing times, and detailed results for each operation in the batch. The class provides both summary properties and collections for per-operation and error details.</remarks>
| Member | Summary |
|---|---|
public DateTime StartTime get; set; } |
Gets or sets the operation start time. |
public DateTime EndTime get; set; } |
Gets or sets the operation end time. |
public int OperationCount get; set; } |
Gets or sets the number of operations in the batch. |
public int SuccessfulOperations get; set; } |
Gets or sets the number of successful operations. |
public int FailedOperations get; set; } |
Gets or sets the number of failed operations. |
public TimeSpan ProcessingTime => ... |
Gets the total processing time. |
public double AverageTimePerOperation => ... |
Gets the average time per operation. |
public List<OperationDetail> OperationDetails get; } = []; |
Gets operation details. |
public List<string> ErrorDetails get; } = []; |
Gets error details for failed operations. |
IoT.Driver.S7PlcRx.BatchOperations.BatchReadResult<T>
Source: BatchOperations/BatchReadResult.cs:17
Represents the result of a batch read operation, including the values read, per-tag success status, error messages, and overall success information. <remarks>Use this class to access the outcome of a batch read, including which tags succeeded, which failed, and any associated error messages. The dictionaries provide per-tag details, while the overall success and count properties offer summary information. This class is typically used in scenarios where multiple items are read in a single operation and individual results must be tracked.</remarks> <typeparam name="T">The type of the values returned for each tag in the batch read operation.</typeparam>
| Member | Summary |
|---|---|
public Dictionary<string, T> Values get; } = []; |
Gets the successfully read values. |
public Dictionary<string, bool> Success get; } = []; |
Gets the success status for each tag. |
public Dictionary<string, string> Errors get; } = []; |
Gets error messages for failed reads. |
public bool OverallSuccess get; set; } |
Gets or sets a value indicating whether gets whether all reads were successful. |
public int SuccessCount => ... |
Gets the count of successful reads. |
public int ErrorCount => ... |
Gets the count of failed reads. |
IoT.Driver.S7PlcRx.BatchOperations.BatchWriteResult
Source: BatchOperations/BatchWriteResult.cs:15
Represents the result of a batch write operation, including per-item success status, error messages, and overall outcome. <remarks>Use this class to inspect which items in a batch write succeeded or failed, retrieve error details for failed items, and determine whether the entire batch was successful or if a rollback was performed. The dictionaries map item identifiers (such as tag names) to their respective statuses and error messages.</remarks>
| Member | Summary |
|---|---|
public Dictionary<string, bool> Success get; } = []; |
Gets the success status for each tag. |
public Dictionary<string, string> Errors get; } = []; |
Gets error messages for failed writes. |
public bool OverallSuccess get; set; } |
Gets or sets a value indicating whether gets whether all writes were successful. |
public bool RollbackPerformed get; set; } |
Gets or sets a value indicating whether gets whether rollback was performed. |
public int SuccessCount => ... |
Gets the count of successful writes. |
public int ErrorCount => ... |
Gets the count of failed writes. |
Namespace IoT.Driver.S7PlcRx.Binding
IoT.Driver.S7PlcRx.Binding.S7TagDefinition
Source: Binding/S7TagDefinition.cs:9
Describes a generated PLC tag/property binding.
| Member | Summary |
|---|---|
public S7TagDefinition(string name, string address, Type valueType, int pollIntervalMs, S7TagDirection direction, int arrayLength = 1) |
Initializes a new instance of the <see cref="S7TagDefinition"/> class. <param name="name">The property and PLC tag name.</param> <param name="address">The S7 DB address.</param> <param name="valueType">The .NET value type.</param> <param name="pollIntervalMs">The read polling interval in milliseconds.</param> <param name="direction">The tag access direction.</param> <param name="arrayLength">The array/string element length.</param> |
public string Name get; } |
Gets the property and PLC tag name. |
public string Address get; } |
Gets the S7 DB address. |
public Type ValueType get; } |
Gets the .NET value type. |
public int PollIntervalMs get; } |
Gets the read polling interval in milliseconds. |
public S7TagDirection Direction get; } |
Gets the tag access direction. |
public int ArrayLength get; } |
Gets the array/string element length. |
public bool CanRead => ... |
Gets a value indicating whether this tag should be read on polling intervals. |
public bool CanWrite => ... |
Gets a value indicating whether this tag can write property changes to the PLC. |
IoT.Driver.S7PlcRx.Binding.S7TagDirection
Source: Binding/S7TagDirection.cs:9
Defines the PLC access direction for a generated tag binding.
Enum values: ReadWrite, ReadOnly, WriteOnly.
IoT.Driver.S7PlcRx.Binding.S7TagRuntimeBinding
Source: Binding/S7TagRuntimeBinding.cs:15
Runtime engine used by generated tag bindings to poll and write PLC DB values in byte-array batches.
| Member | Summary |
|---|---|
public static S7TagRuntimeBinding Bind(IRxS7 plc, IReadOnlyList<S7TagDefinition> definitions, Action<string, object?> applyRead) => ... |
Creates and starts a runtime binding for generated PLC tag definitions. <param name="plc">The PLC instance.</param> <param name="definitions">The tag definitions emitted by the source generator.</param> <param name="applyRead">A generated callback that assigns PLC values to backing fields without re-writing them.</param> <returns>A disposable runtime binding.</returns> |
public void Write(string name, object? value) |
Queues a generated property change for a grouped byte-array write. <param name="name">The generated tag/property name.</param> <param name="value">The new property value.</param> |
public void Dispose() |
Releases timers and pending write state. |
Namespace IoT.Driver.S7PlcRx.Cache
IoT.Driver.S7PlcRx.Cache.CacheStatistics
Source: Cache/CacheStatistics.cs:13
Provides statistical information about the state and performance of a cache, including entry counts, hit rates, and entry timestamps. <remarks>Use this class to monitor cache usage patterns and effectiveness. The statistics can help identify cache performance issues or guide tuning decisions. All values represent a snapshot at the time the object is created or updated; they do not update automatically.</remarks>
| Member | Summary |
|---|---|
public int TotalEntries get; set; } |
Gets or sets the total number of cached entries. |
public long TotalHits get; set; } |
Gets or sets the total number of cache hits. |
public double HitRate get; set; } |
Gets or sets the cache hit rate (0.0 to 1.0). |
public DateTime OldestEntry get; set; } |
Gets or sets the timestamp of the oldest cache entry. |
public DateTime NewestEntry get; set; } |
Gets or sets the timestamp of the newest cache entry. |
public int CachedValueCount get; internal set; } |
Gets the cached value count. <value> The cached value count. </value> |
public int PendingRequestCount get; internal set; } |
Gets the pending request count. <value> The pending request count. </value> |
public double CacheHitRatio get; internal set; } |
Gets the cache hit ratio. <value> The cache hit ratio. </value> |
IoT.Driver.S7PlcRx.Cache.CachedTagValue
Source: Cache/CachedTagValue.cs:12
Represents a cached value along with metadata about its storage and usage. <remarks>This class is typically used to store a value retrieved from a data source, along with the time it was cached and the number of times it has been accessed. It is intended for use in caching scenarios where tracking cache usage and freshness is important.</remarks>
| Member | Summary |
|---|---|
public object? Value get; set; } |
Gets or sets the cached value. |
public DateTime Timestamp get; set; } |
Gets or sets when the value was cached. |
public long HitCount get; set; } |
Gets or sets the number of cache hits. |
Namespace IoT.Driver.S7PlcRx.Core
IoT.Driver.S7PlcRx.Core.ConnectionPool
Source: Core/ConnectionPool.cs:17
Manages a pool of PLC connections, providing load-balanced access and connection reuse according to the specified configuration. <remarks>The ConnectionPool enables efficient management of multiple PLC connections by reusing and balancing requests across available connections. It supports configurable pool size and connection reuse strategies. This class is thread-safe for concurrent access. Call Dispose to release all connections when the pool is no longer needed.</remarks>
| Member | Summary |
|---|---|
public ConnectionPool(ConnectionPoolConfig config) => ... |
Initializes a new instance of the <see cref="ConnectionPool"/> class. <param name="config">The pool configuration.</param> |
public ConnectionPool( IEnumerable<PlcConnectionConfig> connectionConfigs, ConnectionPoolConfig poolConfig) |
Initializes a new instance of the <see cref="ConnectionPool"/> class. <param name="connectionConfigs">The connection configurations.</param> <param name="poolConfig">The pool configuration.</param> |
public int MaxConnections => ... |
Gets the maximum number of connections in the pool. |
public int ActiveConnections => ... |
Gets the number of active connections. |
public IRxS7 GetConnection |
Gets a connection from the pool using load balancing. <returns>An available PLC connection.</returns> |
public IEnumerable<IRxS7> AllConnections |
Snapshot of managed connections. Dispose the pool rather than attempting to dispose entries individually while it owns them. |
public void Dispose() |
Disposes all connections in the pool. |
IoT.Driver.S7PlcRx.Core.ConnectionPoolConfig
Source: Core/ConnectionPoolConfig.cs:12
Represents the configuration settings for a connection pool, including limits, timeouts, and behavior options. <remarks>Use this class to specify parameters that control the size, performance, and health monitoring of a connection pool. Adjusting these settings can help optimize resource usage and connection reliability for applications that manage multiple concurrent connections.</remarks>
| Member | Summary |
|---|---|
public int MaxPoolSize get; set; } = 10; |
Gets or sets the maximum pool size. |
public int MaxConnections get; set; } = 10; |
Gets or sets the maximum number of connections in the pool. |
public TimeSpan ConnectionTimeout get; set; } = TimeSpan.FromSeconds(30); |
Gets or sets the connection timeout. |
public bool EnableLoadBalancing get; set; } = true; |
Gets or sets a value indicating whether to enable load balancing. |
public bool EnableConnectionReuse get; set; } = true; |
Gets or sets a value indicating whether to enable connection reuse. |
public TimeSpan HealthCheckInterval get; set; } = TimeSpan.FromMinutes(1); |
Gets or sets the health check interval. |
IoT.Driver.S7PlcRx.Core.DataBlockInfo
Source: Core/DataBlockInfo.cs:14
Represents metadata and configuration information for a data block, including its identifier, size, tag details, access frequency, and optimization settings. <remarks>Use this class to describe the characteristics of a data block, such as its block number, size in bytes, and associated tag names. The properties provide information useful for managing, analyzing, or optimizing data storage and access patterns. Instances of this class are typically used in scenarios where data blocks are processed, monitored, or configured for batch operations.</remarks>
| Member | Summary |
|---|---|
public int BlockNumber get; set; } |
Gets or sets the data block number. |
public int SizeBytes get; set; } |
Gets or sets the total size in bytes. |
public int TagCount get; set; } |
Gets or sets the number of tags in this block. |
public double AccessFrequency get; set; } |
Gets or sets the access frequency. |
public bool IsBatchOptimized get; set; } |
Gets or sets a value indicating whether gets or sets whether the block is optimized for batch operations. |
public List<string> TagNames get; } = []; |
Gets the tags in this data block. |
IoT.Driver.S7PlcRx.Core.OperationDetail
Source: Core/OperationDetail.cs:9
Represents the details of an operation, including its type, status, duration, and related metadata.
| Member | Summary |
|---|---|
public string TagName get; set; } = string.Empty; |
Gets or sets the tag name. |
public string OperationType get; set; } = string.Empty; |
Gets or sets the operation type. |
public bool Success get; set; } |
Gets or sets a value indicating whether gets or sets whether the operation succeeded. |
public TimeSpan Duration get; set; } |
Gets or sets the operation duration. |
public string? ErrorMessage get; set; } |
Gets or sets any error message. |
public int DataBlockNumber get; set; } |
Gets or sets the data block number. |
IoT.Driver.S7PlcRx.Core.RequestPriority
Source: Core/RequestPriority.cs:9
Request priority levels for batch processing.
Enum values: Low, Normal, High, Critical.
Namespace IoT.Driver.S7PlcRx.Enterprise
IoT.Driver.S7PlcRx.Enterprise.EnterpriseExtensions
Source: Enterprise/EnterpriseExtensions.cs:19
Provides extension methods for enhanced PLC connectivity, symbolic addressing, high-availability management, and connection pooling in enterprise automation scenarios. <remarks>The EnterpriseExtensions class offers advanced features for working with PLCs, including loading and caching symbol tables for symbolic access, reading and writing values by symbol name, creating high-availability connections with automatic failover, and managing connection pools for high-throughput applications. These methods are designed to simplify integration with industrial automation systems and improve reliability and scalability in production environments.</remarks>
| Member | Summary |
|---|---|
public static async Task<SymbolTable> LoadSymbolTable( this IRxS7 plc, string symbolTableData, SymbolTableFormat format = SymbolTableFormat.Csv) |
Loads and caches a symbol table for symbolic addressing support. Enables reading/writing using symbolic names instead of absolute addresses. <param name="plc">The PLC instance.</param> <param name="symbolTableData">Symbol table data (CSV format supported).</param> <param name="format">The format of the symbol table data.</param> <returns>The loaded symbol table.</returns> |
public static async Task<T?> ReadSymbol<T>(this IRxS7 plc, string symbolName) |
Asynchronously reads the value of the specified symbol from the PLC and returns it as the specified type. <typeparam name="T">The type to which the symbol's value is converted and returned.</typeparam> <param name="plc">The PLC connection used to access the symbol table and read the symbol value. Cannot be null.</param> <param name="symbolName">The name of the symbol to read from the PLC. Must correspond to a symbol present in the PLC's symbol table.</param> <returns>A task that represents the asynchronous read operation. The task result contains the value of the symbol as type <typeparamref name="T"/>, or <see langword="null"/> if the symbol's value is null.</returns> <exception cref="ArgumentNullException">Thrown if <paramref name="plc"/> is null.</exception> <exception cref="ArgumentException">Thrown if a symbol with the specified <paramref name="symbolName"/> does not exist in the PLC's symbol table.</exception> |
public static void WriteSymbol<T>(this IRxS7 plc, string symbolName, T value) |
Writes a value to the specified PLC symbol by name. <typeparam name="T">The type of the value to write to the symbol.</typeparam> <param name="plc">The PLC instance to which the symbol value will be written. Cannot be null.</param> <param name="symbolName">The name of the symbol in the PLC to write the value to. Must correspond to a valid symbol in the PLC's symbol table.</param> <param name="value">The value to write to the specified symbol.</param> <exception cref="ArgumentNullException">Thrown if <paramref name="plc"/> is null.</exception> <exception cref="ArgumentException">Thrown if <paramref name="symbolName"/> does not correspond to a symbol in the PLC's symbol table.</exception> |
public static HighAvailabilityPlcManager CreateHighAvailabilityConnection( IRxS7 primaryPlc, IList<IRxS7> backupPlcs, TimeSpan? healthCheckInterval = null) |
Creates a high-availability connection manager that coordinates failover between a primary PLC and one or more backup PLCs. <remarks>The returned manager automatically monitors the health of the primary and backup PLCs and handles failover as needed. The order of backupPlcs determines the failover priority.</remarks> <param name="primaryPlc">The primary PLC instance to be used for initial communication and operations. Cannot be null.</param> <param name="backupPlcs">A list of backup PLC instances to be used for failover if the primary PLC becomes unavailable. Cannot be null or empty.</param> <param name="healthCheckInterval">The interval at which the health of the PLCs is checked. If null, a default interval is used.</param> <returns>A HighAvailabilityPlcManager instance that manages high-availability communication across the specified PLCs.</returns> <exception cref="ArgumentNullException">Thrown if primaryPlc or backupPlcs is null.</exception> |
public static ConnectionPool CreateConnectionPool( IEnumerable<PlcConnectionConfig> connectionConfigs, ConnectionPoolConfig poolConfig) |
Creates a new connection pool using the specified PLC connection configurations and pool settings. <param name="connectionConfigs">A collection of PLC connection configurations to include in the pool. Must contain at least one configuration.</param> <param name="poolConfig">The configuration settings to apply to the connection pool. Cannot be null.</param> <returns>A new instance of <see cref="ConnectionPool"/> initialized with the provided connection configurations and pool settings.</returns> <exception cref="ArgumentNullException">Thrown if <paramref name="connectionConfigs"/> or <paramref name="poolConfig"/> is null.</exception> <exception cref="ArgumentException">Thrown if <paramref name="connectionConfigs"/> does not contain at least one configuration.</exception> |
IoT.Driver.S7PlcRx.Enterprise.HighAvailabilityPlcManager
Source: Enterprise/HighAvailabilityPlcManager.cs:17
Provides high-availability management for a set of PLC (Programmable Logic Controller) connections, automatically handling failover to backup PLCs in case of connection loss. <remarks>The HighAvailabilityPlcManager monitors the health of the primary PLC and automatically switches to a backup PLC if the primary becomes unavailable. It exposes an observable stream of failover events for monitoring and allows manual triggering of failover. This class is thread-safe for typical usage scenarios. Dispose the manager when it is no longer needed to release resources.</remarks>
| Member | Summary |
|---|---|
public HighAvailabilityPlcManager( IRxS7 primaryPlc, IList<IRxS7> backupPlcs, TimeSpan? healthCheckInterval = null) |
Initializes a new instance of the <see cref="HighAvailabilityPlcManager"/> class with a primary PLC, a list of backup PLCs,. and an optional health check interval. <remarks>The primary PLC is always treated as the first PLC in the managed list, regardless of its position in the provided backupPlcs collection. Health checks are performed at the specified interval to monitor PLC availability and facilitate failover if necessary.</remarks> <param name="primaryPlc">The primary PLC to be managed. Cannot be null.</param> <param name="backupPlcs">A list of backup PLCs to use for failover. The primary PLC will be inserted as the first element in this list.</param> <param name="healthCheckInterval">The interval at which health checks are performed on the PLCs. If null, a default interval of 30 seconds is used.</param> <exception cref="ArgumentNullException">Thrown if primaryPlc is null.</exception> |
public IRxS7 ActivePLC get; private set; } |
Gets the currently active PLC connection. |
public IObservable<PlcFailoverEvent> FailoverEvents => ... |
Gets observable stream of failover events. |
public async Task<bool> TriggerFailover() => ... |
Manually triggers a failover to the next available backup. <returns>A value indicating whether failover was successful.</returns> |
public void Dispose() |
Disposes the high-availability manager. |
IoT.Driver.S7PlcRx.Enterprise.PlcConnectionConfig
Source: Enterprise/PlcConnectionConfig.cs:14
Represents the configuration settings required to establish a connection to a programmable logic controller (PLC). <remarks>Use this class to specify connection parameters such as PLC type, network address, rack, slot, and an optional connection name when initializing or managing PLC connections. This configuration is typically used by PLC communication libraries to open and maintain a session with the target device.</remarks>
| Member | Summary |
|---|---|
public CpuType PLCType get; set; } |
Gets or sets the PLC type. |
public string IPAddress get; set; } = string.Empty; |
Gets or sets the IP address. |
public short Rack get; set; } |
Gets or sets the rack number. |
public short Slot get; set; } |
Gets or sets the slot number. |
public string ConnectionName get; set; } = string.Empty; |
Gets or sets the connection name. |
IoT.Driver.S7PlcRx.Enterprise.PlcFailoverEvent
Source: Enterprise/PlcFailoverEvent.cs:12
Represents an event that occurs when a failover between programmable logic controllers (PLCs) takes place. <remarks>This class encapsulates information about a PLC failover event, including the time of occurrence, the reason for the failover, and the identifiers of the PLCs involved. Instances of this class are typically used for logging, monitoring, or auditing failover activities within PLC-based systems.</remarks>
| Member | Summary |
|---|---|
public DateTime Timestamp get; set; } |
Gets or sets the timestamp of the failover. |
public string Reason get; set; } = string.Empty; |
Gets or sets the reason for failover. |
public string OldPlc get; set; } = string.Empty; |
Gets or sets the old PLC identifier. |
public string NewPlc get; set; } = string.Empty; |
Gets or sets the new PLC identifier. |
IoT.Driver.S7PlcRx.Enterprise.SecurityContext
Source: Enterprise/SecurityContext.cs:14
Represents the security context for a session, including encryption settings, session timing, and certificate information. <remarks>The SecurityContext class encapsulates all security-related parameters required to manage and validate a secure session. It provides properties for encryption keys, session validity, and certificate details, allowing consumers to configure and query the security state of a session. This class is sealed and cannot be inherited.</remarks>
| Member | Summary |
|---|---|
public string PLCKey get; set; } = string.Empty; |
Gets or sets the PLC key identifier. |
public string EncryptionKey get; set; } = string.Empty; |
Gets or sets the encryption key. |
public DateTime SessionStartTime get; set; } |
Gets or sets the session start time. |
public TimeSpan SessionTimeout get; set; } |
Gets or sets the session timeout. |
public bool IsEnabled get; set; } |
Gets or sets a value indicating whether security is enabled. |
public bool IsSessionValid => ... |
Gets a value indicating whether the session is still valid. |
public bool EnableEncryption get; internal set; } |
Gets a value indicating whether [enable encryption]. <value> <c>true</c> if [enable encryption]; otherwise, <c>false</c>. </value> |
public string? CertificatePath get; internal set; } |
Gets the certificate path. <value> The certificate path. </value> |
public string? CertificatePassword get; internal set; } |
Gets the certificate password. <value> The certificate password. </value> |
IoT.Driver.S7PlcRx.Enterprise.Symbol
Source: Enterprise/Symbol.cs:13
Represents a programmable logic controller (PLC) symbol, including its name, address, data type, length, and description. <remarks>Use the Symbol class to define and manage metadata for PLC variables, such as their symbolic name, address, and data type. This class is typically used in applications that interact with PLCs for automation or monitoring purposes.</remarks>
| Member | Summary |
|---|---|
public string Name get; set; } = string.Empty; |
Gets or sets the symbol name. |
public string Address get; set; } = string.Empty; |
Gets or sets the PLC address. |
public string DataType get; set; } = string.Empty; |
Gets or sets the data type. |
public int Length get; set; } = 1; |
Gets or sets the length for array types. |
public string Description get; set; } = string.Empty; |
Gets or sets the description. |
IoT.Driver.S7PlcRx.Enterprise.SymbolTable
Source: Enterprise/SymbolTable.cs:9
Represents a read-only table of named symbols and the time at which it was loaded.
| Member | Summary |
|---|---|
public Dictionary<string, Symbol> Symbols get; } = []; |
Gets the collection of symbols indexed by name. |
public DateTime LoadedAt get; } = DateTime.UtcNow; |
Gets the timestamp when the symbol table was loaded. |
IoT.Driver.S7PlcRx.Enterprise.SymbolTableFormat
Source: Enterprise/SymbolTableFormat.cs:9
Specifies the supported formats for serializing or deserializing a symbol table.
Enum values: Csv, Json, Xml.
Namespace IoT.Driver.S7PlcRx.Enums
IoT.Driver.S7PlcRx.Enums.CpuType
Source: Enums/CpuType.cs:13
Specifies the supported CPU types for Siemens programmable logic controllers (PLCs). <remarks>Use this enumeration to indicate the model of CPU when configuring or communicating with Siemens PLC devices. The available values correspond to common Siemens PLC families, such as LOGO!, S7-200, S7-300, S7-400, S7-1200, and S7-1500. Selecting the correct CPU type ensures compatibility with device-specific protocols and features.</remarks>
Enum values: Logo0BA8, S7200, S7300, S7400, S71200, S71500.
IoT.Driver.S7PlcRx.Enums.ErrorCode
Source: Enums/ErrorCode.cs:12
Specifies error codes that indicate the result of an operation or the type of error encountered. <remarks>Use this enumeration to identify specific error conditions when handling operation results. The values represent distinct error types, such as connection failures, invalid data formats, or communication issues. The meaning of each code is defined by the context in which it is used.</remarks>
Enum values: NoError, WrongCPUType, ConnectionError, IPAddressNotAvailable, WrongVarFormat, WrongNumberReceivedBytes, SendData, ReadData, WriteData.
IoT.Driver.S7PlcRx.Enums.S7StringType
Source: Enums/S7StringType.cs:12
Specifies the string encoding type used for S7 PLC string variables. <remarks>Use this enumeration to indicate whether a string variable should be interpreted as an ASCII (S7String) or Unicode (S7WString) string when communicating with Siemens S7 PLCs. The encoding type determines how string data is read from or written to the PLC.</remarks>
Enum values: S7String, S7WString.
Namespace IoT.Driver.S7PlcRx.Optimization
IoT.Driver.S7PlcRx.Optimization.OptimizationExtensions
Source: Optimization/OptimizationExtensions.cs:18
Provides extension methods for IRxS7 to enable optimized tag monitoring, intelligent value caching, and cache management for PLC data access. <remarks>These extensions enhance performance and usability when interacting with PLC tags by offering adaptive polling, caching strategies, and cache statistics. All methods require a valid IRxS7 instance and are designed to be thread-safe. Use these methods to reduce unnecessary network traffic, improve responsiveness, and monitor tag changes efficiently.</remarks>
| Member | Summary |
|---|---|
OptimizationExtensions.MonitorTagSmart<T>(IRxS7, string, IEqualityComparer<T>, double, int) |
Emits debounced significant changes using the supplied comparer. |
OptimizationExtensions.ValueCachedAsync<T>(IRxS7, string, T fallbackValue, TimeSpan) |
Reads through the cache, returning the supplied fallback if the PLC yields no value. |
OptimizationExtensions.ClearCache(IRxS7) / ClearCache(IRxS7, string?) |
Clears all cache entries for the endpoint or one tag. |
OptimizationExtensions.GetCacheStatistics(IRxS7) |
Returns endpoint cache hit and age statistics. |
IoT.Driver.S7PlcRx.Optimization.OptimizationRequestPriority
Source: Optimization/OptimizationRequestPriority.cs:11
Specifies the priority level for an optimization request. <remarks>Use this enumeration to indicate the relative importance of an optimization request. Higher priority values may be processed before lower ones, depending on the scheduling or queuing logic of the system.</remarks>
Enum values: Low, Normal, High, Critical.
IoT.Driver.S7PlcRx.Optimization.ReadOptimizationConfig
Source: Optimization/ReadOptimizationConfig.cs:13
Provides configuration options for optimizing read operations, including parallelism, delays, concurrency limits, and timeouts within data block groups. <remarks>Use this class to fine-tune the performance characteristics of read operations in scenarios where data is organized into block groups. Adjusting these settings can help balance throughput, latency, and resource usage based on application requirements.</remarks>
| Member | Summary |
|---|---|
public bool EnableParallelReads get; set; } = true; |
Gets or sets a value indicating whether gets or sets whether to enable parallel reads within data block groups. |
public int InterGroupDelayMs get; set; } |
Gets or sets the delay between data block groups in milliseconds. |
public int MaxConcurrentReads get; set; } = 10; |
Gets or sets the maximum number of concurrent reads. |
public int ReadTimeoutMs get; set; } = 5000; |
Gets or sets the read timeout in milliseconds. |
IoT.Driver.S7PlcRx.Optimization.SmartTagChange<T>
Source: Optimization/SmartTagChange.cs:16
Represents a change to a smart tag, including its name, previous and current values, the time of change, the amount of change for numeric types, and associated metadata. <remarks>Use this class to track changes to smart tags in applications that require auditing, history, or notification of tag value updates. The <see cref="ChangeAmount"/> property is intended for numeric types; for non-numeric types, its value may be ignored. The <see cref="Metadata"/> dictionary can be used to store additional context or information relevant to the change.</remarks> <typeparam name="T">The type of the value associated with the smart tag. This can be any type representing the tag's value before and after the change.</typeparam>
| Member | Summary |
|---|---|
public string TagName get; set; } = string.Empty; |
Gets or sets the tag name. |
public T? PreviousValue get; set; } |
Gets or sets the previous value. |
public T? CurrentValue get; set; } |
Gets or sets the current value. |
public DateTimeOffset ChangeTime get; set; } |
Gets or sets the change timestamp. |
public double ChangeAmount get; set; } |
Gets or sets the amount of change for numeric types. |
public Dictionary<string, object> Metadata get; set; } = new(); |
Gets or sets additional metadata about the change. |
IoT.Driver.S7PlcRx.Optimization.WriteOptimizationConfig
Source: Optimization/WriteOptimizationConfig.cs:13
Provides configuration options for optimizing write operations, including parallelism, verification, timing, and concurrency settings. <remarks>Use this class to customize the behavior of write operations, such as enabling parallel writes, specifying verification requirements, and controlling delays and timeouts. Adjusting these settings can help balance performance and reliability based on application needs.</remarks>
| Member | Summary |
|---|---|
public bool EnableParallelWrites get; set; } |
Gets or sets a value indicating whether gets or sets whether to enable parallel writes within data block groups. |
public bool VerifyWrites get; set; } |
Gets or sets a value indicating whether gets or sets whether to verify writes by reading back. |
public int InterGroupDelayMs get; set; } = 50; |
Gets or sets the delay between data block groups in milliseconds. |
public int MaxConcurrentWrites get; set; } = 5; |
Gets or sets the maximum number of concurrent writes. |
public int WriteTimeoutMs get; set; } = 5000; |
Gets or sets the write timeout in milliseconds. |
IoT.Driver.S7PlcRx.Optimization.WriteOptimizationResult
Source: Optimization/WriteOptimizationResult.cs:14
Represents the result of a write optimization operation, including timing information, per-write outcomes, and overall error details. <remarks>Use this class to access detailed results of a write optimization process, such as the start and end times, lists of successful and failed writes, and aggregate metrics like total duration and success rate. The dictionaries provide per-write information, with keys typically representing write identifiers. This type is immutable except for properties explicitly marked as settable.</remarks>
| Member | Summary |
|---|---|
public DateTime StartTime get; set; } |
Gets or sets the operation start time. |
public DateTime EndTime get; set; } |
Gets or sets the operation end time. |
public Dictionary<string, TimeSpan> SuccessfulWrites get; } = []; |
Gets successful writes with their durations. |
public Dictionary<string, string> FailedWrites get; } = []; |
Gets failed writes with error messages. |
public string? OverallError get; set; } |
Gets or sets any overall error message. |
public TimeSpan TotalDuration => ... |
Gets the total operation duration. |
public double SuccessRate => ... |
Gets the success rate. |
Namespace IoT.Driver.S7PlcRx.Performance
IoT.Driver.S7PlcRx.Performance.BenchmarkConfig
Source: Performance/BenchmarkConfig.cs:12
Represents the configuration settings for benchmark tests, including parameters for latency, throughput, and reliability measurements. <remarks>Use this class to specify the number and duration of various benchmark tests when running performance evaluations. All properties are configurable to tailor the benchmarking process to specific requirements.</remarks>
| Member | Summary |
|---|---|
public int LatencyTestCount get; set; } = 10; |
Gets or sets the number of latency tests to perform. |
public TimeSpan ThroughputTestDuration get; set; } = TimeSpan.FromSeconds(10); |
Gets or sets the duration for throughput testing. |
public int ReliabilityTestCount get; set; } = 20; |
Gets or sets the number of reliability tests to perform. |
IoT.Driver.S7PlcRx.Performance.BenchmarkResult
Source: Performance/BenchmarkResult.cs:15
Represents the results of a performance benchmark, including timing, latency, throughput, reliability, and any errors encountered during execution. <remarks>Use this class to access detailed metrics and diagnostic information from a completed benchmark run. The properties provide summary statistics such as average, minimum, and maximum latency, as well as overall reliability and score. Errors encountered during benchmarking are available in the <see cref="Errors"/> collection for troubleshooting. This type is immutable except for its settable properties; thread safety is not guaranteed if modified concurrently.</remarks>
| Member | Summary |
|---|---|
public DateTime StartTime get; set; } |
Gets or sets the benchmark start time. |
public DateTime EndTime get; set; } |
Gets or sets the benchmark end time. |
public string PLCIdentifier get; set; } = string.Empty; |
Gets or sets the PLC identifier. |
public double AverageLatencyMs get; set; } |
Gets or sets the average latency in milliseconds. |
public double MinLatencyMs get; set; } |
Gets or sets the minimum latency in milliseconds. |
public double MaxLatencyMs get; set; } |
Gets or sets the maximum latency in milliseconds. |
public double OperationsPerSecond get; set; } |
Gets or sets the operations per second. |
public double ReliabilityRate get; set; } |
Gets or sets the reliability rate (0.0 to 1.0). |
public double OverallScore get; set; } |
Gets or sets the overall benchmark score (0 to 100). |
public List<string> Errors get; } = []; |
Gets any errors encountered during benchmarking. |
public TimeSpan TotalDuration => ... |
Gets the total benchmark duration. |
IoT.Driver.S7PlcRx.Performance.HighPerformanceTagGroup<T>
Source: Performance/HighPerformanceTagGroup.cs:18
Provides high-performance batch operations for reading, writing, and observing a group of PLC tags as a single unit. <remarks>This class is designed to optimize communication with a PLC by grouping related tags and minimizing individual polling. It supports efficient batch reads and writes, and exposes an observable stream for monitoring group state changes. Instances of this class are not thread-safe; external synchronization may be required if accessed concurrently.</remarks> <typeparam name="T">The type of value associated with each PLC tag in the group.</typeparam>
| Member | Summary |
|---|---|
public HighPerformanceTagGroup(IRxS7 plc, string groupName, string[] tagNames) |
Initializes a new instance of the <see cref="HighPerformanceTagGroup{T}"/> class, associating a set of tag names with a specified. PLC for optimized group operations. <remarks>Tag names starting with "DB" that are not already present in the PLC's tag list will be added with individual polling disabled to improve performance when accessing the group.</remarks> <param name="plc">The PLC connection used to manage and access the specified tags.</param> <param name="groupName">The name assigned to this tag group. Cannot be null or whitespace.</param> <param name="tagNames">An array of tag names to include in the group. Cannot be null or empty.</param> <exception cref="ArgumentNullException">Thrown if <paramref name="plc"/> is null.</exception> <exception cref="ArgumentException">Thrown if <paramref name="groupName"/> is null, whitespace, or if <paramref name="tagNames"/> is null or empty.</exception> |
public string GroupName get; } |
Gets the name of the group associated with this instance. |
public IReadOnlyDictionary<string, T?> CurrentValues => ... |
Gets a read-only dictionary containing the current values associated with each key. |
public IObservable<Dictionary<string, T?>> ObserveGroup() |
Observes changes to the group of tags and provides a stream of their current values. <remarks>Individual polling is enabled for each tag in the group to ensure timely updates. The returned observable emits only when the values of the tags change, and subscribers receive the most recent state of all tags in the group. The sequence is shared among all subscribers and remains active as long as there is at least one subscription.</remarks> <returns>An observable sequence that emits a dictionary containing the latest values for each tag in the group. Each dictionary maps tag names to their corresponding values of type T. The sequence emits a new dictionary whenever any tag value changes.</returns> |
public async Task<Dictionary<string, T?>> ReadAll() => ... |
Asynchronously reads the values of all configured PLC tags and returns a dictionary mapping tag names to their corresponding values. <remarks>The returned dictionary includes an entry for each tag in the configured set, regardless of whether the value was successfully read. This method is thread-safe and can be awaited. The order of entries in the dictionary is not guaranteed.</remarks> <returns>A dictionary containing the tag names as keys and their associated values of type <typeparamref name="T"/> as values. If a tag value cannot be read, its value will be <see langword="null"/>.</returns> |
public async Task WriteAll(Dictionary<string, T> values) |
Writes all specified values to the PLC in a single batch operation. <remarks>Entries in the dictionary with tag names not recognized by the PLC are ignored. This method performs the write operation asynchronously and does not block the calling thread.</remarks> <param name="values">A dictionary containing tag names as keys and their corresponding values to be written. Only entries with tag names recognized by the PLC will be processed.</param> <returns>A task that represents the asynchronous write operation.</returns> |
public void Dispose() |
Performs application-defined tasks associated with freeing, releasing, or resetting unmanaged resources. |
IoT.Driver.S7PlcRx.Performance.PerformanceAnalysis
Source: Performance/PerformanceAnalysis.cs:13
Represents the results and metrics of a performance analysis, including time intervals, tag change statistics, and optimization recommendations. <remarks>Use this class to encapsulate data collected during a performance monitoring session, such as the frequency of tag changes and suggested improvements. The properties provide access to both raw metrics and calculated values, enabling further reporting or decision-making based on the analysis.</remarks>
| Member | Summary |
|---|---|
public DateTime StartTime get; set; } |
Gets or sets the start time of the analysis. |
public DateTime EndTime get; set; } |
Gets or sets the end time of the analysis. |
public TimeSpan MonitoringDuration get; set; } |
Gets or sets the monitoring duration. |
public Dictionary<string, int> TagChangeFrequencies get; set; } = []; |
Gets or sets the tag change frequencies. |
public int TotalTagChanges get; set; } |
Gets or sets the total tag changes observed. |
public double AverageChangesPerTag get; set; } |
Gets or sets the average changes per tag. |
public List<string> Recommendations get; set; } = []; |
Gets or sets the optimization recommendations. |
IoT.Driver.S7PlcRx.Performance.PerformanceExtensions
Source: Performance/PerformanceExtensions.cs:19
Provides extension methods for IRxS7 PLC instances to enable advanced performance monitoring, optimized read and write operations, and benchmarking capabilities. <remarks>The methods in this class facilitate efficient interaction with PLCs by offering features such as real-time performance metrics, automatic grouping and batching of read/write operations, and comprehensive benchmarking. These extensions are designed to improve throughput, reliability, and observability when working with industrial automation systems. All methods require a valid IRxS7 instance and may throw exceptions if invalid arguments are supplied. Thread safety is ensured for performance data collection and metrics aggregation.</remarks>
| Member | Summary |
|---|---|
PerformanceExtensions.MonitorPerformance(IRxS7, TimeSpan?) |
Returns periodic connection, tag, rate, and error metrics. |
PerformanceExtensions.ReadOptimizedAsync<T>(IRxS7, IEnumerable<string>, T typeMarker, ReadOptimizationConfig?) |
Reads optimized groups and returns the typed values. |
PerformanceExtensions.WriteOptimizedAsync<T>(IRxS7, Dictionary<string,T>, WriteOptimizationConfig?) |
Writes optimized groups and returns detailed timing/outcome information. |
PerformanceExtensions.RunBenchmarkAsync(IRxS7, BenchmarkConfig?) |
Runs latency, throughput, and reliability checks and records errors in the result. |
PerformanceExtensions.GetPerformanceStatistics(IRxS7) |
Returns aggregate connection performance statistics. |
IoT.Driver.S7PlcRx.Performance.PerformanceMetrics
Source: Performance/PerformanceMetrics.cs:13
Represents a set of performance metrics for a programmable logic controller (PLC) at a specific point in time. <remarks>This class provides properties for tracking key operational statistics of a PLC, including connection status, tag activity, performance rates, and error metrics. It is typically used to monitor and analyze PLC performance in industrial automation scenarios. All properties are read-write, allowing metrics to be set or updated as needed.</remarks>
| Member | Summary |
|---|---|
public string PLCIdentifier get; set; } = string.Empty; |
Gets or sets the PLC identifier. |
public DateTime Timestamp get; set; } |
Gets or sets the timestamp of these metrics. |
public bool IsConnected get; set; } |
Gets or sets a value indicating whether gets or sets whether the PLC is connected. |
public int TagCount get; set; } |
Gets or sets the total number of tags. |
public int ActiveTagCount get; set; } |
Gets or sets the number of active tags. |
public double OperationsPerSecond get; set; } |
Gets or sets the operations per second. |
public double AverageResponseTime get; set; } |
Gets or sets the average response time in milliseconds. |
public double ErrorRate get; set; } |
Gets or sets the error rate (0.0 to 1.0). |
public TimeSpan ConnectionUptime get; set; } |
Gets or sets the connection uptime. |
public int ReconnectionCount get; set; } |
Gets or sets the number of reconnections. |
IoT.Driver.S7PlcRx.Performance.PerformanceStatistics
Source: Performance/PerformanceStatistics.cs:14
Represents a set of performance statistics for a programmable logic controller (PLC) connection, including operation counts, error metrics, response times, and connection status information. <remarks>Use this class to track and analyze the operational performance and reliability of a PLC connection over time. The statistics provided can assist in monitoring system health, diagnosing issues, and optimizing performance. All properties are read-write, allowing for aggregation and updating of statistics as needed. This class is not thread-safe; synchronize access if used concurrently.</remarks>
| Member | Summary |
|---|---|
public string PLCIdentifier get; set; } = string.Empty; |
Gets or sets the PLC identifier. |
public long TotalOperations get; set; } |
Gets or sets the total number of operations. |
public long TotalErrors get; set; } |
Gets or sets the total number of errors. |
public double AverageResponseTime get; set; } |
Gets or sets the average response time in milliseconds. |
public double OperationsPerSecond get; set; } |
Gets or sets the operations per second. |
public double ErrorRate get; set; } |
Gets or sets the error rate (0.0 to 1.0). |
public TimeSpan ConnectionUptime get; set; } |
Gets or sets the connection uptime. |
public int ReconnectionCount get; set; } |
Gets or sets the number of reconnections. |
public DateTime LastUpdated get; set; } |
Gets or sets when these statistics were last updated. |
IoT.Driver.S7PlcRx.Performance.TagPerformanceMetrics
Source: Performance/TagPerformanceMetrics.cs:12
Represents performance metrics for a specific tag, including operation counts, timing statistics, and success rates. <remarks>Use this class to track and analyze the performance of tag-related operations, such as reads and writes, over time. The metrics provided can help identify bottlenecks, monitor reliability, and optimize system performance. All properties are intended to be updated as new operation data becomes available.</remarks>
| Member | Summary |
|---|---|
public string TagName get; set; } = string.Empty; |
Gets or sets the tag name. |
public long ReadOperations get; set; } |
Gets or sets the total number of read operations. |
public long WriteOperations get; set; } |
Gets or sets the total number of write operations. |
public double AverageReadTimeMs get; set; } |
Gets or sets the average read time in milliseconds. |
public double AverageWriteTimeMs get; set; } |
Gets or sets the average write time in milliseconds. |
public long FailedOperations get; set; } |
Gets or sets the number of failed operations. |
public double SuccessRate get; set; } |
Gets or sets the success rate (0.0 to 1.0). |
public DateTime LastOperationTime get; set; } |
Gets or sets the last operation timestamp. |
Namespace IoT.Driver.S7PlcRx.PlcTypes
IoT.Driver.S7PlcRx.PlcTypes.Bit
Source: PlcTypes/Bit.cs:11
Contains the conversion methods to convert Bit from S7 plc to C#.
| Member | Summary |
|---|---|
public static bool FromByte(byte v, byte bitAdr) => ... |
Determines whether the specified bit in a byte value is set. <remarks>If bitAdr is outside the range 0 to 7, the result may not be meaningful. This method does not validate the bit position.</remarks> <param name="v">The byte value to examine.</param> <param name="bitAdr">The zero-based position of the bit to check. Must be in the range 0 to 7.</param> <returns>true if the bit at the specified position is set; otherwise, false.</returns> |
public static bool FromSpan(ReadOnlySpan<byte> bytes, int byteIndex, int bitIndex) |
Determines whether the specified bit is set in a byte within a read-only span of bytes. <param name="bytes">A read-only span of bytes from which the target byte is selected.</param> <param name="byteIndex">The zero-based index of the byte within <paramref name="bytes"/> to examine. Must be less than the length of <paramref name="bytes"/>.</param> <param name="bitIndex">The zero-based index of the bit within the selected byte to check. Must be in the range 0 to 7.</param> <returns>true if the specified bit is set; otherwise, false.</returns> <exception cref="ArgumentOutOfRangeException">Thrown if <paramref name="byteIndex"/> is greater than or equal to the length of <paramref name="bytes"/>, or if <paramref name="bitIndex"/> is less than 0 or greater than 7.</exception> |
public static BitArray ToBitArray(byte[] bytes) => ... |
Converts the specified byte array to a BitArray, where each bit in the array represents a bit in the input bytes. <param name="bytes">The byte array to convert. Each byte is interpreted in order, with the least significant bit first in each byte.</param> <returns>A BitArray containing the bits from the input byte array. If the input array is null or empty, returns an empty BitArray.</returns> |
public static BitArray ToBitArray(ReadOnlySpan<byte> bytes) => ... |
Creates a new BitArray representing the bits contained in the specified read-only span of bytes. <param name="bytes">A read-only span of bytes whose bits will be copied into the resulting BitArray. Each byte is interpreted in little-endian order, with the least significant bit first.</param> <returns>A BitArray containing the bits from the input span. The length of the BitArray will be equal to the total number of bits in the input.</returns> |
public static BitArray ToBitArray(byte[] bytes, int? length) => ... |
Converts the specified byte array to a BitArray, optionally limiting the number of bits included. <param name="bytes">The array of bytes to convert to a BitArray. Cannot be null.</param> <param name="length">The optional number of bits to include in the BitArray. If specified, only the first length bits are included; otherwise, all bits from the byte array are used. Must be non-negative and not greater than the total number of bits in the array.</param> <returns>A BitArray containing the bits from the specified byte array, limited to the specified length if provided.</returns> |
public static BitArray ToBitArray(ReadOnlySpan<byte> bytes, int? length) |
Converts a span of bytes to a BitArray containing the specified number of bits. <remarks>The returned BitArray contains bits in the same order as they appear in the input bytes, starting from the least significant bit of the first byte. This method is compatible with .NET Standard 2.0 by converting the span to an array before constructing the BitArray.</remarks> <param name="bytes">The span of bytes to convert to a BitArray. The span must not be empty and must contain enough data to represent the requested number of bits.</param> <param name="length">The number of bits to include in the resulting BitArray. Must not be null and must not exceed the total number of bits available in the input bytes.</param> <returns>A BitArray containing the first length bits from the input bytes.</returns> <exception cref="ArgumentNullException">Thrown if length is null.</exception> <exception cref="ArgumentException">Thrown if bytes is empty or if length is greater than the total number of bits available in bytes.</exception> |
public static void SetBit(Span<byte> bytes, int byteIndex, int bitIndex, bool value) |
Sets the value of a specific bit within a byte in the provided span. <param name="bytes">A span of bytes in which the bit will be set or cleared.</param> <param name="byteIndex">The zero-based index of the byte within <paramref name="bytes"/> whose bit will be modified. Must be less than the length of <paramref name="bytes"/>.</param> <param name="bitIndex">The zero-based index of the bit to modify within the specified byte. Must be in the range 0 to 7.</param> <param name="value">The value to assign to the specified bit. If <see langword="true"/>, the bit is set; if <see langword="false"/>, the bit is cleared.</param> <exception cref="ArgumentOutOfRangeException">Thrown when <paramref name="byteIndex"/> is greater than or equal to the length of <paramref name="bytes"/>, or when <paramref name="bitIndex"/> is less than 0 or greater than 7.</exception> |
public static bool[] GetBits(ReadOnlySpan<byte> bytes, ReadOnlySpan<(int byteIndex, int bitIndex)> bitPositions) |
Extracts the values of specified bits from a sequence of bytes. <remarks>If a specified bit position refers to an index outside the bounds of the input span, an exception may be thrown.</remarks> <param name="bytes">The span of bytes from which bits will be read.</param> <param name="bitPositions">A span of tuples specifying the positions of bits to extract. Each tuple contains the zero-based index of the byte and the zero-based index of the bit within that byte.</param> <returns>An array of Boolean values indicating the state of each requested bit. Each element is <see langword="true"/> if the corresponding bit is set; otherwise, <see langword="false"/>.</returns> |
public static void SetBits(Span<byte> bytes, ReadOnlySpan<(int byteIndex, int bitIndex, bool value)> bitUpdates) |
Sets the specified bits in the provided byte span according to the given updates. <remarks>Each tuple in <paramref name="bitUpdates"/> must reference a valid byte and bit index within <paramref name="bytes"/>. Modifying bits outside the bounds of <paramref name="bytes"/> may result in undefined behavior.</remarks> <param name="bytes">The span of bytes in which bits will be set or cleared. Each update modifies a bit within this span.</param> <param name="bitUpdates">A read-only span of tuples specifying the byte index, bit index, and value to set for each bit. Each tuple indicates which bit to update and whether to set it to <see langword="true"/> or <see langword="false"/>.</param> |
IoT.Driver.S7PlcRx.PlcTypes.Boolean
Source: PlcTypes/Boolean.cs:13
Provides static methods for manipulating individual bits within a byte value. <remarks>This class includes utility methods for reading, setting, and clearing specific bits in a byte. All bit indices are zero-based, ranging from 0 (least significant bit) to 7 (most significant bit). These methods are useful for low-level operations such as flag management, bitmasking, or protocol handling where direct bit manipulation is required.</remarks>
| Member | Summary |
|---|---|
public static bool GetValue(byte value, int bit) => ... |
Determines whether the specified bit is set in the given byte value. <param name="value">The byte value to examine for the specified bit.</param> <param name="bit">The zero-based position of the bit to check. Must be in the range 0 to 7.</param> <returns>true if the bit at the specified position is set; otherwise, false.</returns> |
public static byte SetBit(byte value, int bit) |
Sets the value of a bit to 1 (true), given the address of the bit. Returns a copy of the value with the bit set. <param name="value">The input value to modify.</param> <param name="bit">The index (zero based) of the bit to set.</param> <returns>The modified value with the bit at index set.</returns> |
public static void SetBit(ref byte value, int bit) => ... |
Sets the value of a bit to 1 (true), given the address of the bit. <param name="value">The value to modify.</param> <param name="bit">The index (zero based) of the bit to set.</param> |
public static byte ClearBit(byte value, int bit) |
Resets the value of a bit to 0 (false), given the address of the bit. Returns a copy of the value with the bit cleared. <param name="value">The input value to modify.</param> <param name="bit">The index (zero based) of the bit to clear.</param> <returns>The modified value with the bit at index cleared.</returns> |
public static void ClearBit(ref byte value, int bit) => ... |
Resets the value of a bit to 0 (false), given the address of the bit. <param name="value">The input value to modify.</param> <param name="bit">The index (zero based) of the bit to clear.</param> |
IoT.Driver.S7PlcRx.PlcTypes.Byte
Source: PlcTypes/Byte.cs:13
Provides utility methods for converting and manipulating byte values and byte arrays. <remarks>This static class includes methods for converting between single byte values and arrays or spans, as well as writing byte data to spans. All members are static and designed for efficient, low-level byte operations. Methods in this class do not perform validation beyond basic length checks and do not handle multi-byte conversions or encoding.</remarks>
| Member | Summary |
|---|---|
public static byte[] ToByteArray(byte value) => ... |
Converts the specified byte value to a single-element byte array. <param name="value">The byte value to include in the returned array.</param> <returns>A byte array containing the specified value as its only element.</returns> |
public static void ToSpan(byte value, Span<byte> destination) |
Writes the specified byte value into the first position of the provided destination span. <param name="value">The byte value to write to the destination span.</param> <param name="destination">The span of bytes that will receive the value. Must have a length of at least 1.</param> <exception cref="ArgumentException">Thrown when <paramref name="destination"/> has a length less than 1.</exception> |
public static byte FromByteArray(byte[] bytes) => ... |
Creates a byte value from the specified byte array. <remarks>If the array contains more than one element, only the first element is used. If the array is empty, an exception may be thrown.</remarks> <param name="bytes">The array of bytes to convert. Must contain at least one element.</param> <returns>A byte value created from the first element of the specified array.</returns> |
public static byte FromSpan(ReadOnlySpan<byte> bytes) |
Returns the first byte from the specified read-only span. <param name="bytes">A read-only span of bytes from which to retrieve the first byte. Must contain at least one byte.</param> <returns>The first byte in the <paramref name="bytes"/> span.</returns> <exception cref="ArgumentException">Thrown when <paramref name="bytes"/> does not contain at least one byte.</exception> |
public static void ToSpan(ReadOnlySpan<byte> values, Span<byte> destination) |
Copies the contents of the specified read-only byte span to the destination span. <param name="values">The read-only span containing the bytes to copy.</param> <param name="destination">The span that receives the copied bytes. Must be at least as large as <paramref name="values"/>.</param> <exception cref="ArgumentException">Thrown when <paramref name="destination"/> is smaller than <paramref name="values"/>.</exception> |
IoT.Driver.S7PlcRx.PlcTypes.ByteArray
Source: PlcTypes/ByteArray.cs:14
Provides a dynamically sized buffer for accumulating bytes, with efficient memory management using array pooling. <remarks>The buffer automatically grows as data is added. The internal array is rented from the shared array pool and returned when disposed. This class is not thread-safe.</remarks> <param name="size">The initial capacity of the internal buffer, in bytes. Must be greater than zero.</param>
| Member | Summary |
|---|---|
public ByteArray() : this(32) |
Initializes a new instance of the <see cref="ByteArray"/> class with a default capacity of 32 bytes. <remarks>This constructor is useful when the required initial capacity is not known in advance. The internal buffer will automatically expand as needed when additional bytes are added.</remarks> |
public ReadOnlySpan<byte> Span => ... |
Gets the current data as a span. <value>The current data as a span.</value> |
public ReadOnlyMemory<byte> Memory => ... |
Gets the current data as memory. <value>The current data as memory.</value> |
public byte[] Array => ... |
Gets the array. Use Span property for better performance when possible. <value>The array.</value> |
public int Length => ... |
Gets the current position (length of data). |
public void Add(byte item) |
Adds a byte value to the end of the buffer. <param name="item">The byte value to add to the buffer.</param> |
public void Add(ReadOnlySpan<byte> items) |
Adds the specified sequence of bytes to the buffer. <remarks>The buffer is automatically resized if necessary to accommodate the new items. The method does not throw an exception if the span is empty; in that case, the buffer remains unchanged.</remarks> <param name="items">A read-only span containing the bytes to add. If empty, no action is taken.</param> |
public void Add(byte[] items) => ... |
Adds the specified array of bytes to the collection. <param name="items">An array of bytes to add. Cannot be null.</param> |
public void Add(ByteArray byteArray) |
Adds the contents of the specified <see cref="ByteArray"/> to the collection. <param name="byteArray">The <see cref="ByteArray"/> instance whose contents will be added. Cannot be null.</param> |
public void Clear() => ... |
Resets the current position to the beginning, effectively clearing any progress or state tracked by the instance. |
public bool TryCopyTo(Span<byte> destination) |
Attempts to copy the written bytes to the specified destination buffer. <remarks>No data is copied if the destination buffer is too small. The method does not modify the destination buffer if it returns false.</remarks> <param name="destination">The buffer to which the written bytes will be copied. Must have a length greater than or equal to the number of bytes written.</param> <returns>true if the copy operation succeeds; otherwise, false.</returns> |
public void Dispose() |
Performs application-defined tasks associated with freeing, releasing, or resetting unmanaged resources. |
IoT.Driver.S7PlcRx.PlcTypes.Class
Source: PlcTypes/Class.cs:19
Provides static methods for serializing and deserializing class and struct instances to and from byte arrays, as well as calculating the size of a class in bytes for serialization purposes. <remarks>This class is intended for scenarios where objects need to be converted to a byte representation, such as communication with PLCs or other systems requiring structured binary formats. All methods operate statically and require the caller to supply instances and byte arrays as needed. Properties within serialized classes must be accessible and, for string fields, decorated with the appropriate S7StringAttribute. Methods may throw exceptions if required attributes are missing or if input values are invalid. Thread safety is not guaranteed; callers should ensure appropriate synchronization if accessing shared objects.</remarks>
| Member | Summary |
|---|---|
public static double GetClassSize(object instance, double numBytes = 0.0, bool isInnerProperty = false) |
Calculates the total size, in bytes, of the specified object's accessible properties, including arrays and nested properties as applicable. <remarks>This method inspects the public properties of the object's type to determine the total size. Array properties must have a non-null value and a length greater than zero. The calculation accounts for S7-Struct alignment by rounding up to the next even byte count unless calculating for an inner property.</remarks> <param name="instance">The object instance whose class size is to be calculated. Cannot be null.</param> <param name="numBytes">The initial byte count to start the calculation from. Typically set to 0.0 for a new calculation.</param> <param name="isInnerProperty">Indicates whether the calculation is for an inner property. If <see langword="false"/>, the result is rounded up to the next even byte count to match S7-Struct alignment requirements.</param> <returns>The total size, in bytes, of the object's accessible properties. The value is rounded up to the next even number if <paramref name="isInnerProperty"/> is <see langword="false"/>.</returns> <exception cref="ArgumentNullException">Thrown if <paramref name="instance"/> is null.</exception> <exception cref="ArgumentException">Thrown if an array property on <paramref name="instance"/> has a null value.</exception> <exception cref="Exception">Thrown if an array property on <paramref name="instance"/> has a length less than or equal to zero.</exception> |
public static double FromBytes(object sourceClass, byte[] bytes, double numBytes = 0, bool isInnerClass = false) |
Populates the properties of the specified object instance from the provided byte array, deserializing each property value according to its type. <remarks>Properties that are arrays are deserialized element by element. The method updates numBytes to reflect the number of bytes read. If bytes is shorter than required for all properties, only the available bytes are used.</remarks> <param name="sourceClass">The object instance whose properties will be set from the byte array. Must not be null.</param> <param name="bytes">The byte array containing serialized property values to be assigned to the object. If null, no properties are set and the method returns the value of numBytes.</param> <param name="numBytes">The starting offset, in bytes, within the byte array from which to begin deserialization. This value is incremented as properties are read.</param> <param name="isInnerClass">Indicates whether the object instance represents an inner class. This may affect how properties are deserialized.</param> <returns>The total number of bytes consumed from the byte array during deserialization.</returns> <exception cref="ArgumentNullException">Thrown if sourceClass is null.</exception> <exception cref="ArgumentException">Thrown if a property on sourceClass that is expected to be an array is not initialized.</exception> |
public static double ToBytes(object sourceClass, byte[] bytes, double numBytes = 0.0) |
Serializes the accessible properties of the specified source object into the provided byte array, starting at the given offset. <remarks>If a property of the source object is an array, its elements are serialized sequentially into the byte array. Serialization stops if the end of the byte array is reached before all properties are written.</remarks> <param name="sourceClass">The object whose properties will be serialized into the byte array. Cannot be null. All accessible properties must have non-null values.</param> <param name="bytes">The byte array that receives the serialized property values. Cannot be null.</param> <param name="numBytes">The starting offset, in bytes, within the array at which serialization begins. If not specified, serialization starts at the beginning of the array.</param> <returns>The total number of bytes written to the array after serialization is complete.</returns> <exception cref="ArgumentNullException">Thrown if <paramref name="sourceClass"/> or <paramref name="bytes"/> is null.</exception> <exception cref="ArgumentException">Thrown if any accessible property of <paramref name="sourceClass"/> is null.</exception> |
IoT.Driver.S7PlcRx.PlcTypes.Counter
Source: PlcTypes/Counter.cs:15
Provides static methods for converting between S7 Counter byte representations and <see cref="ushort"/> values. <remarks>The <see cref="Counter"/> class supports parsing and serializing S7 Counter values, which are commonly used in Siemens S7 PLC communication protocols. All methods use big-endian byte order, with the high byte first, to match the S7 Counter format. This class is thread-safe as it contains only static methods and does not maintain any internal state.</remarks>
| Member | Summary |
|---|---|
public static ushort FromByteArray(byte[] bytes) => ... |
Converts a byte array to a 16-bit unsigned integer. <param name="bytes">The byte array containing the bytes to convert. Must contain at least two bytes representing the value in the expected byte order.</param> <returns>A 16-bit unsigned integer represented by the first two bytes of the array.</returns> |
public static ushort FromSpan(ReadOnlySpan<byte> bytes) |
Converts the first two bytes of the specified read-only span to a 16-bit unsigned integer, interpreting the bytes in little-endian order. <param name="bytes">A read-only span of bytes containing at least two elements. The first two bytes are used to construct the 16-bit unsigned integer.</param> <returns>A 16-bit unsigned integer formed from the first two bytes of the span, with the first byte as the least significant and the second as the most significant.</returns> <exception cref="ArgumentException">Thrown when <paramref name="bytes"/> contains fewer than two bytes.</exception> |
public static ushort FromByteArray(byte[] bytes, int start) => ... |
Converts a sequence of bytes from the specified array, starting at the given index, to a 16-bit unsigned integer. <param name="bytes">The byte array containing the data to convert. Cannot be null.</param> <param name="start">The zero-based index in the array at which to begin reading bytes. Must be within the bounds of the array.</param> <returns>A 16-bit unsigned integer represented by the bytes at the specified position in the array.</returns> |
public static ushort FromBytes(byte loVal, byte hiVal) => ... |
Creates a 16-bit unsigned integer from two bytes, using the specified low and high byte values. <remarks>The returned value is constructed by placing <paramref name="hiVal"/> in the high-order position and <paramref name="loVal"/> in the low-order position. This is commonly used when converting from little-endian byte representations.</remarks> <param name="loVal">The low-order byte of the resulting 16-bit unsigned integer.</param> <param name="hiVal">The high-order byte of the resulting 16-bit unsigned integer.</param> <returns>A 16-bit unsigned integer composed from the specified low and high bytes.</returns> |
public static ushort[] ToArray(byte[] bytes) => ... |
Converts a byte array to an array of 16-bit unsigned integers. <remarks>Each pair of bytes in the input array is interpreted as a single 16-bit unsigned integer. The conversion uses the default byte order of the platform.</remarks> <param name="bytes">The byte array to convert. The length must be a multiple of 2.</param> <returns>An array of <see cref="ushort"/> values representing the converted data from the input byte array.</returns> |
public static ushort[] ToArray(ReadOnlySpan<byte> bytes) |
Converts a read-only span of bytes to an array of 16-bit unsigned integers. <remarks>Each pair of bytes in <paramref name="bytes"/> is interpreted as a single 16-bit unsigned integer. If the length of <paramref name="bytes"/> is not a multiple of 2, any remaining bytes are ignored.</remarks> <param name="bytes">A read-only span of bytes containing the data to convert. The length must be a multiple of 2.</param> <returns>An array of <see cref="ushort"/> values parsed from the specified byte span. The array length is half the length of <paramref name="bytes"/>.</returns> |
public static byte[] ToByteArray(ushort value) |
Converts the specified 16-bit unsigned integer to a byte array in little-endian order. <param name="value">The 16-bit unsigned integer to convert to a byte array.</param> <returns>A two-element byte array containing the little-endian representation of the specified value.</returns> |
public static void ToSpan(ushort value, Span<byte> destination) |
Writes the specified 16-bit unsigned integer value to the provided span in big-endian byte order. <remarks>This method encodes the value in big-endian format, with the most significant byte first. This is consistent with the representation used by S7 types.</remarks> <param name="value">The 16-bit unsigned integer to write to the destination span.</param> <param name="destination">The span of bytes that receives the big-endian representation of the value. Must have a length of at least 2 bytes.</param> <exception cref="ArgumentException">Thrown when <paramref name="destination"/> is less than 2 bytes in length.</exception> |
public static void ToSpan(ReadOnlySpan<ushort> values, Span<byte> destination) |
Copies the contents of a span of 16-bit unsigned integers into a span of bytes, encoding each value as two bytes in little-endian order. <remarks>Each <see cref="ushort"/> value in <paramref name="values"/> is encoded as two bytes in little-endian format and written sequentially to <paramref name="destination"/>. The method does not allocate additional memory.</remarks> <param name="values">The read-only span of 16-bit unsigned integers to copy from.</param> <param name="destination">The span of bytes to copy the encoded values into. Must be at least twice the length of <paramref name="values"/>.</param> <exception cref="ArgumentException">Thrown when <paramref name="destination"/> is not large enough to hold the encoded bytes.</exception> |
public static byte[] ToByteArray(ushort[] value) |
Converts an array of 16-bit unsigned integers to a byte array. <param name="value">An array of <see cref="ushort"/> values to convert. Cannot be <see langword="null"/>.</param> <returns>A byte array representing the binary data of the input <see cref="ushort"/> array.</returns> <exception cref="ArgumentNullException">Thrown if <paramref name="value"/> is <see langword="null"/>.</exception> |
IoT.Driver.S7PlcRx.PlcTypes.DInt
Source: PlcTypes/DInt.cs:17
Provides static methods for converting between Siemens S7 DInt (32-bit signed integer) representations and .NET int values. <remarks>This class supports conversion between S7 DInt values, which use big-endian byte order, and .NET int values. Methods are provided for reading and writing single or multiple DInt values from and to byte arrays and spans. All methods assume S7 DInt format and handle endianness as required. This class is intended for internal use when working with S7 PLC data structures.</remarks>
| Member | Summary |
|---|---|
public static int CDWord(long value) |
Converts a 64-bit signed integer to a 32-bit signed integer, applying a custom transformation for values greater than <see cref="int.MaxValue"/>. <remarks>If <paramref name="value"/> is greater than <see cref="int.MaxValue"/>, the method applies a specific transformation before casting to <see cref="int"/>. This is not a standard cast and may produce negative results for large input values.</remarks> <param name="value">The 64-bit signed integer value to convert.</param> <returns>A 32-bit signed integer representing the converted value. For values greater than <see cref="int.MaxValue"/>, a custom transformation is applied before conversion.</returns> |
public static int FromByteArray(byte[] bytes) => ... |
Creates an integer value from the specified byte array. <param name="bytes">The byte array containing the bytes to convert to an integer. The array must contain at least the number of bytes required to represent an integer.</param> <returns>An integer value represented by the specified byte array.</returns> |
public static int FromByteArray(byte[] bytes, int start) => ... |
Creates an integer value from a byte array starting at the specified index. <param name="bytes">The byte array containing the data to convert.</param> <param name="start">The zero-based index in the array at which to begin reading bytes.</param> <returns>The integer value represented by the bytes starting at the specified index.</returns> |
public static int FromSpan(ReadOnlySpan<byte> bytes) |
Creates a 32-bit signed integer from the first four bytes of the specified read-only byte span, interpreting the bytes as big-endian. <remarks>This method interprets the byte order as big-endian, regardless of the system's endianness. Additional bytes in the span beyond the first four are ignored.</remarks> <param name="bytes">A read-only span of bytes containing at least four bytes to convert to a 32-bit signed integer. The first four bytes are used for the conversion.</param> <returns>A 32-bit signed integer represented by the first four bytes of the span, interpreted as big-endian.</returns> <exception cref="ArgumentException">Thrown when the length of <paramref name="bytes"/> is less than 4.</exception> |
public static int FromBytes(byte v1, byte v2, byte v3, byte v4) => ... |
Creates a 32-bit signed integer from four bytes, using little-endian byte order. <remarks>The bytes are combined such that v1 is the least significant byte and v4 is the most significant byte. This method is useful for reconstructing an integer from a byte array, such as when reading binary data from a stream.</remarks> <param name="v1">The least significant byte of the resulting integer.</param> <param name="v2">The second byte of the resulting integer.</param> <param name="v3">The third byte of the resulting integer.</param> <param name="v4">The most significant byte of the resulting integer.</param> <returns>A 32-bit signed integer composed from the specified bytes in little-endian order.</returns> |
public static int[] ToArray(byte[] bytes) => ... |
Converts a byte array to an array of 32-bit integers. <param name="bytes">The byte array to convert. The length must be a multiple of 4.</param> <returns>An array of 32-bit integers representing the converted values from the input byte array.</returns> |
public static int[] ToArray(ReadOnlySpan<byte> bytes) |
Converts a read-only span of bytes to an array of 32-bit integers. <remarks>Each group of four consecutive bytes in the input span is interpreted as a single 32-bit integer. The conversion uses the byte order expected by the FromSpan method. If the length of the span is not a multiple of 4, any remaining bytes are ignored.</remarks> <param name="bytes">The input span containing the bytes to convert. The length must be a multiple of 4.</param> <returns>An array of 32-bit integers parsed from the input byte span.</returns> |
public static byte[] ToByteArray(int value) |
Converts the specified 32-bit signed integer to a byte array in little-endian order. <remarks>The returned array represents the integer in little-endian format, with the least significant byte at index 0. This method is useful for serialization or interoperability with systems that require byte-level representations of integers.</remarks> <param name="value">The 32-bit signed integer to convert to a byte array.</param> <returns>A 4-element byte array containing the little-endian representation of the specified integer.</returns> |
public static void ToSpan(int value, Span<byte> destination) |
Writes the specified 32-bit integer value to the provided span in big-endian byte order. <remarks>This method writes the integer in big-endian format, regardless of the system's native endianness. The first four bytes of the destination span will be overwritten.</remarks> <param name="value">The 32-bit integer value to write to the span.</param> <param name="destination">The span of bytes that will receive the big-endian representation of the value. Must be at least 4 bytes in length.</param> <exception cref="ArgumentException">Thrown if destination is less than 4 bytes in length.</exception> |
public static void ToSpan(ReadOnlySpan<int> values, Span<byte> destination) |
Writes the binary representation of each 32-bit integer in the specified read-only span to the provided destination span of bytes. <param name="values">A read-only span of 32-bit integers to convert to their binary representation.</param> <param name="destination">A span of bytes that receives the binary data. Must be at least four times the length of <paramref name="values"/>.</param> <exception cref="ArgumentException">Thrown if <paramref name="destination"/> is not large enough to contain the binary representations of all values.</exception> |
public static byte[] ToByteArray(int[] value) |
Converts an array of 32-bit integers to its equivalent byte array representation. <param name="value">An array of 32-bit integers to convert. Cannot be null.</param> <returns>A byte array containing the binary representation of the input integer array. The length of the returned array is four times the length of the input array.</returns> |
IoT.Driver.S7PlcRx.PlcTypes.DWord
Source: PlcTypes/DWord.cs:16
Provides utility methods for converting between S7 DWord (4-byte) representations and unsigned 32-bit integers (uint). <remarks>All conversions assume S7 DWord format, which uses big-endian byte order. These methods are intended for working with Siemens S7 PLC data or other protocols that represent 32-bit unsigned integers in big-endian format. Methods throw exceptions if provided buffers are too small to contain a DWord value.</remarks>
| Member | Summary |
|---|---|
public static uint FromByteArray(byte[] bytes) => ... |
Creates a 32-bit unsigned integer from a byte array. <param name="bytes">The byte array containing the bytes to convert. Must contain at least four bytes starting at the beginning of the array.</param> <returns>A 32-bit unsigned integer represented by the first four bytes of the array.</returns> |
public static uint FromByteArray(byte[] bytes, int start) => ... |
Converts a sequence of bytes from the specified array, starting at the given index, to a 32-bit unsigned integer. <param name="bytes">The array containing the bytes to convert.</param> <param name="start">The zero-based index in the array at which to begin reading bytes.</param> <returns>A 32-bit unsigned integer representing the converted value from the specified byte sequence.</returns> |
public static uint FromSpan(ReadOnlySpan<byte> bytes) |
Creates a 32-bit unsigned integer from the first four bytes of the specified read-only byte span, interpreting the bytes as big-endian. <remarks>This method interprets the input bytes using big-endian byte order, regardless of the system's endianness. If the span contains more than four bytes, only the first four are used.</remarks> <param name="bytes">A read-only span of bytes containing at least four bytes to convert to a 32-bit unsigned integer. The first four bytes are used in the conversion.</param> <returns>A 32-bit unsigned integer represented by the first four bytes of the span, interpreted as big-endian.</returns> <exception cref="ArgumentException">Thrown when the length of <paramref name="bytes"/> is less than 4.</exception> |
public static uint FromBytes(byte v1, byte v2, byte v3, byte v4) => ... |
Creates a 32-bit unsigned integer from four individual bytes, using little-endian byte order. <remarks>The bytes are combined such that v1 is the lowest-order byte and v4 is the highest-order byte. This method is useful for reconstructing a UInt32 value from a sequence of bytes, such as when reading binary data from a stream.</remarks> <param name="v1">The least significant byte of the resulting 32-bit unsigned integer.</param> <param name="v2">The second byte, which becomes the second least significant byte of the resulting value.</param> <param name="v3">The third byte, which becomes the third least significant byte of the resulting value.</param> <param name="v4">The most significant byte of the resulting 32-bit unsigned integer.</param> <returns>A 32-bit unsigned integer composed from the specified bytes in little-endian order.</returns> |
public static uint[] ToArray(byte[] bytes) => ... |
Converts the specified byte array to an array of 32-bit unsigned integers. <remarks>The conversion uses the default byte order of the system architecture. If the length of the input array is not a multiple of 4, an exception may be thrown.</remarks> <param name="bytes">The byte array to convert. The length must be a multiple of 4.</param> <returns>An array of 32-bit unsigned integers representing the converted values from the input byte array.</returns> |
public static uint[] ToArray(ReadOnlySpan<byte> bytes) |
Converts the specified read-only span of bytes to an array of 32-bit unsigned integers. <remarks>Each group of four consecutive bytes in the input span is interpreted as a single 32-bit unsigned integer. The conversion uses the byte order expected by the FromSpan method. If the length of the span is not a multiple of 4, any remaining bytes are ignored.</remarks> <param name="bytes">The read-only span of bytes to convert. The length must be a multiple of 4.</param> <returns>An array of 32-bit unsigned integers representing the converted values from the input byte span.</returns> |
public static byte[] ToByteArray(uint value) |
Converts the specified 32-bit unsigned integer to a byte array in little-endian order. <param name="value">The 32-bit unsigned integer to convert to a byte array.</param> <returns>A 4-element byte array containing the bytes of the specified value in little-endian order.</returns> |
public static void ToSpan(uint value, Span<byte> destination) |
Writes the specified 32-bit unsigned integer value to the provided span in big-endian byte order. <remarks>This method writes the value in big-endian format, regardless of the system's native endianness. The first byte in the span will contain the most significant byte of the value.</remarks> <param name="value">The 32-bit unsigned integer value to write to the span.</param> <param name="destination">The span of bytes that receives the big-endian representation of the value. Must be at least 4 bytes in length.</param> <exception cref="ArgumentException">Thrown if the length of destination is less than 4 bytes.</exception> |
public static void ToSpan(ReadOnlySpan<uint> values, Span<byte> destination) |
Converts each 32-bit unsigned integer in the specified read-only span to its byte representation and writes the result to the provided destination span. <param name="values">A read-only span of 32-bit unsigned integers to convert to bytes.</param> <param name="destination">A span of bytes that receives the byte representations of the input values. Must be at least four times the length of <paramref name="values"/>.</param> <exception cref="ArgumentException">Thrown when <paramref name="destination"/> is not large enough to contain the byte representations of all elements in <paramref name="values"/>.</exception> |
public static byte[] ToByteArray(uint[] value) |
Converts the specified array of 32-bit unsigned integers to a byte array. <param name="value">An array of 32-bit unsigned integers to convert. Cannot be null.</param> <returns>A byte array containing the binary representation of the input values. The length of the returned array is four times the length of the input array.</returns> |
IoT.Driver.S7PlcRx.PlcTypes.DateTime
Source: PlcTypes/DateTime.cs:11
Contains the methods to convert between <see cref="T:System.DateTime"/> and S7 representation of datetime values.
| Member | Summary |
|---|---|
public static readonly System.DateTime SpecMinimumDateTime = new(1990, 1, 1); |
The minimum <see cref="T:System.DateTime"/> value supported by the specification. |
public static readonly System.DateTime SpecMaximumDateTime = new(2089, 12, 31, 23, 59, 59, 999); |
The maximum <see cref="T:System.DateTime"/> value supported by the specification. |
public static System.DateTime FromByteArray(byte[] bytes) => ... |
Parses a <see cref="T:System.DateTime"/> value from bytes. <param name="bytes">Input bytes read from PLC.</param> <returns>A <see cref="T:System.DateTime"/> object representing the value read from PLC.</returns> |
public static System.DateTime FromSpan(ReadOnlySpan<byte> bytes) |
Parses a <see cref="T:System.DateTime"/> value from a span. <param name="bytes">Input bytes span read from PLC.</param> <returns>A <see cref="T:System.DateTime"/> object representing the value read from PLC.</returns> |
public static System.DateTime[] ToArray(byte[] bytes) => ... |
Parses an array of <see cref="T:System.DateTime"/> values from bytes. <param name="bytes">Input bytes read from PLC.</param> <returns>An array of <see cref="T:System.DateTime"/> objects representing the values read from PLC.</returns> |
public static System.DateTime[] ToArray(ReadOnlySpan<byte> bytes) |
Parses an array of <see cref="T:System.DateTime"/> values from a span. <param name="bytes">Input bytes span read from PLC.</param> <returns>An array of <see cref="T:System.DateTime"/> objects representing the values read from PLC.</returns> |
public static byte[] ToByteArray(System.DateTime dateTime) |
Converts a <see cref="T:System.DateTime"/> value to a byte array. <param name="dateTime">The DateTime value to convert.</param> <returns>A byte array containing the S7 date time representation of <paramref name="dateTime"/>.</returns> |
public static void ToSpan(System.DateTime dateTime, Span<byte> destination) |
Converts a <see cref="T:System.DateTime"/> value to a span. <param name="dateTime">The DateTime value to convert.</param> <param name="destination">The destination span.</param> |
public static byte[] ToByteArray(System.DateTime[] dateTimes) |
Converts an array of <see cref="T:System.DateTime"/> values to a byte array. <param name="dateTimes">The DateTime values to convert.</param> <returns>A byte array containing the S7 date time representations of <paramref name="dateTimes"/>.</returns> |
public static void ToSpan(ReadOnlySpan<System.DateTime> dateTimes, Span<byte> destination) |
Converts multiple DateTime values to the specified span. <param name="dateTimes">The DateTime values.</param> <param name="destination">The destination span.</param> |
IoT.Driver.S7PlcRx.PlcTypes.DateTimeLong
Source: PlcTypes/DateTimeLong.cs:11
Contains the methods to convert between <see cref="T:System.DateTime" /> and S7 representation of DateTimeLong (DTL) values.
| Member | Summary |
|---|---|
public const int TypeLengthInBytes = 12; |
The type length in bytes. |
public static readonly System.DateTime SpecMinimumDateTime = new(1970, 1, 1); |
The minimum <see cref="T:System.DateTime" /> value supported by the specification. |
public static readonly System.DateTime SpecMaximumDateTime = new(2262, 4, 11, 23, 47, 16, 854); |
The maximum <see cref="T:System.DateTime" /> value supported by the specification. |
public static System.DateTime FromByteArray(byte[] bytes) => ... |
Parses a <see cref="T:System.DateTime" /> value from bytes. <param name="bytes">Input bytes read from PLC.</param> <returns>A <see cref="T:System.DateTime" /> object representing the value read from PLC.</returns> |
public static System.DateTime FromSpan(ReadOnlySpan<byte> bytes) |
Parses a <see cref="T:System.DateTime" /> value from a span. <param name="bytes">Input bytes span read from PLC.</param> <returns>A <see cref="T:System.DateTime" /> object representing the value read from PLC.</returns> |
public static System.DateTime[] ToArray(byte[] bytes) => ... |
Parses an array of <see cref="T:System.DateTime" /> values from bytes. <param name="bytes">Input bytes read from PLC.</param> <returns>An array of <see cref="T:System.DateTime" /> objects representing the values read from PLC.</returns> |
public static System.DateTime[] ToArray(ReadOnlySpan<byte> bytes) |
Parses an array of <see cref="T:System.DateTime" /> values from a span. <param name="bytes">Input bytes span read from PLC.</param> <returns>An array of <see cref="T:System.DateTime" /> objects representing the values read from PLC.</returns> |
public static byte[] ToByteArray(System.DateTime dateTime) |
Converts a <see cref="T:System.DateTime" /> value to a byte array. <param name="dateTime">The DateTime value to convert.</param> <returns>A byte array containing the S7 DateTimeLong representation of <paramref name="dateTime" />.</returns> |
public static void ToSpan(System.DateTime dateTime, Span<byte> destination) |
Converts a <see cref="T:System.DateTime" /> value to a span. <param name="dateTime">The DateTime value to convert.</param> <param name="destination">The destination span.</param> |
public static byte[] ToByteArray(System.DateTime[] dateTimes) |
Converts an array of <see cref="T:System.DateTime" /> values to a byte array. <param name="dateTimes">The DateTime values to convert.</param> <returns>A byte array containing the S7 DateTimeLong representations of <paramref name="dateTimes" />.</returns> |
public static void ToSpan(ReadOnlySpan<System.DateTime> dateTimes, Span<byte> destination) |
Converts multiple DateTime values to the specified span. <param name="dateTimes">The DateTime values.</param> <param name="destination">The destination span.</param> |
IoT.Driver.S7PlcRx.PlcTypes.Int
Source: PlcTypes/Int.cs:16
Provides static methods for converting between S7 Int (16-bit signed integer) representations and .NET types, including byte arrays and spans. <remarks>This class is intended for working with Siemens S7 PLC data formats, which use big-endian byte order for 16-bit signed integers. All methods assume S7 Int format unless otherwise specified. The class is internal and not intended for direct use outside of the containing assembly.</remarks>
| Member | Summary |
|---|---|
public static short CWord(int value) |
Converts a 32-bit signed integer to a 16-bit signed integer, applying a custom transformation for values greater than 32,767. <remarks>If the input value is greater than 32,767, a specific transformation is applied before conversion. This method does not throw an exception for values outside the range of a 16-bit signed integer; instead, it applies the custom logic to produce a result within the range.</remarks> <param name="value">The 32-bit signed integer to convert.</param> <returns>A 16-bit signed integer representing the converted value.</returns> |
public static short FromByteArray(byte[] bytes) => ... |
Converts a byte array to a 16-bit signed integer. <param name="bytes">The byte array containing the bytes to convert. Must contain at least two bytes starting at index zero.</param> <returns>A 16-bit signed integer represented by the first two bytes of the array.</returns> |
public static short FromByteArray(byte[] bytes, int start) => ... |
Converts a sequence of bytes from the specified array, starting at the given index, to a 16-bit signed integer. <param name="bytes">The byte array containing the data to convert.</param> <param name="start">The zero-based index in the array at which to begin reading the bytes.</param> <returns>A 16-bit signed integer represented by the two bytes starting at the specified index in the array.</returns> |
public static short FromSpan(ReadOnlySpan<byte> bytes) |
Creates a 16-bit signed integer from the first two bytes of the specified read-only byte span, interpreting the bytes as big-endian. <remarks>This method interprets the input bytes using big-endian byte order, regardless of the system's endianness. This is commonly used for protocols or file formats that specify big-endian encoding.</remarks> <param name="bytes">A read-only span of bytes containing at least two bytes. The first two bytes are used to construct the 16-bit signed integer.</param> <returns>A 16-bit signed integer represented by the first two bytes of the span, interpreted as big-endian.</returns> <exception cref="ArgumentException">Thrown when the length of <paramref name="bytes"/> is less than 2.</exception> |
public static short FromBytes(byte loVal, byte hiVal) => ... |
Creates a 16-bit signed integer from two bytes, using the specified low and high byte values. <remarks>The bytes are combined in little-endian order, with loVal as the least significant byte and hiVal as the most significant byte.</remarks> <param name="loVal">The low-order byte of the 16-bit value.</param> <param name="hiVal">The high-order byte of the 16-bit value.</param> <returns>A 16-bit signed integer formed by combining the specified low and high bytes.</returns> |
public static short[] ToArray(byte[] bytes) => ... |
Converts the specified byte array to an array of 16-bit signed integers. <remarks>The conversion interprets each consecutive pair of bytes as a single 16-bit signed integer. The byte order used for conversion is platform-dependent. If the length of the input array is not a multiple of 2, an exception may be thrown.</remarks> <param name="bytes">The byte array to convert. The length must be a multiple of 2.</param> <returns>An array of 16-bit signed integers representing the converted values from the input byte array.</returns> |
public static short[] ToArray(ReadOnlySpan<byte> bytes) |
Converts a read-only span of bytes to an array of 16-bit signed integers. <remarks>Each pair of bytes in the input span is interpreted as a single 16-bit signed integer. The conversion uses the byte order expected by the FromSpan method. If the length of the span is not a multiple of 2, any remaining bytes are ignored.</remarks> <param name="bytes">The read-only span of bytes to convert. The length must be a multiple of 2.</param> <returns>An array of 16-bit signed integers representing the converted values from the input span.</returns> |
public static byte[] ToByteArray(short value) |
Converts the specified 16-bit signed integer to a byte array. <param name="value">The 16-bit signed integer to convert.</param> <returns>A byte array containing the two bytes that represent the specified value.</returns> |
public static void ToSpan(short value, Span<byte> destination) |
Writes the specified 16-bit signed integer value to the provided span in big-endian byte order. <remarks>This method writes the value in big-endian format, regardless of the system's native endianness. The caller is responsible for ensuring that the destination span has sufficient space.</remarks> <param name="value">The 16-bit signed integer value to write to the span.</param> <param name="destination">The span of bytes that receives the big-endian representation of the value. Must be at least 2 bytes in length.</param> <exception cref="ArgumentException">Thrown if the length of destination is less than 2 bytes.</exception> |
public static void ToSpan(ReadOnlySpan<short> values, Span<byte> destination) |
Writes the contents of a span of 16-bit signed integers to a span of bytes in little-endian order. <param name="values">The source span containing the 16-bit signed integer values to write.</param> <param name="destination">The destination span where the bytes will be written. Must be at least twice the length of <paramref name="values"/>.</param> <exception cref="ArgumentException">Thrown if <paramref name="destination"/> is not large enough to contain the converted bytes.</exception> |
public static byte[] ToByteArray(short[] value) |
Converts an array of 16-bit signed integers to a byte array. <param name="value">An array of 16-bit signed integers to convert. Cannot be null.</param> <returns>A byte array containing the binary representation of the input values.</returns> |
IoT.Driver.S7PlcRx.PlcTypes.LReal
Source: PlcTypes/LReal.cs:17
Provides static methods for converting between S7 LReal (64-bit floating point) representations and .NET double values. <remarks>The methods in this class handle conversion between S7 LReal format (used in Siemens S7 PLCs) and .NET double values, including proper handling of endianness. All methods are static and intended for internal use when working with S7 protocol data. This class is not thread-safe, but all members are stateless and safe for concurrent use.</remarks>
| Member | Summary |
|---|---|
public static double FromByteArray(byte[] bytes) => ... |
Converts a byte array to a double-precision floating-point number. <param name="bytes">The byte array containing the binary representation of a double-precision floating-point value. Must be at least 8 bytes in length.</param> <returns>A double-precision floating-point number represented by the specified byte array.</returns> |
public static double FromByteArray(byte[] bytes, int start) => ... |
Converts a sequence of bytes from the specified array, starting at the given index, to a double-precision floating-point number. <param name="bytes">The byte array containing the value to convert.</param> <param name="start">The zero-based index in the array at which to begin reading the bytes.</param> <returns>A double-precision floating-point number represented by the specified bytes.</returns> |
public static double FromSpan(ReadOnlySpan<byte> bytes) |
Converts the first 8 bytes of a read-only byte span to a double-precision floating-point value, interpreting the bytes as big-endian format. <remarks>This method interprets the input bytes as a big-endian IEEE 754 double-precision value, regardless of the system's endianness. If the span contains more than 8 bytes, only the first 8 bytes are used.</remarks> <param name="bytes">A read-only span of bytes containing at least 8 bytes representing a double-precision floating-point value in big-endian order.</param> <returns>A double-precision floating-point value represented by the first 8 bytes of the span.</returns> <exception cref="ArgumentException">Thrown when the length of <paramref name="bytes"/> is less than 8.</exception> |
public static double FromDWord(int value) => ... |
Converts a 32-bit signed integer in DWord format to its equivalent double-precision floating-point value. <param name="value">The 32-bit signed integer value in DWord format to convert.</param> <returns>A double-precision floating-point value that represents the specified DWord.</returns> |
public static double FromDWord(uint value) => ... |
Converts the specified 32-bit unsigned integer to its double-precision floating-point representation. <param name="value">The 32-bit unsigned integer value to convert.</param> <returns>A double-precision floating-point number that represents the specified 32-bit unsigned integer.</returns> |
public static double[] ToArray(byte[] bytes) => ... |
Converts a byte array to an array of double-precision floating-point values. <remarks>The method interprets each consecutive group of 8 bytes in the input array as a double-precision floating-point value, using the system's endianness. If the length of the input array is not a multiple of 8, an exception may be thrown.</remarks> <param name="bytes">The byte array to convert. The length must be a multiple of the size of a double (8 bytes).</param> <returns>An array of double values created from the input byte array.</returns> |
public static double[] ToArray(ReadOnlySpan<byte> bytes) |
Converts a read-only span of bytes to an array of double-precision floating-point values. <remarks>The method interprets each consecutive group of 8 bytes in the span as a double-precision floating-point value. The conversion uses the system's endianness. Any remaining bytes that do not form a complete double are ignored.</remarks> <param name="bytes">A read-only span of bytes representing the binary data to convert. The length must be a multiple of 8, as each double value is represented by 8 bytes.</param> <returns>An array of double values parsed from the specified byte span. The length of the array is equal to the number of complete double values in the input.</returns> |
public static byte[] ToByteArray(double value) |
Converts the specified double-precision floating-point value to its equivalent 8-byte array representation. <param name="value">The double-precision floating-point number to convert.</param> <returns>A byte array containing the 8-byte binary representation of the specified value.</returns> |
public static void ToSpan(double value, Span<byte> destination) |
Writes the specified double-precision floating-point value to the provided span in big-endian byte order. <remarks>This method writes the value in big-endian format, which is commonly used in certain binary protocols such as Siemens S7. If the current platform is little-endian, the bytes are reversed to ensure correct ordering.</remarks> <param name="value">The double-precision floating-point value to write to the span.</param> <param name="destination">The span of bytes that will receive the 8-byte big-endian representation of the value. Must be at least 8 bytes in length.</param> <exception cref="ArgumentException">Thrown if the length of destination is less than 8 bytes.</exception> |
public static void ToSpan(ReadOnlySpan<double> values, Span<byte> destination) |
Writes each double-precision value to the destination as S7 bytes. The destination must be at least values.Length * 8 bytes; otherwise it throws ArgumentException. |
public static byte[] ToByteArray(double[] value) |
Converts an array of double-precision floating-point numbers to a byte array representation. <param name="value">The array of double values to convert. Cannot be null.</param> <returns>A byte array containing the binary representation of the input double array. The array will be empty if the input array is empty.</returns> |
IoT.Driver.S7PlcRx.PlcTypes.Real
Source: PlcTypes/Real.cs:16
Provides static methods for converting between Siemens S7 Real (4-byte IEEE 754 floating-point) representations and .NET float values. <remarks>The methods in this class handle endianness according to the S7 protocol, which uses big-endian byte order. Use these methods to serialize and deserialize float values when communicating with Siemens S7 PLCs or working with S7 Real data formats. All methods are static and intended for internal use.</remarks>
| Member | Summary |
|---|---|
public static float FromByteArray(byte[] bytes) => ... |
Converts a byte array to a single-precision floating-point value. <param name="bytes">The byte array containing the bytes to convert. Must contain at least four bytes representing a 32-bit floating-point value in the expected format.</param> <returns>A single-precision floating-point value represented by the specified byte array.</returns> |
public static float FromSpan(ReadOnlySpan<byte> bytes) |
Converts a 4-byte big-endian span to a single-precision floating-point value. <remarks>This method interprets the input bytes as a big-endian IEEE 754 single-precision floating-point value, regardless of the system's endianness. Use this method when reading floating-point values from protocols or file formats that use big-endian byte order, such as Siemens S7 PLCs.</remarks> <param name="bytes">A read-only span of 4 bytes representing a single-precision floating-point value in big-endian byte order.</param> <returns>A single-precision floating-point value represented by the specified big-endian byte span.</returns> <exception cref="ArgumentException">Thrown when the length of <paramref name="bytes"/> is not 4.</exception> |
public static byte[] ToByteArray(float value) |
Converts the specified single-precision floating-point value to its equivalent byte array representation. <remarks>The byte order of the returned array is platform-dependent. To ensure consistent results across different systems, consider specifying endianness explicitly if required.</remarks> <param name="value">The single-precision floating-point value to convert.</param> <returns>A 4-byte array containing the binary representation of <paramref name="value"/>.</returns> |
public static void ToSpan(float value, Span<byte> destination) |
Writes the 4-byte big-endian representation of the specified single-precision floating-point value into the provided span. <remarks>The value is written in big-endian byte order, regardless of the system's endianness. This is commonly required for protocols or file formats that specify big-endian encoding.</remarks> <param name="value">The single-precision floating-point value to write to the span.</param> <param name="destination">The span of bytes that receives the 4-byte big-endian representation of the value. Must be at least 4 bytes in length.</param> <exception cref="ArgumentException">Thrown if the length of destination is less than 4 bytes.</exception> |
public static byte[] ToByteArray(float[] value) |
Converts an array of single-precision floating-point values to a byte array. <param name="value">The array of <see cref="float"/> values to convert. Cannot be null.</param> <returns>A byte array containing the binary representation of the input values.</returns> |
public static void ToSpan(ReadOnlySpan<float> values, Span<byte> destination) |
Converts a span of single-precision floating-point values to their byte representations and writes them to the specified destination span. <param name="values">The span of single-precision floating-point values to convert.</param> <param name="destination">The destination span to which the byte representations of the values are written. Must be at least four times the length of <paramref name="values"/>.</param> <exception cref="ArgumentException">Thrown when <paramref name="destination"/> is not large enough to contain the byte representations of all values.</exception> |
public static float[] ToArray(byte[] bytes) => ... |
Converts a byte array to an array of single-precision floating-point values. <remarks>The method interprets each group of four bytes in the input array as a single-precision floating-point value, using the default endianness of the system. If the length of <paramref name="bytes"/> is not a multiple of 4, an exception may be thrown.</remarks> <param name="bytes">The byte array containing the binary representation of the floating-point values. The length must be a multiple of 4.</param> <returns>An array of <see cref="float"/> values converted from the specified byte array.</returns> |
public static float[] ToArray(ReadOnlySpan<byte> bytes) |
Converts a read-only span of bytes to an array of 32-bit floating-point values. <remarks>The method interprets each consecutive group of 4 bytes in the input span as a single-precision floating-point value. The byte order and format must match the expected representation for floats on the current platform.</remarks> <param name="bytes">The read-only span of bytes to convert. The length must be a multiple of 4, as each float consists of 4 bytes.</param> <returns>An array of 32-bit floating-point values parsed from the input byte span.</returns> |
IoT.Driver.S7PlcRx.PlcTypes.S7String
Source: PlcTypes/S7String.cs:15
Provides methods for encoding and decoding S7 string values to and from byte arrays using the S7 protocol format. <remarks>This static class supports conversion between .NET strings and the S7 string format used in Siemens PLCs, which includes a 2-byte header indicating the reserved and actual string lengths. The encoding used for string conversion can be configured via the StringEncoding property. All methods are thread-safe.</remarks>
| Member | Summary |
|---|---|
public static Encoding StringEncoding |
Gets or sets the Encoding used when serializing and deserializing S7String (Encoding.ASCII by default). <value> The string encoding. </value> <exception cref="System.ArgumentNullException">StringEncoding.</exception> <exception cref="ArgumentNullException">StringEncoding must not be null.</exception> |
public static string FromByteArray(byte[] bytes) => ... |
Converts S7 bytes to a string. <param name="bytes">The bytes.</param> <returns>A string.</returns> <exception cref="IoT.Driver.S7PlcRx.PlcException"> Malformed S7 String / too short or Malformed S7 String / length larger than capacity or Failed to parse {VarType.S7String} from data. Following fields were read: size: '{size}', actual length: '{length}', total number of bytes (including header): '{bytes.Length}'. </exception> |
public static string FromSpan(ReadOnlySpan<byte> bytes) |
Converts S7 bytes from span to a string. <param name="bytes">The bytes span.</param> <returns>A string.</returns> <exception cref="IoT.Driver.S7PlcRx.PlcException"> Malformed S7 String / too short or Malformed S7 String / length larger than capacity or Failed to parse {VarType.S7String} from data. Following fields were read: size: '{size}', actual length: '{length}', total number of bytes (including header): '{bytes.Length}'. </exception> |
public static byte[] ToByteArray(string? value, int reservedLength) |
Converts a <see cref="T:string"/> to S7 string with 2-byte header. <param name="value">The string to convert to byte array.</param> <param name="reservedLength">The length (in characters) allocated in PLC for the string.</param> <returns>A <see cref="T:byte[]" /> containing the string header and string value with a maximum length of <paramref name="reservedLength"/> + 2.</returns> |
public static int ToSpan(string? value, int reservedLength, Span<byte> destination) |
Converts a string to S7 string format in the specified span. <param name="value">The string to convert.</param> <param name="reservedLength">The length allocated in PLC for the string.</param> <param name="destination">The destination span.</param> <returns>The number of bytes written.</returns> <exception cref="ArgumentNullException">value.</exception> <exception cref="ArgumentException"> The maximum string length supported is 254. or Destination span is too small. </exception> |
public static bool TryToSpan(string? value, int reservedLength, Span<byte> destination, out int bytesWritten) |
Tries to convert a string to S7 string format in the specified span. <param name="value">The string to convert.</param> <param name="reservedLength">The length allocated in PLC for the string.</param> <param name="destination">The destination span.</param> <param name="bytesWritten">The number of bytes written.</param> <returns>True if successful, false if the destination is too small.</returns> |
public static int GetByteLength(int reservedLength) => ... |
Gets the total byte length for an S7 string with the specified reserved length. <param name="reservedLength">The reserved length for the string.</param> <returns>The total byte length including header.</returns> |
IoT.Driver.S7PlcRx.PlcTypes.S7StringAttribute
Source: PlcTypes/S7StringAttribute.cs:16
| Member | Summary |
|---|---|
public S7StringAttribute(S7StringType type, int reservedLength) |
Initializes a new instance of the <see cref="S7StringAttribute"/> class with the specified string type and reserved length. <param name="type">The type of S7 string to use. Must be a defined value of the S7StringType enumeration.</param> <param name="reservedLength">The reserved length for the string. Specifies the maximum number of characters the string can hold.</param> <exception cref="ArgumentException">Thrown if the specified type is not a valid value of the S7StringType enumeration.</exception> |
public S7StringType Type get; } |
Gets the type of the S7 string represented by this instance. |
public int ReservedLength get; } |
Gets the number of characters reserved for the value. |
public int ReservedLengthInBytes => ... |
Gets the total number of bytes reserved for the string, including any protocol-specific header or length fields. <remarks>The reserved length in bytes depends on the string type. For S7String, the value includes 2 bytes for header information; for S7WString, it includes 4 bytes for header information and accounts for UTF-16 encoding. This value is typically used to allocate buffers or validate data boundaries when working with S7 string types.</remarks> |
IoT.Driver.S7PlcRx.PlcTypes.S7WString
Source: PlcTypes/S7WString.cs:15
Provides static methods for converting between S7 WString byte arrays and .NET strings. <remarks>The S7WString class supports encoding and decoding of S7 WString values, which are commonly used in Siemens S7 PLCs. All methods are static and thread-safe. The S7 WString format includes a 4-byte header specifying the reserved and actual string lengths, followed by the UTF-16 encoded string data.</remarks>
| Member | Summary |
|---|---|
public static string FromByteArray(byte[] bytes) |
Converts a byte array containing an S7 WString value to its corresponding .NET string representation. <remarks>The input array must follow the S7 WString format, where the first two bytes specify the maximum capacity, the next two bytes specify the actual string length, and the remaining bytes contain the UTF-16 encoded string data in big-endian order.</remarks> <param name="bytes">The byte array containing the S7 WString data, including the 4-byte header. Must not be null and must have a length of at least 4 bytes.</param> <returns>A string representing the decoded S7 WString value from the specified byte array.</returns> <exception cref="PlcException">Thrown if the input array is null, too short, contains malformed S7 WString data, or if decoding fails.</exception> |
public static byte[] ToByteArray(string? value, int reservedLength) |
Converts the specified string to a big-endian Unicode byte array with a reserved length prefix. <remarks>The returned byte array begins with a 4-byte header: the first two bytes represent the reserved length, and the next two bytes represent the actual string length, both in big-endian order. The string is encoded using big-endian Unicode (UTF-16BE).</remarks> <param name="value">The string to convert to a byte array. Cannot be null.</param> <param name="reservedLength">The number of characters to reserve in the output buffer. Must be less than or equal to 16,382 and greater than or equal to the length of <paramref name="value"/>.</param> <returns>A byte array containing a 4-byte header followed by the big-endian Unicode bytes of the string, padded to the reserved length if necessary.</returns> <exception cref="ArgumentNullException">Thrown if <paramref name="value"/> is null.</exception> <exception cref="ArgumentException">Thrown if <paramref name="reservedLength"/> is greater than 16,382, or if the length of <paramref name="value"/> exceeds <paramref name="reservedLength"/>.</exception> |
IoT.Driver.S7PlcRx.PlcTypes.String
Source: PlcTypes/String.cs:14
Provides utility methods for converting between strings and byte arrays using ASCII encoding. <remarks>All methods in this class use ASCII encoding for conversions. These methods are intended for scenarios where data is known to be ASCII-compatible. Non-ASCII characters will be replaced with '?' during encoding and decoding. The class is internal and intended for use within the assembly.</remarks>
| Member | Summary |
|---|---|
public static string FromByteArray(byte[] bytes) => ... |
Decodes a UTF-8 encoded byte array into a string. <param name="bytes">The byte array containing the UTF-8 encoded text to decode. Cannot be null.</param> <returns>A string representation of the decoded UTF-8 text. Returns an empty string if the array is empty.</returns> |
public static string FromSpan(ReadOnlySpan<byte> bytes) |
Converts the specified read-only span of ASCII-encoded bytes to its equivalent string representation. <param name="bytes">A read-only span containing the bytes to decode as an ASCII string.</param> <returns>A string that represents the decoded ASCII characters. Returns an empty string if <paramref name="bytes"/> is empty.</returns> |
public static string FromByteArray(byte[] bytes, int start, int length) |
Converts a specified range of bytes from a byte array to a string. <param name="bytes">The byte array containing the data to convert.</param> <param name="start">The zero-based index in the array at which to begin conversion.</param> <param name="length">The number of bytes to convert starting from <paramref name="start"/>.</param> <returns>A string representation of the specified range of bytes, or an empty string if the range exceeds the bounds of the array.</returns> |
public static byte[] ToByteArray(string? value) |
Converts the specified string to a byte array using ASCII encoding. <remarks>Characters in the input string that are not representable in ASCII are replaced with a question mark ("?") in the resulting byte array.</remarks> <param name="value">The string to convert to a byte array. If null or empty, an empty array is returned.</param> <returns>A byte array containing the ASCII-encoded bytes of the input string, or an empty array if the input is null or empty.</returns> |
public static int ToSpan(string? value, Span<byte> destination) |
Encodes the specified string as ASCII bytes and writes the result to the provided destination span. <remarks>Characters in the input string that cannot be represented in ASCII are replaced with a question mark ('?').</remarks> <param name="value">The string to encode as ASCII. If null or empty, no bytes are written.</param> <param name="destination">The span to which the encoded ASCII bytes are written. Must be large enough to hold the encoded bytes.</param> <returns>The number of bytes written to the destination span. Returns 0 if the input string is null or empty.</returns> <exception cref="ArgumentException">Thrown if the destination span is not large enough to contain the encoded bytes.</exception> |
public static bool TryToSpan(string? value, Span<byte> destination, out int bytesWritten) |
Attempts to encode the specified string as ASCII bytes and write the result to the provided destination buffer. <remarks>If the input string is null or empty, no bytes are written and the method returns true. The method returns false if the destination buffer is not large enough to hold the encoded bytes.</remarks> <param name="value">The string to encode as ASCII. Can be null or empty.</param> <param name="destination">The buffer that receives the ASCII-encoded bytes of the string.</param> <param name="bytesWritten">When this method returns, contains the number of bytes written to the destination buffer. Set to 0 if the input string is null or empty.</param> <returns>true if the string was successfully encoded and written to the destination buffer; otherwise, false.</returns> |
IoT.Driver.S7PlcRx.PlcTypes.Struct
Source: PlcTypes/Struct.cs:17
Provides utility methods for working with struct types, including calculating their size in bytes and converting between structs and byte arrays. <remarks>The methods in this class are primarily intended for scenarios where struct data needs to be serialized to or deserialized from byte arrays, such as communication with PLCs or binary protocols. The struct types used with these methods should have public fields and, for string fields, must be decorated with the S7StringAttribute to specify their encoding and length. All methods are static and thread-safe.</remarks>
| Member | Summary |
|---|---|
public static int GetStructSize(Type structType) |
Calculates the total size, in bytes, required to store an instance of the specified struct type, based on its fields and their types. <remarks>This method inspects the public fields of the provided struct type and calculates the size according to the field types, including handling of custom attributes such as S7StringAttribute for string fields. The calculation may not account for all platform-specific alignment or padding rules.</remarks> <param name="structType">The type of the struct for which to calculate the size. Must not be null.</param> <returns>The total size, in bytes, needed to represent an instance of the specified struct type.</returns> <exception cref="ArgumentNullException">Thrown if structType is null.</exception> <exception cref="ArgumentException">Thrown if a string field in the struct does not have the required S7StringAttribute.</exception> |
public static object? FromBytes(Type structType, byte[] bytes) |
Deserializes a byte array into an instance of the specified structure type. <remarks>The method supports deserialization of structures containing fields of supported primitive types, strings with S7StringAttribute, and nested structures. All fields must be public. The structure's layout and field order must match the serialized byte format.</remarks> <param name="structType">The type of the structure to deserialize the byte array into. Must be a type with a parameterless constructor and supported field types.</param> <param name="bytes">The byte array containing the serialized data for the structure. The length must match the expected size of the structure.</param> <returns>An object representing the deserialized structure, or null if the byte array is null or does not match the expected size.</returns> <exception cref="ArgumentException">Thrown if an instance of the specified type cannot be created, or if a string field is missing the required S7StringAttribute, or if an invalid string type is specified for the S7StringAttribute.</exception> |
public static byte[] ToBytes(object structValue) |
Converts the specified structure object to its byte array representation. <remarks>Supported field types include Boolean, Byte, Int16, UInt16, Int32, UInt32, Single, Double, String (with S7StringAttribute), and TimeSpan. All fields of the structure must be of these types for successful conversion.</remarks> <param name="structValue">The structure object to convert to a byte array. Must not be null. The object's fields must be of supported types.</param> <returns>A byte array containing the serialized representation of the structure. Returns an empty array if <paramref name="structValue"/> is null.</returns> <exception cref="ArgumentException">Thrown if a field value cannot be converted to its corresponding type, or if a string field is missing the required S7StringAttribute, or if an invalid string type is specified in the S7StringAttribute.</exception> |
IoT.Driver.S7PlcRx.PlcTypes.TimeSpan
Source: PlcTypes/TimeSpan.cs:16
Provides methods and constants for converting between S7 PLC time representations and .NET <see cref="T:System.TimeSpan"/> values. <remarks>This class supports parsing and serializing <see cref="T:System.TimeSpan"/> values to and from the S7 PLC binary format, where time spans are represented as 4-byte signed integers in milliseconds. All methods assume the S7 time format and enforce the valid range defined by <see cref="F:SpecMinimumTimeSpan"/> and <see cref="F:SpecMaximumTimeSpan"/>. The class is static and cannot be instantiated.</remarks>
| Member | Summary |
|---|---|
public const int TypeLengthInBytes = 4; |
Represents the size, in bytes, of the type. |
public static readonly System.TimeSpan SpecMinimumTimeSpan = System.TimeSpan.FromMilliseconds(int.MinValue); |
Represents the minimum allowable value for a specification time span, defined as the number of milliseconds equal to <see cref="int.MinValue"/>. |
public static readonly System.TimeSpan SpecMaximumTimeSpan = System.TimeSpan.FromMilliseconds(int.MaxValue); |
Represents the maximum allowable time span for specification purposes, set to the largest value expressible in milliseconds as an integer. <remarks>This value is useful when an upper bound for a time interval is required, such as in timeout or delay scenarios where the maximum supported duration is needed. The value is equivalent to TimeSpan.FromMilliseconds(int.MaxValue).</remarks> |
public static System.TimeSpan FromByteArray(byte[] bytes) => ... |
Creates a TimeSpan structure from its binary representation in a byte array. <remarks>The byte array must contain a valid binary representation of a TimeSpan as produced by the corresponding serialization method. Supplying an array that is too short or incorrectly formatted may result in an exception.</remarks> <param name="bytes">A byte array containing the binary representation of a TimeSpan. The array must be at least 8 bytes in length and encoded in the expected format.</param> <returns>A TimeSpan value represented by the specified byte array.</returns> |
public static System.TimeSpan FromSpan(ReadOnlySpan<byte> bytes) |
Creates a TimeSpan from a read-only span of bytes representing a 32-bit integer value in milliseconds. <param name="bytes">A read-only span of bytes containing the 32-bit integer value, in little-endian format, representing the number of milliseconds for the TimeSpan. Must be at least 4 bytes in length.</param> <returns>A TimeSpan that represents the time interval specified by the 32-bit integer value, in milliseconds, contained in the input span.</returns> <exception cref="ArgumentOutOfRangeException">Thrown when the length of bytes is less than 4.</exception> |
public static System.TimeSpan[] ToArray(byte[] bytes) => ... |
Converts a byte array to an array of <see cref="System.TimeSpan"/> values. <remarks>The method interprets the input byte array as a sequence of <see cref="System.TimeSpan"/> values in their binary format. The caller is responsible for ensuring that the byte array was created using a compatible serialization method and that its length is valid.</remarks> <param name="bytes">The byte array containing the binary representation of one or more <see cref="System.TimeSpan"/> values. The array length must be a multiple of the size of a <see cref="System.TimeSpan"/> structure.</param> <returns>An array of <see cref="System.TimeSpan"/> values deserialized from the specified byte array.</returns> |
public static System.TimeSpan[] ToArray(ReadOnlySpan<byte> bytes) |
Converts a read-only span of bytes into an array of TimeSpan values, interpreting each group of bytes as a duration in milliseconds. <remarks>Each consecutive group of 8 bytes in the input is interpreted as a 64-bit signed integer in the platform's endianness, representing a duration in milliseconds. The method does not perform validation on the range of the resulting TimeSpan values.</remarks> <param name="bytes">A read-only span of bytes representing one or more 64-bit signed integer values, each corresponding to a duration in milliseconds.</param> <returns>An array of TimeSpan values created from the input bytes. Each element represents a duration corresponding to one 64-bit integer value in the input.</returns> <exception cref="ArgumentOutOfRangeException">Thrown when the length of bytes is not a multiple of the size of a 64-bit signed integer.</exception> |
public static byte[] ToByteArray(System.TimeSpan timeSpan) |
Converts the specified <see cref="System.TimeSpan"/> value to its binary representation as a byte array. <param name="timeSpan">The <see cref="System.TimeSpan"/> value to convert to a byte array.</param> <returns>A byte array containing the binary representation of the specified <see cref="System.TimeSpan"/> value.</returns> |
public static void ToSpan(System.TimeSpan timeSpan, Span<byte> destination) |
Encodes the specified <see cref="System.TimeSpan"/> value into its S7 time representation and writes the result to the provided byte span. <remarks>The S7 time representation encodes a time interval as a 4-byte value in milliseconds. Only time spans within the supported S7 range can be encoded.</remarks> <param name="timeSpan">The time interval to encode. Must be within the supported S7 time range.</param> <param name="destination">The span of bytes to which the encoded S7 time value will be written. Must be at least 4 bytes in length.</param> <exception cref="ArgumentException">Thrown if <paramref name="destination"/> is less than 4 bytes in length.</exception> <exception cref="ArgumentOutOfRangeException">Thrown if <paramref name="timeSpan"/> is less than the minimum or greater than the maximum value supported by the S7 time representation.</exception> |
public static byte[] ToByteArray(System.TimeSpan[] timeSpans) |
Converts an array of <see cref="System.TimeSpan"/> values to a byte array representation. <param name="timeSpans">An array of <see cref="System.TimeSpan"/> values to convert. Cannot be null.</param> <returns>A byte array containing the serialized representation of the input <see cref="System.TimeSpan"/> values. The length of the array is proportional to the number of elements in <paramref name="timeSpans"/>.</returns> <exception cref="ArgumentNullException">Thrown if <paramref name="timeSpans"/> is null.</exception> |
public static void ToSpan(ReadOnlySpan<System.TimeSpan> timeSpans, Span<byte> destination) |
Converts a sequence of <see cref="System.TimeSpan"/> values to their binary representation and writes the result to the specified destination span. <param name="timeSpans">The read-only span containing the <see cref="System.TimeSpan"/> values to convert.</param> <param name="destination">The span of bytes that receives the binary representation of the <paramref name="timeSpans"/> values. Must be large enough to hold all converted values.</param> <exception cref="ArgumentException">Thrown when <paramref name="destination"/> is not large enough to contain the binary representation of all <paramref name="timeSpans"/> values.</exception> |
IoT.Driver.S7PlcRx.PlcTypes.Timer
Source: PlcTypes/Timer.cs:14
Provides static methods for converting between S7 Timer byte representations and .NET numeric types. <remarks>This class is intended for working with Siemens S7 PLC timer values, enabling conversion to and from the S7-specific byte format and standard .NET types such as double and ushort. All members are static and the class cannot be instantiated.</remarks>
| Member | Summary |
|---|---|
public static double FromByteArray(byte[] bytes) => ... |
Converts a byte array to a double-precision floating-point number. <param name="bytes">The byte array containing the bytes to convert. Must represent a valid double value in the expected byte order.</param> <returns>A double-precision floating-point number represented by the specified byte array.</returns> |
public static double FromSpan(ReadOnlySpan<byte> bytes) => ... |
Converts a read-only span of bytes to a double-precision floating-point number. <remarks>The conversion uses the platform's endianness. Ensure that the byte order in the span matches the expected endianness for correct results.</remarks> <param name="bytes">A read-only span of bytes containing the binary representation of the double value. The span must contain at least 8 bytes, starting at the beginning of the span.</param> <returns>A double-precision floating-point number represented by the first 8 bytes of the span.</returns> |
public static double FromByteArray(byte[] bytes, int start) => ... |
Converts a sequence of bytes from the specified array, starting at the given index, to a double-precision floating-point number. <param name="bytes">The byte array containing the value to convert.</param> <param name="start">The zero-based index in the array at which to begin reading the bytes.</param> <returns>A double-precision floating-point number represented by the eight bytes starting at the specified index in the array.</returns> |
public static double FromByteArray(ReadOnlySpan<byte> bytes, int start) |
Converts a sequence of bytes starting at the specified position to a double-precision floating-point value using a custom binary encoding. <remarks>The method expects a custom binary format for the encoded value. The interpretation of the bytes and the resulting value may not correspond to standard IEEE 754 encoding. Ensure that the input data matches the expected format.</remarks> <param name="bytes">A read-only span of bytes containing the encoded value.</param> <param name="start">The zero-based index in the span at which to begin reading the 2-byte encoded value.</param> <returns>A double-precision floating-point value decoded from the specified bytes.</returns> <exception cref="ArgumentException">Thrown if the span does not contain at least 2 bytes starting from the specified position.</exception> |
public static double[] ToArray(byte[] bytes) => ... |
Converts a byte array to an array of double-precision floating-point values. <remarks>The method interprets each consecutive group of 8 bytes in the input array as a double-precision floating-point value, using the system's endianness. If the length of the input array is not a multiple of 8, an exception may be thrown.</remarks> <param name="bytes">The byte array to convert. The length must be a multiple of the size of a double (8 bytes).</param> <returns>An array of double values created from the input byte array.</returns> |
public static double[] ToArray(ReadOnlySpan<byte> bytes) |
Converts a read-only span of bytes to an array of double-precision floating-point values. <remarks>The method interprets each consecutive pair of bytes in the input span as a double value. The length of the input span must be evenly divisible by 2; otherwise, any remaining bytes are ignored.</remarks> <param name="bytes">The read-only span of bytes to convert. The length must be a multiple of 2, with each pair of bytes representing a double value.</param> <returns>An array of double values parsed from the specified byte span.</returns> |
public static byte[] ToByteArray(ushort value) |
Converts the specified 16-bit unsigned integer to a byte array. <param name="value">The 16-bit unsigned integer to convert to a byte array.</param> <returns>A byte array containing the two bytes of the specified value in platform endianness.</returns> |
public static void ToSpan(ushort value, Span<byte> destination) |
Writes the specified 16-bit unsigned integer value to the provided span as two bytes in big-endian order. <remarks>The value is written in big-endian byte order, with the most significant byte first. The method does not allocate memory and writes directly to the provided span.</remarks> <param name="value">The 16-bit unsigned integer value to write to the span.</param> <param name="destination">The span of bytes that will receive the two-byte representation of the value. Must be at least 2 bytes in length.</param> <exception cref="ArgumentException">Thrown if the length of destination is less than 2.</exception> |
public static void ToSpan(ReadOnlySpan<ushort> values, Span<byte> destination) |
Converts a sequence of 16-bit unsigned integers to their byte representations and writes the result to the specified destination span. <param name="values">The read-only span of 16-bit unsigned integers to convert.</param> <param name="destination">The span of bytes that receives the converted values. Must be at least twice the length of <paramref name="values"/>.</param> <exception cref="ArgumentException">Thrown when <paramref name="destination"/> is not large enough to contain the converted bytes.</exception> |
public static byte[] ToByteArray(ushort[] value) |
Converts an array of 16-bit unsigned integers to a byte array. <param name="value">The array of 16-bit unsigned integers to convert. Cannot be null.</param> <returns>A byte array containing the binary representation of the input values.</returns> |
IoT.Driver.S7PlcRx.PlcTypes.Word
Source: PlcTypes/Word.cs:16
Provides utility methods for converting between 16-bit unsigned integers (words) and their byte array or span representations, using big-endian (high byte first) byte order. <remarks>All methods in this class assume that words are represented in big-endian format, where the first byte is the high-order byte and the second byte is the low-order byte. These methods are intended for scenarios where explicit control over byte order is required, such as binary serialization, communication protocols, or file I/O. The class is static and cannot be instantiated.</remarks>
| Member | Summary |
|---|---|
public static ushort FromByteArray(byte[] bytes) => ... |
Creates a 16-bit unsigned integer from a byte array. <param name="bytes">The byte array containing the bytes to convert. Must contain at least two elements.</param> <returns>A 16-bit unsigned integer represented by the first two bytes of the array.</returns> |
public static ushort FromSpan(ReadOnlySpan<byte> bytes) => ... |
Creates a 16-bit unsigned integer from a span containing two bytes in little-endian order. <remarks>This method interprets the first two bytes of the span as a little-endian encoded unsigned 16-bit integer. The caller must ensure that the span contains at least two bytes to avoid an exception.</remarks> <param name="bytes">A read-only span of bytes that provides the two bytes to convert. The span must have a length of at least 2, with the least significant byte at index 0 and the most significant byte at index 1.</param> <returns>A 16-bit unsigned integer represented by the two bytes in the specified span.</returns> |
public static ushort FromByteArray(byte[] bytes, int start) => ... |
Creates a 16-bit unsigned integer from a byte array starting at the specified index. <param name="bytes">The byte array containing the data to convert.</param> <param name="start">The zero-based index in the array at which to begin reading the value.</param> <returns>A 16-bit unsigned integer formed from the specified bytes.</returns> |
public static ushort FromBytes(byte loVal, byte hiVal) => ... |
Creates a 16-bit unsigned integer from two bytes, using the specified low and high byte values. <remarks>The resulting value is calculated as (hiVal * 256) + loVal, with loVal as the least significant byte and hiVal as the most significant byte. This method assumes a little-endian byte order.</remarks> <param name="loVal">The low-order byte of the resulting 16-bit unsigned integer.</param> <param name="hiVal">The high-order byte of the resulting 16-bit unsigned integer.</param> <returns>A 16-bit unsigned integer composed from the specified low and high bytes.</returns> |
public static ushort[] ToArray(byte[] bytes) => ... |
Converts a byte array to an array of 16-bit unsigned integers. <remarks>The conversion interprets each pair of bytes in the input array as a single 16-bit unsigned integer. If the length of the input array is not a multiple of 2, an exception may be thrown.</remarks> <param name="bytes">The byte array to convert. The length must be a multiple of 2.</param> <returns>An array of 16-bit unsigned integers representing the converted values from the input byte array.</returns> |
public static ushort[] ToArray(ReadOnlySpan<byte> bytes) |
Converts a read-only span of bytes to an array of 16-bit unsigned integers. <remarks>Each pair of bytes in the input span is interpreted as a single 16-bit unsigned integer. The conversion uses the byte order expected by the FromSpan method. If the length of the input span is not a multiple of 2, any remaining bytes are ignored.</remarks> <param name="bytes">The input span containing the bytes to convert. The length must be a multiple of 2.</param> <returns>An array of 16-bit unsigned integers parsed from the input bytes. The length of the array is half the length of the input span.</returns> |
public static byte[] ToByteArray(ushort value) |
Converts the specified 16-bit unsigned integer to a byte array. <param name="value">The 16-bit unsigned integer to convert.</param> <returns>A byte array containing the bytes of the specified value in little-endian order.</returns> |
public static void ToSpan(ushort value, Span<byte> destination) |
Writes the specified 16-bit unsigned integer to the provided span in big-endian byte order. <remarks>The method writes the most significant byte of value to destination[0] and the least significant byte to destination[1].</remarks> <param name="value">The 16-bit unsigned integer value to write to the span.</param> <param name="destination">The span of bytes that receives the big-endian representation of the value. Must be at least 2 bytes in length.</param> <exception cref="ArgumentException">Thrown if destination is less than 2 bytes in length.</exception> |
public static void ToByteArray(ushort value, Array destination, int start) |
Copies the byte representation of the specified 16-bit unsigned integer into the given array starting at the specified index. <param name="value">The 16-bit unsigned integer to convert to bytes.</param> <param name="destination">The array that will receive the bytes representing the value. Must have sufficient space to accommodate two bytes starting at the specified index.</param> <param name="start">The zero-based index in the destination array at which to begin copying the bytes.</param> |
public static byte[] ToByteArray(ushort[] value) |
Converts an array of 16-bit unsigned integers to a byte array. <param name="value">The array of 16-bit unsigned integers to convert. Cannot be null.</param> <returns>A byte array containing the binary representation of the input values.</returns> |
public static void ToSpan(ReadOnlySpan<ushort> values, Span<byte> destination) |
Converts a sequence of 16-bit unsigned integers to their byte representation and writes the result to the specified destination span. <param name="values">The sequence of 16-bit unsigned integers to convert.</param> <param name="destination">The span of bytes that receives the converted values. Must be at least twice the length of <paramref name="values"/>.</param> <exception cref="ArgumentException">Thrown when <paramref name="destination"/> is not large enough to contain the converted bytes.</exception> |
Namespace IoT.Driver.S7PlcRx.Production
IoT.Driver.S7PlcRx.Production.CircuitBreaker
Source: Production/CircuitBreaker.cs:17
Provides a thread-safe implementation of the circuit breaker pattern to prevent repeated execution of failing operations and to allow recovery after a specified timeout. <remarks>The circuit breaker monitors consecutive operation failures and transitions between Closed, Open, and HalfOpen states based on the provided configuration. When the failure threshold is reached, the circuit breaker enters the Open state and blocks further operations until the timeout elapses. After the timeout, it transitions to HalfOpen to test if operations can succeed before fully closing again. This class is thread-safe and intended for use in scenarios where repeated failures should be prevented from overwhelming a system or external dependency.</remarks> <param name="config">The configuration settings that control circuit breaker thresholds, retry behavior, and timeouts.</param>
| Member | Summary |
|---|---|
public CircuitBreakerState State get; private set; } = CircuitBreakerState.Closed; |
Gets the current state of the circuit breaker. <remarks>The state indicates whether the circuit breaker is allowing operations to proceed (Closed), temporarily blocking operations due to failures (Open), or testing if operations can resume (HalfOpen).</remarks> |
public long TotalOperations get; private set; } |
Gets the total number of operations that have been performed. |
public long SuccessfulOperations get; private set; } |
Gets the total number of operations that have completed successfully. |
public long FailedOperations get; private set; } |
Gets the total number of operations that have failed. |
public double SuccessRate => ... |
Gets the percentage of operations that completed successfully. |
public async Task<T> ExecuteAsync<T>(Func<Task<T>> operation) |
Executes the specified asynchronous operation within the circuit breaker, applying retry and failure handling policies as configured. <remarks>If the circuit breaker is open due to previous failures, the operation will be blocked until the configured timeout has elapsed. Upon successful execution, the circuit breaker state is reset. This method is thread-safe.</remarks> <typeparam name="T">The type of the result returned by the asynchronous operation.</typeparam> <param name="operation">A function that represents the asynchronous operation to execute. Cannot be null.</param> <returns>A task that represents the asynchronous execution of the operation. The task result contains the value returned by the operation if it completes successfully.</returns> <exception cref="ArgumentNullException">Thrown if the operation parameter is null.</exception> <exception cref="InvalidOperationException">Thrown if the circuit breaker is open and the timeout period has not elapsed, preventing the operation from being executed.</exception> |
IoT.Driver.S7PlcRx.Production.CircuitBreakerState
Source: Production/CircuitBreakerState.cs:12
Specifies the operational state of a circuit breaker used to control the flow of operations in response to failures. <remarks>Use this enumeration to determine or set the current state of a circuit breaker implementation. The state controls whether operations are allowed, blocked, or tested for recovery. Typical usage involves transitioning between these states based on error rates or recovery attempts.</remarks>
Enum values: Closed, Open, HalfOpen.
IoT.Driver.S7PlcRx.Production.ProductionDiagnostics
Source: Production/ProductionDiagnostics.cs:16
Represents diagnostic information collected from a production programmable logic controller (PLC) connection, including connection details, performance metrics, and recommendations. <remarks>This class is typically used to capture and analyze the state of a PLC connection and its associated metrics at a specific point in time. It aggregates connection parameters, diagnostic results, and any errors or optimization suggestions identified during the diagnostic process. All properties are intended to be set and read by consumers managing or monitoring PLC diagnostics.</remarks>
| Member | Summary |
|---|---|
public CpuType PLCType get; set; } |
Gets or sets the PLC type. |
public string IPAddress get; set; } = string.Empty; |
Gets or sets the IP address. |
public short Rack get; set; } |
Gets or sets the rack number. |
public short Slot get; set; } |
Gets or sets the slot number. |
public bool IsConnected get; set; } |
Gets or sets a value indicating whether gets or sets the connection status. |
public DateTime DiagnosticTime get; set; } |
Gets or sets when diagnostics were collected. |
public double ConnectionLatencyMs get; set; } |
Gets or sets the connection latency in milliseconds. |
public string[] CPUInformation get; set; } = []; |
Gets or sets the CPU information. |
public ProductionTagMetrics TagMetrics get; set; } = new ProductionTagMetrics(); |
Gets or sets the tag metrics. |
public List<string> Recommendations get; set; } = []; |
Gets or sets the optimization recommendations. |
public List<string> Errors get; set; } = []; |
Gets or sets any errors encountered during diagnostics. |
IoT.Driver.S7PlcRx.Production.ProductionErrorConfig
Source: Production/ProductionErrorConfig.cs:12
Represents the configuration settings for error handling and retry logic in a production environment. <remarks>This class provides options to control retry attempts, delay strategies, and circuit breaker behavior for handling transient errors. It is typically used to configure error resilience policies in applications that interact with external systems or services.</remarks>
| Member | Summary |
|---|---|
public int MaxRetryAttempts get; set; } = 3; |
Gets or sets the maximum retry attempts. |
public int BaseRetryDelayMs get; set; } = 1000; |
Gets or sets the base retry delay in milliseconds. |
public bool UseExponentialBackoff get; set; } = true; |
Gets or sets a value indicating whether gets or sets whether to use exponential backoff. |
public int CircuitBreakerThreshold get; set; } = 5; |
Gets or sets the circuit breaker failure threshold. |
public TimeSpan CircuitBreakerTimeout get; set; } = TimeSpan.FromMinutes(1); |
Gets or sets the circuit breaker timeout. |
IoT.Driver.S7PlcRx.Production.ProductionErrorHandler
Source: Production/ProductionErrorHandler.cs:16
Provides error handling for production environments by executing operations with circuit breaker protection and configurable error handling policies. <remarks>This class is intended for use in production scenarios where robust error handling and resilience are required. It wraps operations in a circuit breaker to prevent repeated failures and applies the error handling strategies specified in the provided configuration. Instances of this class are thread-safe and can be reused across multiple operations.</remarks> <param name="config">The configuration settings that define error handling behavior, including circuit breaker thresholds and retry policies. Cannot be null.</param>
| Member | Summary |
|---|---|
public async Task<T> ExecuteAsync<T>(Func<Task<T>> operation) => ... |
Executes an operation with comprehensive error handling. <typeparam name="T">The return type.</typeparam> <param name="operation">The operation to execute.</param> <returns>The result of the operation.</returns> |
IoT.Driver.S7PlcRx.Production.ProductionExtensions
Source: Production/ProductionExtensions.cs:18
Provides extension methods for enabling production-grade error handling, retry logic, and system validation on PLC instances using the circuit breaker pattern. <remarks>These extension methods are intended to enhance the reliability and readiness of PLC-based systems in production environments. They offer mechanisms for robust error handling, configurable retry strategies, and comprehensive validation routines to assess system health and readiness for production deployment. All methods require a valid IRxS7 PLC instance and may utilize user-supplied or default configuration objects. Thread safety is ensured for shared resources such as circuit breakers.</remarks>
| Member | Summary |
|---|---|
public static ProductionErrorHandler EnableProductionErrorHandling( this IRxS7 plc, ProductionErrorConfig config) |
Enables production error handling for the specified PLC using the provided configuration. <param name="plc">The PLC instance to enable production error handling for. Cannot be null.</param> <param name="config">The configuration settings to use for production error handling. Cannot be null.</param> <returns>A new instance of <see cref="ProductionErrorHandler"/> configured for the specified PLC.</returns> <exception cref="ArgumentNullException">Thrown if <paramref name="plc"/> or <paramref name="config"/> is null.</exception> |
public static async Task<T> ExecuteWithErrorHandling<T>( this IRxS7 plc, Func<Task<T>> operation, ProductionErrorConfig? config = null) |
Executes the specified asynchronous PLC operation with error handling and circuit breaker protection. <remarks>This method ensures that the provided operation is executed with error handling policies defined by the specified or default configuration. It uses a circuit breaker to prevent repeated execution of failing operations, which can help protect the PLC and improve system resilience.</remarks> <typeparam name="T">The type of the result returned by the operation.</typeparam> <param name="plc">The PLC instance on which to perform the operation. Cannot be null.</param> <param name="operation">A function that represents the asynchronous operation to execute. Cannot be null.</param> <param name="config">An optional configuration object that specifies error handling and circuit breaker behavior. If null, a default configuration is used.</param> <returns>A task that represents the asynchronous operation. The task result contains the value returned by the operation.</returns> <exception cref="ArgumentNullException">Thrown if <paramref name="plc"/> or <paramref name="operation"/> is null.</exception> |
public static async Task<SystemValidationResult> ValidateProductionReadiness( this IRxS7 plc, ProductionValidationConfig? validationConfig = null) |
Performs a comprehensive validation of the specified PLC to determine its readiness for production deployment. <remarks>The validation process includes checks for connectivity, performance, and reliability. The method aggregates results and determines production readiness based on the provided or default configuration. The returned result includes timestamps, scores, and any critical errors encountered during validation.</remarks> <param name="plc">The PLC instance to validate for production readiness. Cannot be null.</param> <param name="validationConfig">An optional configuration object that specifies validation parameters and thresholds. If null, default validation settings are used.</param> <returns>A task that represents the asynchronous operation. The task result contains a SystemValidationResult object with detailed validation outcomes, including overall readiness, scores, and any detected issues.</returns> <exception cref="ArgumentNullException">Thrown if the plc parameter is null.</exception> |
IoT.Driver.S7PlcRx.Production.ProductionMetrics
Source: Production/ProductionMetrics.cs:13
Represents a set of metrics related to the monitoring and connectivity status of a PLC (Programmable Logic Controller) over a specified period. <remarks>This class is typically used to capture and report operational statistics for a PLC, such as connection times, uptime percentage, and tag counts. All properties are mutable, allowing for incremental updates as new data is collected.</remarks>
| Member | Summary |
|---|---|
public string PLCIdentifier get; set; } = string.Empty; |
Gets or sets the PLC identifier. |
public DateTime StartTime get; set; } |
Gets or sets when monitoring started. |
public DateTime LastUpdateTime get; set; } |
Gets or sets the last update time. |
public bool IsConnected get; set; } |
Gets or sets a value indicating whether gets or sets whether the PLC is currently connected. |
public TimeSpan ConnectedTime get; set; } |
Gets or sets the total connected time. |
public TimeSpan DisconnectedTime get; set; } |
Gets or sets the total disconnected time. |
public double UptimePercentage get; set; } |
Gets or sets the uptime percentage. |
public int ActiveTagCount get; set; } |
Gets or sets the number of active tags. |
public int TotalTagCount get; set; } |
Gets or sets the total number of tags. |
IoT.Driver.S7PlcRx.Production.ProductionTagMetrics
Source: Production/ProductionTagMetrics.cs:12
Represents aggregated metrics related to production tags, including counts and distribution information. <remarks>Use this class to track and analyze the status and distribution of tags within a production environment. The metrics provided can assist in monitoring tag activity and identifying trends or anomalies in tag usage.</remarks>
| Member | Summary |
|---|---|
public int TotalTags get; set; } |
Gets or sets the total number of tags. |
public int ActiveTags get; set; } |
Gets or sets the number of active tags. |
public int InactiveTags get; set; } |
Gets or sets the number of inactive tags. |
public Dictionary<string, int> DataBlockDistribution get; set; } = []; |
Gets or sets the distribution of tags by data block. |
IoT.Driver.S7PlcRx.Production.ProductionValidationConfig
Source: Production/ProductionValidationConfig.cs:12
Represents configuration settings for validating production system performance and reliability. <remarks>Use this class to specify thresholds and criteria for production validation checks, such as acceptable response times, reliability rates, and minimum production scores. These settings can be adjusted to match the requirements of different production environments.</remarks>
| Member | Summary |
|---|---|
public TimeSpan MaxAcceptableResponseTime get; set; } = TimeSpan.FromMilliseconds(500); |
Gets or sets the maximum acceptable response time. |
public double MinimumReliabilityRate get; set; } = 0.95; |
Gets or sets the minimum reliability rate (0.0 to 1.0). |
public int ReliabilityTestCount get; set; } = 10; |
Gets or sets the number of operations to test for reliability. |
public double MinimumProductionScore get; set; } = 80.0; |
Gets or sets the minimum production score (0 to 100). |
IoT.Driver.S7PlcRx.Production.SystemValidationResult
Source: Production/SystemValidationResult.cs:13
Represents the result of a system validation process, including timing, test results, and production readiness status. <remarks>Use this class to capture and inspect the outcome of a system validation run, such as for a PLC or similar automated system. It provides details about the validation period, individual test results, critical errors, and an overall score indicating system readiness for production.</remarks>
| Member | Summary |
|---|---|
public DateTime ValidationStartTime get; set; } |
Gets or sets the validation start time. |
public DateTime ValidationEndTime get; set; } |
Gets or sets the validation end time. |
public string PLCIdentifier get; set; } = string.Empty; |
Gets or sets the PLC identifier. |
public bool IsProductionReady get; set; } |
Gets or sets a value indicating whether the system is production ready. |
public double OverallScore get; set; } |
Gets or sets the overall validation score (0-100). |
public List<ValidationTest> ValidationTests get; } = []; |
Gets the individual validation tests. |
public List<string> CriticalErrors get; } = []; |
Gets critical errors that prevent production use. |
public TimeSpan TotalValidationTime => ... |
Gets the total validation time. |
IoT.Driver.S7PlcRx.Production.ValidationTest
Source: Production/ValidationTest.cs:9
Represents the result and metadata of a validation test, including timing, outcome, and related details.
| Member | Summary |
|---|---|
public string TestName get; set; } = string.Empty; |
Gets or sets the test name. |
public DateTime StartTime get; set; } |
Gets or sets the test start time. |
public DateTime EndTime get; set; } |
Gets or sets the test end time. |
public bool Success get; set; } |
Gets or sets a value indicating whether gets or sets whether the test was successful. |
public string? ErrorMessage get; set; } |
Gets or sets any error message. |
public List<string> Details get; } = []; |
Gets additional test details. |
public TimeSpan Duration => ... |
Gets the test duration. |
Namespace IoT.Driver.S7PlcRx.SourceGeneration
IoT.Driver.S7PlcRx.SourceGeneration.S7PlcBindingAttribute
Source: S7TagBindingSourceGenerator.cs:273
No public instance/static members declared directly on this type.
IoT.Driver.S7PlcRx.SourceGeneration.S7TagAttribute
Source: S7TagBindingSourceGenerator.cs:278
| Member | Summary |
|---|---|
public S7TagAttribute(string address) |
|
public string Address get; } |
|
public int PollIntervalMs get; set; } = 100; |
|
public S7TagDirection Direction get; set; } |
|
public int ArrayLength get; set; } = 1; |
IoT.Driver.S7PlcRx.SourceGeneration.S7TagDirection
Source: S7TagBindingSourceGenerator.cs:294
Enum values: ReadWrite, ReadOnly, WriteOnly.
Namespace IoT.Driver.S7PlcRx.SourceGenerators
IoT.Driver.S7PlcRx.SourceGenerators.S7TagBindingSourceGenerator
Source: S7TagBindingSourceGenerator.cs:17
| Member | Summary |
|---|---|
public void Initialize(IncrementalGeneratorInitializationContext context) |
<inheritdoc /> |
</details>
Migrated API additions and full member-family guide
The preceding API reference retains the complete original feature documentation. This section records the migrated public surface that was added or expanded in IoT-DriverCore, including its overload families and the two composition patterns most commonly used in an application.
Tag registration, polling, and observable adaptation
| Type/member family | Purpose, result, errors, and lifecycle |
|---|---|
TagOperations.AddUpdateTagItem(plc, type, name, address[, length]) |
Creates or replaces a tag and returns TagRegistration. The scalar, fixed-length, and nullable-length overloads select the PLC value shape. Invalid addresses/types surface through the PLC error streams; call SetPolling(bool) on the result before relying on observation. |
TagOperations.GetTag / RemoveTagItem |
Retrieves a registration wrapper or removes a named tag. Removing a tag produces an ObserveAll null notification and invalidates later reads by that name. |
TagOperations.ToTagValue<T> / TagToDictionary |
Converts a tag notification stream to typed name/value pairs or a dictionary for UI/state projections. Dispose the resulting subscription with the projection owner. |
TagRegistration.SetPolling() / SetPolling(bool) / Deconstruct |
Enables/disables polling or exposes its ITag and IRxS7. It changes tag scheduling only; it does not validate a write nor close the PLC connection. |
S7TagValueObservable<T> |
Small multicast observable with Subscribe and Publish; use for your own binding projection, then dispose each returned subscription. |
S7TagObservableAdapter.ToAsyncEnumerable<T> |
Turns any IObservable<T> into an IAsyncEnumerable<T>. Cancellation stops the enumerator/subscription; errors are rethrown by MoveNextAsync. |
using IoT.Driver.Core;
using IoT.Driver.S7PlcRx;
TagOperations.AddUpdateTagItem(plc, typeof(bool), "Pump.Enabled", "DB10.DBX0.0").SetPolling();
TagOperations.AddUpdateTagItem(plc, typeof(short), "Pump.Speed", "DB10.DBW2").SetPolling(false);
using var updates = TagOperations.ToTagValue<bool>(plc.ObserveAll)
.Subscribe(change => Console.WriteLine($"{change.Tag}={change.Value}"));
await foreach (var tag in S7TagObservableAdapter.ToAsyncEnumerable(plc.ObserveAll)
.WithCancellation(CancellationToken.None))
{
if (tag?.Name == "Pump.Enabled")
Console.WriteLine($"State is {tag.Value}");
}
Runtime binding and generated binding
S7TagRuntimeBinding.Bind(IRxS7, IReadOnlyList<S7TagDefinition>, Action<string, object?>) registers a supplied definition set and returns a disposable binding. Write(name, value) performs the corresponding managed write and throws argument/address/type exceptions before a PLC command if the definition cannot be resolved. S7TagBindingSession composes the runtime binding with a logical-tag client and disposes both exactly once. S7TagDefinition carries the definition name, address, type, poll interval, direction, and array-length metadata; S7TagDirection distinguishes read/write intent.
The analyzer package is IoT-Driver.S7PlcRx.Generators. It consumes public [S7PlcBinding] and [S7Tag(address)] attributes from IoT.Driver.S7PlcRx.SourceGeneration; Address is required, while PollIntervalMs, Direction, and ArrayLength configure the generated registration. The target class and attributed properties must be partial. Build diagnostics are deliberately actionable: fix invalid address/property/type/direction metadata instead of suppressing them.
using IoT.Driver.S7PlcRx;
using IoT.Driver.S7PlcRx.SourceGeneration;
[S7PlcBinding]
public partial class MixerBinding
{
[S7Tag("DB20.DBX0.0", PollIntervalMs = 250, Direction = S7TagDirection.ReadWrite)]
public partial bool Run { get; set; }
[S7Tag("DB20.DBD4", Direction = S7TagDirection.ReadOnly)]
public partial float Temperature { get; set; }
}
// The generated API connects this binding to the IRxS7 instance and emits typed
// observable/property hooks. Handle its build diagnostics before deploying.
using IoT.Driver.S7PlcRx.Binding;
var definitions = new[]
{
new S7TagDefinition("Mix.Run", "DB20.DBX0.0", typeof(bool), 250, S7TagDirection.ReadWrite, 1),
new S7TagDefinition("Mix.Target", "DB20.DBW2", typeof(short), 0, S7TagDirection.ReadWrite, 1),
};
using var runtime = S7TagRuntimeBinding.Bind(plc, definitions, (_, _) => { });
runtime.Write("Mix.Target", (short)850);
// In an application that owns both resources, create a catalog/client and make
// its teardown explicit. Do not also dispose runtime separately after session.
var catalog = S7LogicalTagExtensions.CreateLogicalTagCatalog(definitions);
using var logicalClient = S7LogicalTagExtensions.CreateLogicalTagClient(plc, catalog);
Logical tags, persistence, CSV, and typed operations
S7LogicalTagExtensions.CreateLogicalTagCatalog creates a shared catalog. CreateLogicalTagClient has overloads for catalog/store construction; the returned S7LogicalTagClient implements IDisposable and must be disposed. Its constructor overloads accept the PLC, catalog, optional store, and composition dependencies. RegisterTag, CreateTag, and RemoveTag modify the in-memory catalog; InitializeStoreAsync, LoadTagsAsync, GetTagAsync, ListTagsAsync, UpsertTagAsync, EditTagAsync, UpdateTagAsync, and DeleteTagAsync are store-backed operations with cancellation-token overloads. The matching group methods are GetGroupAsync, ListGroupsAsync, UpsertGroupAsync, and DeleteGroupAsync.
ImportCsvAsync and ExportCsvAsync have default-delimiter, explicit-delimiter, and cancellation-aware overloads. Use a caller-owned TextReader/TextWriter; the client does not own or close it. ReadAsync, ReadManyAsync, WriteAsync, and WriteManyAsync return TagOperationResult<LogicalTagValue> or a list, preserving per-tag failures. Observe/ObserveMany return observables, while ObserveAsync/ObserveManyAsync return cancelable async streams.
using IoT.Driver.Core;
using IoT.Driver.S7PlcRx.LogicalTags;
var catalog = S7LogicalTagExtensions.CreateLogicalTagCatalog(definitions);
using var client = S7LogicalTagExtensions.CreateLogicalTagClient(plc, catalog);
var store = new LogicalTagSqliteStore("Data Source=tags.db;Pooling=False");
await client.InitializeStoreAsync(store, cancellationToken);
await client.ImportCsvAsync(reader, delimiter: ';', cancellationToken);
var result = await client.WriteAsync(
new LogicalTagValue("Recipe.Target", 1200, DateTimeOffset.UtcNow), cancellationToken);
if (!result.Succeeded)
throw new InvalidOperationException(result.Error);
using var observed = client.ObserveMany(["Recipe.Target", "Recipe.Actual"])
.Subscribe(value => Console.WriteLine($"{value.Name}: {value.Value}"));
Combined workflow 1: safe command with verification and timeout
Register command and feedback tags, observe errors before writing, send the command, then verify feedback by a bounded read. This combines tag registration, queued writes, cancellation, and error observability without treating a setter as an acknowledgement.
using IoT.Driver.Core;
using IoT.Driver.S7PlcRx;
TagOperations.AddUpdateTagItem(plc, typeof(bool), "StartCommand", "DB1.DBX0.0").SetPolling(false);
TagOperations.AddUpdateTagItem(plc, typeof(bool), "RunningFeedback", "DB1.DBX0.1").SetPolling();
using var faults = plc.LastError.Subscribe(Console.Error.WriteLine);
using var stop = new CancellationTokenSource(TimeSpan.FromSeconds(3));
plc.Value("StartCommand", true);
bool? running = await plc.ReadAsync(new LogicalTagKey<bool>("RunningFeedback"), stop.Token);
if (running != true)
throw new TimeoutException("Start was not acknowledged; inspect PLC diagnostics.");
Combined workflow 2: imported logical schema, generated display, batch update
Use CSV/store import for the operational schema, generated bindings for fixed application properties, and logical batch operations for an audited recipe update. Dispose each subscription/session/client you own; the PLC factory result itself has the lifecycle limitation described above.
using IoT.Driver.S7PlcRx;
using IoT.Driver.S7PlcRx.Binding;
var catalog = S7LogicalTagExtensions.CreateLogicalTagCatalog(screenDefinitions);
using var client = S7LogicalTagExtensions.CreateLogicalTagClient(plc, catalog);
await client.LoadTagsAsync(cancellationToken);
var changes = await client.WriteManyAsync(
[
new LogicalTagValue("Recipe.Speed", (short)1200, DateTimeOffset.UtcNow),
new LogicalTagValue("Recipe.Enabled", true, DateTimeOffset.UtcNow),
], cancellationToken);
foreach (var change in changes.Where(result => !result.Succeeded))
Console.Error.WriteLine(change.Error);
using var binding = S7TagRuntimeBinding.Bind(plc, screenDefinitions, (_, _) => { });
Complete migrated public API reference
| Namespace/type | Public member families and how to use them |
|---|---|
IoT.Driver.S7PlcRx.LogicalTags.S7LogicalTagClient |
Constructors; catalog tag methods; CSV import/export; store init/load/get/list/upsert/edit/update/delete for tags and groups; typed single/many read/write; observable and async-enumerable single/many observe; Dispose. Cancellation overloads are for I/O and streaming boundaries. |
S7LogicalTagExtensions |
Catalog/client creation plus typed logical ReadAsync<T> and WriteAsync<T>. The package's batch implementation is intentionally internal; call the public logical-client and extension methods and check each operation result rather than assuming an all-or-nothing PLC commit. |
IoT.Driver.S7PlcRx.Binding.S7TagDefinition, S7TagDirection, S7TagRuntimeBinding, S7TagBindingSession |
Definition metadata, direction, static Bind, named Write, and deterministic binding/session disposal. S7TagObservableAdapter offers ToAsyncEnumerable; S7TagValueObservable<T> offers Subscribe/Publish. |
IoT.Driver.S7PlcRx.Tags.TagOperations, TagRegistration, Tag, ITag, Tags |
All registration overloads, lookup/removal, typed stream/dictionary projection, per-tag polling, and tag model metadata. Combine with IRxS7.Observe/read/write member families documented in the original API reference above. |
IoT.Driver.S7PlcRx.SourceGeneration.S7PlcBindingAttribute, S7TagAttribute, S7TagDirection |
Compile-time binding configuration: class marker; address plus PollIntervalMs, Direction, ArrayLength; direction enum. IoT.Driver.S7PlcRx.SourceGenerators.S7TagBindingSourceGenerator is the analyzer implementation packaged by IoT-Driver.S7PlcRx.Generators. |
Operations and troubleshooting
| Symptom | Cause and corrective action |
|---|---|
| Connection state never reaches true | Check CPU-specific factory, IP, rack/slot, firewall/VLAN, PUT/GET, and LastErrorCode; do not retry writes blindly. |
| Read is null or wrong-shaped | Register the tag, make key/property CLR type match PLC data, verify DB/bit/array address, and check non-optimised DB layout. |
| Generated binding does not appear | Ensure the analyzer package is referenced, class/property declarations are partial, attributes use the migrated namespace, and generator diagnostics are fixed. |
| Stale/high-load updates | Reduce polling set/interval, group contiguous DB data, use batch/optimisation helpers, and measure with performance APIs before increasing parallelism. |
| Store/CSV operation fails | Keep the reader/writer/store alive for the await, pass a cancellation token, inspect per-tag TagOperationResult, and dispose the logical client only after streams stop. |
| Shutdown needs deterministic PLC disposal | IRxS7 inherits disposable ICancelable; use a using IRxS7 scope (or call Dispose) after disposing owned subscriptions, bindings, clients, pools, and groups. |
Build and test
dotnet build src/IoT-DriverCore.slnx
dotnet build src/S7PlcRx/S7PlcRx.csproj
dotnet build src/S7PlcRx.Reactive/S7PlcRx.Reactive.csproj
dotnet test src/S7PlcRx.Tests/S7PlcRx.Tests.csproj --framework net8.0
From WSL when only Windows .NET is installed:
"/mnt/c/Program Files/dotnet/dotnet.exe" build src/IoT-DriverCore.slnx
"/mnt/c/Program Files/dotnet/dotnet.exe" build src/S7PlcRx.Reactive/S7PlcRx.Reactive.csproj
"/mnt/c/Program Files/dotnet/dotnet.exe" test src/S7PlcRx.Tests/S7PlcRx.Tests.csproj --framework net8.0
License
MIT. See the repository LICENSE.
Support
- Issues: https://github.com/ChrisPulman/IoT-DriverCore/issues
- NuGet: https://www.nuget.org/packages/IoT-Driver.S7PlcRx
- NuGet reactive package: https://www.nuget.org/packages/IoT-Driver.S7PlcRx.Reactive
AI skill
For a concise agent workflow, load skills/s7-plc-rx/SKILL.md. This README remains the exhaustive package API and operational reference.
Exhaustive public API reference
This catalogue is generated from the packaged runtime assemblies and their XML documentation. It includes exported public types and their declared public members; inherited members and non-public implementation details are intentionally omitted.
S7PlcRx
Exported public types: 100; declared public members: 736.
T:IoT.Driver.S7PlcRx.Advanced.AdvancedExtensions
public class IoT.Driver.S7PlcRx.Advanced.AdvancedExtensions
Provides advanced extension methods for efficient batch operations, diagnostics, and performance analysis on PLC (Programmable Logic Controller) instances using the IRxS7 interface.
Declared public members
M:IoT.Driver.S7PlcRx.Advanced.AdvancedExtensions.AnalyzePerformanceAsync(IoT.Driver.S7PlcRx.IRxS7,System.TimeSpan)
public static System.Threading.Tasks.Task<IoT.Driver.S7PlcRx.Performance.PerformanceAnalysis> AnalyzePerformanceAsync(IoT.Driver.S7PlcRx.IRxS7 plc, System.TimeSpan monitoringDuration)
Analyzes tag change performance on the specified PLC over a given monitoring duration and returns a summary of tag change frequencies and recommendations.
- Parameter
plc: The PLC instance. - Parameter
monitoringDuration: The positive duration over which to observe tag changes. - Returns: A task that produces a PerformanceAnalysis object with tag change statistics and performance recommendations for the monitored period.
M:IoT.Driver.S7PlcRx.Advanced.AdvancedExtensions.AnalyzePerformanceAsync(IoT.Driver.S7PlcRx.IRxS7,System.TimeSpan,System.TimeProvider)
public static System.Threading.Tasks.Task<IoT.Driver.S7PlcRx.Performance.PerformanceAnalysis> AnalyzePerformanceAsync(IoT.Driver.S7PlcRx.IRxS7 plc, System.TimeSpan monitoringDuration, System.TimeProvider timeProvider)
Analyzes tag change performance on the specified PLC over a given monitoring duration and returns a summary of tag change frequencies and recommendations.
- Parameter
plc: The PLC instance. - Parameter
monitoringDuration: The positive duration over which to observe tag changes. - Parameter
timeProvider: The time provider. - Returns: A task that produces a PerformanceAnalysis object with tag change statistics and performance recommendations for the monitored period.
M:IoT.Driver.S7PlcRx.Advanced.AdvancedExtensions.CreateTagGroup``1(IoT.Driver.S7PlcRx.IRxS7,``0,System.String,System.String[])
public static IoT.Driver.S7PlcRx.Performance.HighPerformanceTagGroup<T> CreateTagGroup<T>(IoT.Driver.S7PlcRx.IRxS7 plc, T typeValue, string groupName, string[] tagNames)
Creates a new high-performance tag group for batch reading or writing of multiple tags from the specified PLC connection.
- Parameter
plc: The PLC instance. - Parameter
typeValue: A value used to infer the tag-group value type. - Parameter
groupName: The name used to identify the tag group. - Parameter
tagNames: The tag names to include in the group. - Returns: A new HighPerformanceTagGroup{T} that contains the specified tags and PLC connection.
M:IoT.Driver.S7PlcRx.Advanced.AdvancedExtensions.GetDiagnosticsAsync(IoT.Driver.S7PlcRx.IRxS7)
public static System.Threading.Tasks.Task<IoT.Driver.S7PlcRx.Production.ProductionDiagnostics> GetDiagnosticsAsync(IoT.Driver.S7PlcRx.IRxS7 plc)
Asynchronously collects diagnostics and performance metrics from a PLC instance.
- Parameter
plc: The PLC instance. - Returns: A task that produces a ProductionDiagnostics object with collected diagnostic data, tag metrics, and optimization recommendations.
M:IoT.Driver.S7PlcRx.Advanced.AdvancedExtensions.GetDiagnosticsAsync(IoT.Driver.S7PlcRx.IRxS7,System.TimeProvider)
public static System.Threading.Tasks.Task<IoT.Driver.S7PlcRx.Production.ProductionDiagnostics> GetDiagnosticsAsync(IoT.Driver.S7PlcRx.IRxS7 plc, System.TimeProvider timeProvider)
Asynchronously collects diagnostics and performance metrics from a PLC instance.
- Parameter
plc: The PLC instance. - Parameter
timeProvider: The time provider. - Returns: A task that produces a ProductionDiagnostics object with collected diagnostic data, tag metrics, and optimization recommendations.
M:IoT.Driver.S7PlcRx.Advanced.AdvancedExtensions.ObserveBatch``1(IoT.Driver.S7PlcRx.IRxS7,``0,System.String[])
public static System.IObservable<System.Collections.Generic.Dictionary<string, T>> ObserveBatch<T>(IoT.Driver.S7PlcRx.IRxS7 plc, T typeValue, string[] variables)
Observes the values of multiple PLC variables as a batch and emits updates as a dictionary when any of the specified variables change.
- Parameter
plc: The PLC instance. - Parameter
typeValue: A value used to infer the PLC value type. - Parameter
variables: The PLC variables to observe. - Returns: An observable that emits the latest value for each variable. The dictionary is updated and emitted whenever any of the observed variables change.
M:IoT.Driver.S7PlcRx.Advanced.AdvancedExtensions.ReadBatchOptimizedAsync``1(IoT.Driver.S7PlcRx.IRxS7,``0,System.Collections.Generic.Dictionary2{System.String,System.String},System.Int32)`
public static System.Threading.Tasks.Task<IoT.Driver.S7PlcRx.BatchOperations.BatchReadResult<T>> ReadBatchOptimizedAsync<T>(IoT.Driver.S7PlcRx.IRxS7 plc, T typeValue, System.Collections.Generic.Dictionary<string, string> tagMapping, int timeoutMs)
Executes the ReadBatchOptimizedAsync operation.
- Parameter
plc: Theplcvalue. - Parameter
typeValue: ThetypeValuevalue. - Parameter
tagMapping: ThetagMappingvalue. - Parameter
timeoutMs: ThetimeoutMsvalue. - Returns: A
System.Threading.Tasks.Task<IoT.Driver.S7PlcRx.BatchOperations.BatchReadResult<T>>result.
M:IoT.Driver.S7PlcRx.Advanced.AdvancedExtensions.ValueBatchAsync``1(IoT.Driver.S7PlcRx.IRxS7,System.Collections.Generic.Dictionary2{System.String,``0})`
public static System.Threading.Tasks.Task ValueBatchAsync<T>(IoT.Driver.S7PlcRx.IRxS7 plc, System.Collections.Generic.Dictionary<string, T> values)
Executes the ValueBatchAsync operation.
- Parameter
plc: Theplcvalue. - Parameter
values: Thevaluesvalue. - Returns: A
System.Threading.Tasks.Taskresult.
M:IoT.Driver.S7PlcRx.Advanced.AdvancedExtensions.ValueBatchAsync``1(IoT.Driver.S7PlcRx.IRxS7,``0,System.String[])
public static System.Threading.Tasks.Task<System.Collections.Generic.Dictionary<string, T>> ValueBatchAsync<T>(IoT.Driver.S7PlcRx.IRxS7 plc, T typeValue, string[] variables)
Asynchronously reads the values of multiple variables from the PLC and returns a dictionary mapping variable names to their values.
- Parameter
plc: The PLC instance. - Parameter
typeValue: A value used to infer the PLC value type. - Parameter
variables: The PLC variables to read. - Returns: A task that produces a dictionary mapping each requested variable name to its value of type T, or to the default value of T if the variable could not be read or does not exist. If no variables are specified, returns an empty dictionary.
M:IoT.Driver.S7PlcRx.Advanced.AdvancedExtensions.WriteBatchOptimizedAsync``1(IoT.Driver.S7PlcRx.IRxS7,System.Collections.Generic.Dictionary2{System.String,``0},System.Boolean,System.Boolean)`
public static System.Threading.Tasks.Task<IoT.Driver.S7PlcRx.BatchOperations.BatchWriteResult> WriteBatchOptimizedAsync<T>(IoT.Driver.S7PlcRx.IRxS7 plc, System.Collections.Generic.Dictionary<string, T> values, bool verifyWrites, bool enableRollback)
Executes the WriteBatchOptimizedAsync operation.
- Parameter
plc: Theplcvalue. - Parameter
values: Thevaluesvalue. - Parameter
verifyWrites: TheverifyWritesvalue. - Parameter
enableRollback: TheenableRollbackvalue. - Returns: A
System.Threading.Tasks.Task<IoT.Driver.S7PlcRx.BatchOperations.BatchWriteResult>result.
T:IoT.Driver.S7PlcRx.Advanced.AsyncExtensions
public class IoT.Driver.S7PlcRx.Advanced.AsyncExtensions
Provides additional async-first helpers for reading, writing, and observing PLC values without changing the base T:IoT.Driver.S7PlcRx.IRxS7 API surface.
Declared public members
M:IoT.Driver.S7PlcRx.Advanced.AsyncExtensions.ObserveValue``1(IoT.Driver.S7PlcRx.IRxS7,``0,System.String)
public static ReactiveUI.Primitives.Async.IObservableAsync<T> ObserveValue<T>(IoT.Driver.S7PlcRx.IRxS7 plc, T typeValue, string variable)
Exposes a PLC variable as an async observable sequence.
- Parameter
plc: The PLC instance. - Parameter
typeValue: A value used to infer the PLC value type. - Parameter
variable: The tag name to observe. - Returns: An async observable that emits tag value updates asynchronously.
M:IoT.Driver.S7PlcRx.Advanced.AsyncExtensions.ObserveValues``1(IoT.Driver.S7PlcRx.IRxS7,``0,System.String[])
public static ReactiveUI.Primitives.Async.IObservableAsync<System.Collections.Generic.Dictionary<string, T>> ObserveValues<T>(IoT.Driver.S7PlcRx.IRxS7 plc, T typeValue, string[] variables)
Exposes a batch PLC observation as an async observable sequence.
- Parameter
plc: The PLC instance. - Parameter
typeValue: A value used to infer the PLC value type. - Parameter
variables: The tag names to observe. - Returns: An async observable that emits dictionaries of tag values asynchronously.
M:IoT.Driver.S7PlcRx.Advanced.AsyncExtensions.ReadValueAsync``1(IoT.Driver.S7PlcRx.IRxS7,``0,System.String,System.Threading.CancellationToken)
public static System.Threading.Tasks.ValueTask<T> ReadValueAsync<T>(IoT.Driver.S7PlcRx.IRxS7 plc, T typeValue, string variable, System.Threading.CancellationToken cancellationToken)
Reads a PLC value using a T:System.Threading.Tasks.ValueTask1` .
- Parameter
plc: The PLC instance. - Parameter
typeValue: A value used to infer the PLC value type. - Parameter
variable: The tag name to read. - Parameter
cancellationToken: The cancellation token for the read operation. - Returns: A
T:System.Threading.Tasks.ValueTask1` that resolves to the current PLC value.
M:IoT.Driver.S7PlcRx.Advanced.AsyncExtensions.ReadValuesAsync``1(IoT.Driver.S7PlcRx.IRxS7,``0,System.Collections.Generic.IReadOnlyList1{System.String},System.Threading.CancellationToken)`
public static System.Threading.Tasks.ValueTask<System.Collections.Generic.Dictionary<string, T>> ReadValuesAsync<T>(IoT.Driver.S7PlcRx.IRxS7 plc, T typeValue, System.Collections.Generic.IReadOnlyList<string> variables, System.Threading.CancellationToken cancellationToken)
Executes the ReadValuesAsync operation.
- Parameter
plc: Theplcvalue. - Parameter
typeValue: ThetypeValuevalue. - Parameter
variables: Thevariablesvalue. - Parameter
cancellationToken: ThecancellationTokenvalue. - Returns: A
System.Threading.Tasks.ValueTask<System.Collections.Generic.Dictionary<string, T>>result.
M:IoT.Driver.S7PlcRx.Advanced.AsyncExtensions.WriteValuesAsync``1(IoT.Driver.S7PlcRx.IRxS7,System.Collections.Generic.IReadOnlyDictionary2{System.String,``0},System.Threading.CancellationToken)`
public static System.Threading.Tasks.ValueTask WriteValuesAsync<T>(IoT.Driver.S7PlcRx.IRxS7 plc, System.Collections.Generic.IReadOnlyDictionary<string, T> values, System.Threading.CancellationToken cancellationToken)
Executes the WriteValuesAsync operation.
- Parameter
plc: Theplcvalue. - Parameter
values: Thevaluesvalue. - Parameter
cancellationToken: ThecancellationTokenvalue. - Returns: A
System.Threading.Tasks.ValueTaskresult.
T:IoT.Driver.S7PlcRx.Advanced.DictionaryEqualityComparer2`
public class IoT.Driver.S7PlcRx.Advanced.DictionaryEqualityComparer`2
Compares dictionaries by their key-value pairs.
Declared public members
M:IoT.Driver.S7PlcRx.Advanced.DictionaryEqualityComparer2.#ctor`
public IoT.Driver.S7PlcRx.Advanced.DictionaryEqualityComparer<TKey, TValue>()
Initializes a new instance of IoT.Driver.S7PlcRx.Advanced.DictionaryEqualityComparer2`.
M:IoT.Driver.S7PlcRx.Advanced.DictionaryEqualityComparer2.Equals(System.Collections.Generic.Dictionary2{0,1},System.Collections.Generic.Dictionary2{0,1})`
public bool Equals(System.Collections.Generic.Dictionary<TKey, TValue> x, System.Collections.Generic.Dictionary<TKey, TValue> y)
Determines whether the supplied value is equal to the current value.
- Parameter
x: Thexvalue. - Parameter
y: Theyvalue. - Returns: A
boolresult.
M:IoT.Driver.S7PlcRx.Advanced.DictionaryEqualityComparer2.GetHashCode(System.Collections.Generic.Dictionary2{0,1})
public int GetHashCode(System.Collections.Generic.Dictionary<TKey, TValue> obj)
Returns the hash code for the current value.
- Parameter
obj: Theobjvalue. - Returns: A
intresult.
T:IoT.Driver.S7PlcRx.BatchOperations.BatchOperationResult
public class IoT.Driver.S7PlcRx.BatchOperations.BatchOperationResult
Represents the result and summary statistics of a batch operation.
Declared public members
M:IoT.Driver.S7PlcRx.BatchOperations.BatchOperationResult.#ctor
public IoT.Driver.S7PlcRx.BatchOperations.BatchOperationResult()
Initializes a new instance of IoT.Driver.S7PlcRx.BatchOperations.BatchOperationResult.
P:IoT.Driver.S7PlcRx.BatchOperations.BatchOperationResult.AverageTimePerOperation
public double AverageTimePerOperation { get; }
Gets the average time per operation.
- Value: The
AverageTimePerOperationvalue.
P:IoT.Driver.S7PlcRx.BatchOperations.BatchOperationResult.EndTime
public System.DateTimeOffset EndTime { get; set; }
Gets or sets the operation end time.
- Value: The
EndTimevalue.
P:IoT.Driver.S7PlcRx.BatchOperations.BatchOperationResult.ErrorDetails
public System.Collections.Generic.List<string> ErrorDetails { get; }
Gets error details for failed operations.
- Value: The
ErrorDetailsvalue.
P:IoT.Driver.S7PlcRx.BatchOperations.BatchOperationResult.FailedOperations
public int FailedOperations { get; set; }
Gets or sets the number of failed operations.
- Value: The
FailedOperationsvalue.
P:IoT.Driver.S7PlcRx.BatchOperations.BatchOperationResult.OperationCount
public int OperationCount { get; set; }
Gets or sets the number of operations in the batch.
- Value: The
OperationCountvalue.
P:IoT.Driver.S7PlcRx.BatchOperations.BatchOperationResult.OperationDetails
public System.Collections.Generic.List<IoT.Driver.S7PlcRx.Core.OperationDetail> OperationDetails { get; }
Gets operation details.
- Value: The
OperationDetailsvalue.
P:IoT.Driver.S7PlcRx.BatchOperations.BatchOperationResult.ProcessingTime
public System.TimeSpan ProcessingTime { get; }
Gets the total processing time.
- Value: The
ProcessingTimevalue.
P:IoT.Driver.S7PlcRx.BatchOperations.BatchOperationResult.StartTime
public System.DateTimeOffset StartTime { get; set; }
Gets or sets the operation start time.
- Value: The
StartTimevalue.
P:IoT.Driver.S7PlcRx.BatchOperations.BatchOperationResult.SuccessfulOperations
public int SuccessfulOperations { get; set; }
Gets or sets the number of successful operations.
- Value: The
SuccessfulOperationsvalue.
T:IoT.Driver.S7PlcRx.BatchOperations.BatchReadResult1`
public class IoT.Driver.S7PlcRx.BatchOperations.BatchReadResult`1
Represents the result of a batch read operation, including the values read, per-tag success status, error messages, and overall success information.
Declared public members
M:IoT.Driver.S7PlcRx.BatchOperations.BatchReadResult1.#ctor`
public IoT.Driver.S7PlcRx.BatchOperations.BatchReadResult<T>()
Initializes a new instance of IoT.Driver.S7PlcRx.BatchOperations.BatchReadResult1`.
P:IoT.Driver.S7PlcRx.BatchOperations.BatchReadResult1.ErrorCount`
public int ErrorCount { get; }
Gets the count of failed reads.
- Value: The
ErrorCountvalue.
P:IoT.Driver.S7PlcRx.BatchOperations.BatchReadResult1.Errors`
public System.Collections.Generic.Dictionary<string, string> Errors { get; }
Gets error messages for failed reads.
- Value: The
Errorsvalue.
P:IoT.Driver.S7PlcRx.BatchOperations.BatchReadResult1.OverallSuccess`
public bool OverallSuccess { get; set; }
Gets or sets a value indicating whether gets whether all reads were successful.
- Value: The
OverallSuccessvalue.
P:IoT.Driver.S7PlcRx.BatchOperations.BatchReadResult1.Success`
public System.Collections.Generic.Dictionary<string, bool> Success { get; }
Gets the success status for each tag.
- Value: The
Successvalue.
P:IoT.Driver.S7PlcRx.BatchOperations.BatchReadResult1.SuccessCount`
public int SuccessCount { get; }
Gets the count of successful reads.
- Value: The
SuccessCountvalue.
P:IoT.Driver.S7PlcRx.BatchOperations.BatchReadResult1.Values`
public System.Collections.Generic.Dictionary<string, T> Values { get; }
Gets the successfully read values.
- Value: The
Valuesvalue.
T:IoT.Driver.S7PlcRx.BatchOperations.BatchWriteResult
public class IoT.Driver.S7PlcRx.BatchOperations.BatchWriteResult
Represents the result of a batch write operation, including per-item success status, error messages, and overall outcome.
Declared public members
M:IoT.Driver.S7PlcRx.BatchOperations.BatchWriteResult.#ctor
public IoT.Driver.S7PlcRx.BatchOperations.BatchWriteResult()
Initializes a new instance of IoT.Driver.S7PlcRx.BatchOperations.BatchWriteResult.
P:IoT.Driver.S7PlcRx.BatchOperations.BatchWriteResult.ErrorCount
public int ErrorCount { get; }
Gets the count of failed writes.
- Value: The
ErrorCountvalue.
P:IoT.Driver.S7PlcRx.BatchOperations.BatchWriteResult.Errors
public System.Collections.Generic.Dictionary<string, string> Errors { get; }
Gets error messages for failed writes.
- Value: The
Errorsvalue.
P:IoT.Driver.S7PlcRx.BatchOperations.BatchWriteResult.OverallSuccess
public bool OverallSuccess { get; set; }
Gets or sets a value indicating whether gets whether all writes were successful.
- Value: The
OverallSuccessvalue.
P:IoT.Driver.S7PlcRx.BatchOperations.BatchWriteResult.RollbackPerformed
public bool RollbackPerformed { get; set; }
Gets or sets a value indicating whether gets whether rollback was performed.
- Value: The
RollbackPerformedvalue.
P:IoT.Driver.S7PlcRx.BatchOperations.BatchWriteResult.Success
public System.Collections.Generic.Dictionary<string, bool> Success { get; }
Gets the success status for each tag.
- Value: The
Successvalue.
P:IoT.Driver.S7PlcRx.BatchOperations.BatchWriteResult.SuccessCount
public int SuccessCount { get; }
Gets the count of successful writes.
- Value: The
SuccessCountvalue.
T:IoT.Driver.S7PlcRx.Binding.S7TagBindingSession
public class IoT.Driver.S7PlcRx.Binding.S7TagBindingSession
Owns the runtime and common logical clients created for one generated binding session.
Declared public members
M:IoT.Driver.S7PlcRx.Binding.S7TagBindingSession.#ctor(System.IDisposable,System.IDisposable)
public IoT.Driver.S7PlcRx.Binding.S7TagBindingSession(System.IDisposable runtimeBinding, System.IDisposable logicalClient)
Initializes a new instance of the T:IoT.Driver.S7PlcRx.Binding.S7TagBindingSession class.
- Parameter
runtimeBinding: The runtime binding. - Parameter
logicalClient: The common logical client.
M:IoT.Driver.S7PlcRx.Binding.S7TagBindingSession.Dispose
public void Dispose()
Inherits XML documentation from its implemented or overridden member.
T:IoT.Driver.S7PlcRx.Binding.S7TagDefinition
public class IoT.Driver.S7PlcRx.Binding.S7TagDefinition
Describes a generated PLC tag/property binding.
Declared public members
M:IoT.Driver.S7PlcRx.Binding.S7TagDefinition.#ctor(System.String,System.String,System.Type,System.Int32,IoT.Driver.S7PlcRx.Binding.S7TagDirection,System.Int32)
public IoT.Driver.S7PlcRx.Binding.S7TagDefinition(string name, string address, System.Type valueType, int pollIntervalMs, IoT.Driver.S7PlcRx.Binding.S7TagDirection direction, int arrayLength)
Initializes a new instance of the T:IoT.Driver.S7PlcRx.Binding.S7TagDefinition class.
- Parameter
name: The property and PLC tag name. - Parameter
address: The S7 DB address. - Parameter
valueType: The .NET value type. - Parameter
pollIntervalMs: The read polling interval in milliseconds. - Parameter
direction: The tag access direction. - Parameter
arrayLength: The array/string element length.
P:IoT.Driver.S7PlcRx.Binding.S7TagDefinition.Address
public string Address { get; }
Gets the S7 DB address.
- Value: The
Addressvalue.
P:IoT.Driver.S7PlcRx.Binding.S7TagDefinition.ArrayLength
public int ArrayLength { get; }
Gets the array/string element length.
- Value: The
ArrayLengthvalue.
P:IoT.Driver.S7PlcRx.Binding.S7TagDefinition.CanRead
public bool CanRead { get; }
Gets a value indicating whether this tag should be read on polling intervals.
- Value: The
CanReadvalue.
P:IoT.Driver.S7PlcRx.Binding.S7TagDefinition.CanWrite
public bool CanWrite { get; }
Gets a value indicating whether this tag can write property changes to the PLC.
- Value: The
CanWritevalue.
P:IoT.Driver.S7PlcRx.Binding.S7TagDefinition.Direction
public IoT.Driver.S7PlcRx.Binding.S7TagDirection Direction { get; }
Gets the tag access direction.
- Value: The
Directionvalue.
P:IoT.Driver.S7PlcRx.Binding.S7TagDefinition.Name
public string Name { get; }
Gets the property and PLC tag name.
- Value: The
Namevalue.
P:IoT.Driver.S7PlcRx.Binding.S7TagDefinition.PollIntervalMs
public int PollIntervalMs { get; }
Gets the read polling interval in milliseconds.
- Value: The
PollIntervalMsvalue.
P:IoT.Driver.S7PlcRx.Binding.S7TagDefinition.ValueType
public System.Type ValueType { get; }
Gets the .NET value type.
- Value: The
ValueTypevalue.
T:IoT.Driver.S7PlcRx.Binding.S7TagDirection
public enum IoT.Driver.S7PlcRx.Binding.S7TagDirection
Defines the PLC access direction for a generated tag binding.
Declared public members
F:IoT.Driver.S7PlcRx.Binding.S7TagDirection.ReadOnly
public static const IoT.Driver.S7PlcRx.Binding.S7TagDirection ReadOnly
The tag is read from the PLC only.
F:IoT.Driver.S7PlcRx.Binding.S7TagDirection.ReadWrite
public static const IoT.Driver.S7PlcRx.Binding.S7TagDirection ReadWrite
The tag is read from and written to the PLC.
F:IoT.Driver.S7PlcRx.Binding.S7TagDirection.WriteOnly
public static const IoT.Driver.S7PlcRx.Binding.S7TagDirection WriteOnly
The tag is written to the PLC only.
T:IoT.Driver.S7PlcRx.Binding.S7TagObservableAdapter
public class IoT.Driver.S7PlcRx.Binding.S7TagObservableAdapter
Bridges generated classic observables to async enumeration.
Declared public members
M:IoT.Driver.S7PlcRx.Binding.S7TagObservableAdapter.ToAsyncEnumerable``1(System.IObservable1{``0})`
public static System.Collections.Generic.IAsyncEnumerable<T> ToAsyncEnumerable<T>(System.IObservable<T> source)
Executes the ToAsyncEnumerable operation.
- Parameter
source: Thesourcevalue. - Returns: A
System.Collections.Generic.IAsyncEnumerable<T>result.
T:IoT.Driver.S7PlcRx.Binding.S7TagRuntimeBinding
public class IoT.Driver.S7PlcRx.Binding.S7TagRuntimeBinding
Runtime engine for tag bindings that polls and writes PLC DB values in byte-array batches.
Declared public members
M:IoT.Driver.S7PlcRx.Binding.S7TagRuntimeBinding.Bind(IoT.Driver.S7PlcRx.IRxS7,System.Collections.Generic.IReadOnlyList1{IoT.Driver.S7PlcRx.Binding.S7TagDefinition},System.Action2{System.String,System.Object})
public static IoT.Driver.S7PlcRx.Binding.S7TagRuntimeBinding Bind(IoT.Driver.S7PlcRx.IRxS7 plc, System.Collections.Generic.IReadOnlyList<IoT.Driver.S7PlcRx.Binding.S7TagDefinition> definitions, System.Action<string, object> applyRead)
Executes the Bind operation.
- Parameter
plc: Theplcvalue. - Parameter
definitions: Thedefinitionsvalue. - Parameter
applyRead: TheapplyReadvalue. - Returns: A
IoT.Driver.S7PlcRx.Binding.S7TagRuntimeBindingresult.
M:IoT.Driver.S7PlcRx.Binding.S7TagRuntimeBinding.Dispose
public void Dispose()
Releases timers and pending write state.
M:IoT.Driver.S7PlcRx.Binding.S7TagRuntimeBinding.Write(System.String,System.Object)
public void Write(string name, object value)
Queues a generated property change for a grouped byte-array write.
- Parameter
name: The generated tag/property name. - Parameter
value: The new property value.
T:IoT.Driver.S7PlcRx.Binding.S7TagValueObservable1`
public class IoT.Driver.S7PlcRx.Binding.S7TagValueObservable`1
Provides generated bindings with a small replaying observable that has no subject dependency.
Declared public members
M:IoT.Driver.S7PlcRx.Binding.S7TagValueObservable1.#ctor`
public IoT.Driver.S7PlcRx.Binding.S7TagValueObservable<T>()
Initializes a new instance of IoT.Driver.S7PlcRx.Binding.S7TagValueObservable1`.
M:IoT.Driver.S7PlcRx.Binding.S7TagValueObservable1.Publish(0)
public void Publish(T value)
Publishes a property value and retains it for later subscribers.
- Parameter
value: The new property value.
M:IoT.Driver.S7PlcRx.Binding.S7TagValueObservable1.Subscribe(System.IObserver1{0})`
public System.IDisposable Subscribe(System.IObserver<T> observer)
Executes the Subscribe operation.
- Parameter
observer: Theobservervalue. - Returns: A
System.IDisposableresult.
T:IoT.Driver.S7PlcRx.Cache.CacheStatistics
public class IoT.Driver.S7PlcRx.Cache.CacheStatistics
Provides statistical information about the state and performance of a cache, including entry counts, hit rates, and entry timestamps.
Declared public members
M:IoT.Driver.S7PlcRx.Cache.CacheStatistics.#ctor
public IoT.Driver.S7PlcRx.Cache.CacheStatistics()
Initializes a new instance of IoT.Driver.S7PlcRx.Cache.CacheStatistics.
P:IoT.Driver.S7PlcRx.Cache.CacheStatistics.CacheHitRatio
public double CacheHitRatio { get; }
Gets the cache hit ratio.
- Value: The cache hit ratio.
P:IoT.Driver.S7PlcRx.Cache.CacheStatistics.CachedValueCount
public int CachedValueCount { get; }
Gets the cached value count.
- Value: The cached value count.
P:IoT.Driver.S7PlcRx.Cache.CacheStatistics.HitRate
public double HitRate { get; set; }
Gets or sets the cache hit rate (0.0 to 1.0).
- Value: The
HitRatevalue.
P:IoT.Driver.S7PlcRx.Cache.CacheStatistics.NewestEntry
public System.DateTimeOffset NewestEntry { get; set; }
Gets or sets the timestamp of the newest cache entry.
- Value: The
NewestEntryvalue.
P:IoT.Driver.S7PlcRx.Cache.CacheStatistics.OldestEntry
public System.DateTimeOffset OldestEntry { get; set; }
Gets or sets the timestamp of the oldest cache entry.
- Value: The
OldestEntryvalue.
P:IoT.Driver.S7PlcRx.Cache.CacheStatistics.PendingRequestCount
public int PendingRequestCount { get; }
Gets the pending request count.
- Value: The pending request count.
P:IoT.Driver.S7PlcRx.Cache.CacheStatistics.TotalEntries
public int TotalEntries { get; set; }
Gets or sets the total number of cached entries.
- Value: The
TotalEntriesvalue.
P:IoT.Driver.S7PlcRx.Cache.CacheStatistics.TotalHits
public long TotalHits { get; set; }
Gets or sets the total number of cache hits.
- Value: The
TotalHitsvalue.
T:IoT.Driver.S7PlcRx.Cache.CachedTagValue
public class IoT.Driver.S7PlcRx.Cache.CachedTagValue
Represents a cached value along with metadata about its storage and usage.
Declared public members
M:IoT.Driver.S7PlcRx.Cache.CachedTagValue.#ctor
public IoT.Driver.S7PlcRx.Cache.CachedTagValue()
Initializes a new instance of IoT.Driver.S7PlcRx.Cache.CachedTagValue.
P:IoT.Driver.S7PlcRx.Cache.CachedTagValue.HitCount
public long HitCount { get; set; }
Gets or sets the number of cache hits.
- Value: The
HitCountvalue.
P:IoT.Driver.S7PlcRx.Cache.CachedTagValue.Timestamp
public System.DateTimeOffset Timestamp { get; set; }
Gets or sets when the value was cached.
- Value: The
Timestampvalue.
P:IoT.Driver.S7PlcRx.Cache.CachedTagValue.Value
public object Value { get; set; }
Gets or sets the cached value.
- Value: The
Valuevalue.
T:IoT.Driver.S7PlcRx.Core.ConnectionPool
public class IoT.Driver.S7PlcRx.Core.ConnectionPool
Manages a pool of PLC connections, providing load-balanced access and connection reuse according to the specified configuration.
Declared public members
M:IoT.Driver.S7PlcRx.Core.ConnectionPool.#ctor(IoT.Driver.S7PlcRx.Core.ConnectionPoolConfig)
public IoT.Driver.S7PlcRx.Core.ConnectionPool(IoT.Driver.S7PlcRx.Core.ConnectionPoolConfig config)
Initializes a new instance of the T:IoT.Driver.S7PlcRx.Core.ConnectionPool class.
- Parameter
config: The pool configuration.
M:IoT.Driver.S7PlcRx.Core.ConnectionPool.#ctor(System.Collections.Generic.IEnumerable1{IoT.Driver.S7PlcRx.Enterprise.PlcConnectionConfig},IoT.Driver.S7PlcRx.Core.ConnectionPoolConfig)`
public IoT.Driver.S7PlcRx.Core.ConnectionPool(System.Collections.Generic.IEnumerable<IoT.Driver.S7PlcRx.Enterprise.PlcConnectionConfig> connectionConfigs, IoT.Driver.S7PlcRx.Core.ConnectionPoolConfig poolConfig)
Initializes a new instance of IoT.Driver.S7PlcRx.Core.ConnectionPool.
- Parameter
connectionConfigs: TheconnectionConfigsvalue. - Parameter
poolConfig: ThepoolConfigvalue.
M:IoT.Driver.S7PlcRx.Core.ConnectionPool.Dispose
public void Dispose()
Disposes all connections in the pool.
P:IoT.Driver.S7PlcRx.Core.ConnectionPool.ActiveConnections
public int ActiveConnections { get; }
Gets the number of active connections.
- Value: The
ActiveConnectionsvalue.
P:IoT.Driver.S7PlcRx.Core.ConnectionPool.AllConnections
public System.Collections.Generic.IEnumerable<IoT.Driver.S7PlcRx.IRxS7> AllConnections { get; }
Gets all connections in the pool.
- Value: The
AllConnectionsvalue.
P:IoT.Driver.S7PlcRx.Core.ConnectionPool.Connection
public IoT.Driver.S7PlcRx.IRxS7 Connection { get; }
Gets a connection from the pool using load balancing.
- Returns: An available PLC connection.
- Value: The
Connectionvalue.
P:IoT.Driver.S7PlcRx.Core.ConnectionPool.MaxConnections
public int MaxConnections { get; }
Gets the maximum number of connections in the pool.
- Value: The
MaxConnectionsvalue.
T:IoT.Driver.S7PlcRx.Core.ConnectionPoolConfig
public class IoT.Driver.S7PlcRx.Core.ConnectionPoolConfig
Configures connection-pool limits, timeouts, and behavior.
Declared public members
M:IoT.Driver.S7PlcRx.Core.ConnectionPoolConfig.#ctor
public IoT.Driver.S7PlcRx.Core.ConnectionPoolConfig()
Initializes a new instance of IoT.Driver.S7PlcRx.Core.ConnectionPoolConfig.
P:IoT.Driver.S7PlcRx.Core.ConnectionPoolConfig.ConnectionTimeout
public System.TimeSpan ConnectionTimeout { get; set; }
Gets or sets the connection timeout.
- Value: The
ConnectionTimeoutvalue.
P:IoT.Driver.S7PlcRx.Core.ConnectionPoolConfig.EnableConnectionReuse
public bool EnableConnectionReuse { get; set; }
Gets or sets a value indicating whether to enable connection reuse.
- Value: The
EnableConnectionReusevalue.
P:IoT.Driver.S7PlcRx.Core.ConnectionPoolConfig.EnableLoadBalancing
public bool EnableLoadBalancing { get; set; }
Gets or sets a value indicating whether to enable load balancing.
- Value: The
EnableLoadBalancingvalue.
P:IoT.Driver.S7PlcRx.Core.ConnectionPoolConfig.HealthCheckInterval
public System.TimeSpan HealthCheckInterval { get; set; }
Gets or sets the health check interval.
- Value: The
HealthCheckIntervalvalue.
P:IoT.Driver.S7PlcRx.Core.ConnectionPoolConfig.MaxConnections
public int MaxConnections { get; set; }
Gets or sets the maximum number of connections in the pool.
- Value: The
MaxConnectionsvalue.
P:IoT.Driver.S7PlcRx.Core.ConnectionPoolConfig.MaxPoolSize
public int MaxPoolSize { get; set; }
Gets or sets the maximum pool size.
- Value: The
MaxPoolSizevalue.
T:IoT.Driver.S7PlcRx.Core.DataBlockInfo
public class IoT.Driver.S7PlcRx.Core.DataBlockInfo
Represents metadata and configuration information for a data block, including its identifier, size, tag details, access frequency, and optimization settings.
Declared public members
M:IoT.Driver.S7PlcRx.Core.DataBlockInfo.#ctor
public IoT.Driver.S7PlcRx.Core.DataBlockInfo()
Initializes a new instance of IoT.Driver.S7PlcRx.Core.DataBlockInfo.
P:IoT.Driver.S7PlcRx.Core.DataBlockInfo.AccessFrequency
public double AccessFrequency { get; set; }
Gets or sets the access frequency.
- Value: The
AccessFrequencyvalue.
P:IoT.Driver.S7PlcRx.Core.DataBlockInfo.BlockNumber
public int BlockNumber { get; set; }
Gets or sets the data block number.
- Value: The
BlockNumbervalue.
P:IoT.Driver.S7PlcRx.Core.DataBlockInfo.IsBatchOptimized
public bool IsBatchOptimized { get; set; }
Gets or sets whether the block is optimized for batch operations.
- Value: The
IsBatchOptimizedvalue.
P:IoT.Driver.S7PlcRx.Core.DataBlockInfo.SizeBytes
public int SizeBytes { get; set; }
Gets or sets the total size in bytes.
- Value: The
SizeBytesvalue.
P:IoT.Driver.S7PlcRx.Core.DataBlockInfo.TagCount
public int TagCount { get; set; }
Gets or sets the number of tags in this block.
- Value: The
TagCountvalue.
P:IoT.Driver.S7PlcRx.Core.DataBlockInfo.TagNames
public System.Collections.Generic.List<string> TagNames { get; }
Gets the tags in this data block.
- Value: The
TagNamesvalue.
T:IoT.Driver.S7PlcRx.Core.OperationDetail
public class IoT.Driver.S7PlcRx.Core.OperationDetail
Describes an operation and its status, duration, and metadata.
Declared public members
M:IoT.Driver.S7PlcRx.Core.OperationDetail.#ctor
public IoT.Driver.S7PlcRx.Core.OperationDetail()
Initializes a new instance of IoT.Driver.S7PlcRx.Core.OperationDetail.
P:IoT.Driver.S7PlcRx.Core.OperationDetail.DataBlockNumber
public int DataBlockNumber { get; set; }
Gets or sets the data block number.
- Value: The
DataBlockNumbervalue.
P:IoT.Driver.S7PlcRx.Core.OperationDetail.Duration
public System.TimeSpan Duration { get; set; }
Gets or sets the operation duration.
- Value: The
Durationvalue.
P:IoT.Driver.S7PlcRx.Core.OperationDetail.ErrorMessage
public string ErrorMessage { get; set; }
Gets or sets any error message.
- Value: The
ErrorMessagevalue.
P:IoT.Driver.S7PlcRx.Core.OperationDetail.OperationType
public string OperationType { get; set; }
Gets or sets the operation type.
- Value: The
OperationTypevalue.
P:IoT.Driver.S7PlcRx.Core.OperationDetail.Success
public bool Success { get; set; }
Gets or sets a value indicating whether gets or sets whether the operation succeeded.
- Value: The
Successvalue.
P:IoT.Driver.S7PlcRx.Core.OperationDetail.TagName
public string TagName { get; set; }
Gets or sets the tag name.
- Value: The
TagNamevalue.
T:IoT.Driver.S7PlcRx.Core.RequestPriority
public enum IoT.Driver.S7PlcRx.Core.RequestPriority
Request priority levels for batch processing.
Declared public members
F:IoT.Driver.S7PlcRx.Core.RequestPriority.Critical
public static const IoT.Driver.S7PlcRx.Core.RequestPriority Critical
Critical priority request.
F:IoT.Driver.S7PlcRx.Core.RequestPriority.High
public static const IoT.Driver.S7PlcRx.Core.RequestPriority High
High priority request.
F:IoT.Driver.S7PlcRx.Core.RequestPriority.Low
public static const IoT.Driver.S7PlcRx.Core.RequestPriority Low
Low priority request.
F:IoT.Driver.S7PlcRx.Core.RequestPriority.Normal
public static const IoT.Driver.S7PlcRx.Core.RequestPriority Normal
Normal priority request.
T:IoT.Driver.S7PlcRx.Enterprise.EnterpriseExtensions
public class IoT.Driver.S7PlcRx.Enterprise.EnterpriseExtensions
Provides enterprise PLC connectivity and symbolic-addressing extensions.
Declared public members
M:IoT.Driver.S7PlcRx.Enterprise.EnterpriseExtensions.CreateConnectionPool(System.Collections.Generic.IEnumerable1{IoT.Driver.S7PlcRx.Enterprise.PlcConnectionConfig},IoT.Driver.S7PlcRx.Core.ConnectionPoolConfig)`
public static IoT.Driver.S7PlcRx.Core.ConnectionPool CreateConnectionPool(System.Collections.Generic.IEnumerable<IoT.Driver.S7PlcRx.Enterprise.PlcConnectionConfig> connectionConfigs, IoT.Driver.S7PlcRx.Core.ConnectionPoolConfig poolConfig)
Executes the CreateConnectionPool operation.
- Parameter
connectionConfigs: TheconnectionConfigsvalue. - Parameter
poolConfig: ThepoolConfigvalue. - Returns: A
IoT.Driver.S7PlcRx.Core.ConnectionPoolresult.
M:IoT.Driver.S7PlcRx.Enterprise.EnterpriseExtensions.CreateConnectionPool(System.Collections.Generic.IEnumerable1{IoT.Driver.S7PlcRx.Enterprise.PlcConnectionConfig},IoT.Driver.S7PlcRx.Core.ConnectionPoolConfig,System.TimeProvider)`
public static IoT.Driver.S7PlcRx.Core.ConnectionPool CreateConnectionPool(System.Collections.Generic.IEnumerable<IoT.Driver.S7PlcRx.Enterprise.PlcConnectionConfig> connectionConfigs, IoT.Driver.S7PlcRx.Core.ConnectionPoolConfig poolConfig, System.TimeProvider timeProvider)
Executes the CreateConnectionPool operation.
- Parameter
connectionConfigs: TheconnectionConfigsvalue. - Parameter
poolConfig: ThepoolConfigvalue. - Parameter
timeProvider: ThetimeProvidervalue. - Returns: A
IoT.Driver.S7PlcRx.Core.ConnectionPoolresult.
M:IoT.Driver.S7PlcRx.Enterprise.EnterpriseExtensions.CreateHighAvailabilityConnection(IoT.Driver.S7PlcRx.IRxS7,System.Collections.Generic.IList1{IoT.Driver.S7PlcRx.IRxS7})`
public static IoT.Driver.S7PlcRx.Enterprise.HighAvailabilityPlcManager CreateHighAvailabilityConnection(IoT.Driver.S7PlcRx.IRxS7 primaryPlc, System.Collections.Generic.IList<IoT.Driver.S7PlcRx.IRxS7> backupPlcs)
Executes the CreateHighAvailabilityConnection operation.
- Parameter
primaryPlc: TheprimaryPlcvalue. - Parameter
backupPlcs: ThebackupPlcsvalue. - Returns: A
IoT.Driver.S7PlcRx.Enterprise.HighAvailabilityPlcManagerresult.
M:IoT.Driver.S7PlcRx.Enterprise.EnterpriseExtensions.CreateHighAvailabilityConnection(IoT.Driver.S7PlcRx.IRxS7,System.Collections.Generic.IList1{IoT.Driver.S7PlcRx.IRxS7},System.TimeSpan)`
public static IoT.Driver.S7PlcRx.Enterprise.HighAvailabilityPlcManager CreateHighAvailabilityConnection(IoT.Driver.S7PlcRx.IRxS7 primaryPlc, System.Collections.Generic.IList<IoT.Driver.S7PlcRx.IRxS7> backupPlcs, System.TimeSpan healthCheckInterval)
Executes the CreateHighAvailabilityConnection operation.
- Parameter
primaryPlc: TheprimaryPlcvalue. - Parameter
backupPlcs: ThebackupPlcsvalue. - Parameter
healthCheckInterval: ThehealthCheckIntervalvalue. - Returns: A
IoT.Driver.S7PlcRx.Enterprise.HighAvailabilityPlcManagerresult.
M:IoT.Driver.S7PlcRx.Enterprise.EnterpriseExtensions.LoadSymbolTableAsync(IoT.Driver.S7PlcRx.IRxS7,System.String)
public static System.Threading.Tasks.Task<IoT.Driver.S7PlcRx.Enterprise.SymbolTable> LoadSymbolTableAsync(IoT.Driver.S7PlcRx.IRxS7 plc, string symbolTableData)
Loads and caches a CSV symbol table for symbolic addressing support.
- Parameter
plc: The PLC instance. - Parameter
symbolTableData: CSV symbol table data. - Returns: The loaded symbol table.
M:IoT.Driver.S7PlcRx.Enterprise.EnterpriseExtensions.LoadSymbolTableAsync(IoT.Driver.S7PlcRx.IRxS7,System.String,IoT.Driver.S7PlcRx.Enterprise.SymbolTableFormat)
public static System.Threading.Tasks.Task<IoT.Driver.S7PlcRx.Enterprise.SymbolTable> LoadSymbolTableAsync(IoT.Driver.S7PlcRx.IRxS7 plc, string symbolTableData, IoT.Driver.S7PlcRx.Enterprise.SymbolTableFormat format)
Loads and caches a symbol table for symbolic addressing support.
- Parameter
plc: The PLC instance. - Parameter
symbolTableData: Symbol table data. - Parameter
format: The format of the symbol table data. - Returns: The loaded symbol table.
M:IoT.Driver.S7PlcRx.Enterprise.EnterpriseExtensions.ReadSymbolAsync(IoT.Driver.S7PlcRx.IRxS7,System.String)
public static System.Threading.Tasks.Task<object> ReadSymbolAsync(IoT.Driver.S7PlcRx.IRxS7 plc, string symbolName)
Reads the value of the specified symbol from the PLC.
- Parameter
plc: The PLC instance. - Parameter
symbolName: The symbol name. - Returns: A task containing the symbol value.
M:IoT.Driver.S7PlcRx.Enterprise.EnterpriseExtensions.WriteSymbol``1(IoT.Driver.S7PlcRx.IRxS7,System.String,``0)
public static void WriteSymbol<T>(IoT.Driver.S7PlcRx.IRxS7 plc, string symbolName, T value)
Writes a value to the specified PLC symbol by name.
- Parameter
plc: The PLC instance. - Parameter
symbolName: The symbol name. - Parameter
value: The value to write.
T:IoT.Driver.S7PlcRx.Enterprise.HighAvailabilityPlcManager
public class IoT.Driver.S7PlcRx.Enterprise.HighAvailabilityPlcManager
Provides high-availability management for PLC connections.
Declared public members
M:IoT.Driver.S7PlcRx.Enterprise.HighAvailabilityPlcManager.#ctor(IoT.Driver.S7PlcRx.IRxS7,System.Collections.Generic.IList1{IoT.Driver.S7PlcRx.IRxS7})`
public IoT.Driver.S7PlcRx.Enterprise.HighAvailabilityPlcManager(IoT.Driver.S7PlcRx.IRxS7 primaryPlc, System.Collections.Generic.IList<IoT.Driver.S7PlcRx.IRxS7> backupPlcs)
Initializes a new instance of IoT.Driver.S7PlcRx.Enterprise.HighAvailabilityPlcManager.
- Parameter
primaryPlc: TheprimaryPlcvalue. - Parameter
backupPlcs: ThebackupPlcsvalue.
M:IoT.Driver.S7PlcRx.Enterprise.HighAvailabilityPlcManager.#ctor(IoT.Driver.S7PlcRx.IRxS7,System.Collections.Generic.IList1{IoT.Driver.S7PlcRx.IRxS7},System.TimeSpan)`
public IoT.Driver.S7PlcRx.Enterprise.HighAvailabilityPlcManager(IoT.Driver.S7PlcRx.IRxS7 primaryPlc, System.Collections.Generic.IList<IoT.Driver.S7PlcRx.IRxS7> backupPlcs, System.TimeSpan healthCheckInterval)
Initializes a new instance of IoT.Driver.S7PlcRx.Enterprise.HighAvailabilityPlcManager.
- Parameter
primaryPlc: TheprimaryPlcvalue. - Parameter
backupPlcs: ThebackupPlcsvalue. - Parameter
healthCheckInterval: ThehealthCheckIntervalvalue.
M:IoT.Driver.S7PlcRx.Enterprise.HighAvailabilityPlcManager.#ctor(IoT.Driver.S7PlcRx.IRxS7,System.Collections.Generic.IList1{IoT.Driver.S7PlcRx.IRxS7},System.TimeSpan,System.TimeProvider)`
public IoT.Driver.S7PlcRx.Enterprise.HighAvailabilityPlcManager(IoT.Driver.S7PlcRx.IRxS7 primaryPlc, System.Collections.Generic.IList<IoT.Driver.S7PlcRx.IRxS7> backupPlcs, System.TimeSpan healthCheckInterval, System.TimeProvider timeProvider)
Initializes a new instance of IoT.Driver.S7PlcRx.Enterprise.HighAvailabilityPlcManager.
- Parameter
primaryPlc: TheprimaryPlcvalue. - Parameter
backupPlcs: ThebackupPlcsvalue. - Parameter
healthCheckInterval: ThehealthCheckIntervalvalue. - Parameter
timeProvider: ThetimeProvidervalue.
M:IoT.Driver.S7PlcRx.Enterprise.HighAvailabilityPlcManager.Dispose
public void Dispose()
Disposes the high-availability manager.
M:IoT.Driver.S7PlcRx.Enterprise.HighAvailabilityPlcManager.TriggerFailoverAsync
public System.Threading.Tasks.Task<bool> TriggerFailoverAsync()
Manually triggers a failover to the next available backup.
- Returns: A value indicating whether failover was successful.
P:IoT.Driver.S7PlcRx.Enterprise.HighAvailabilityPlcManager.ActivePLC
public IoT.Driver.S7PlcRx.IRxS7 ActivePLC { get; }
Gets the currently active PLC connection.
- Value: The
ActivePLCvalue.
P:IoT.Driver.S7PlcRx.Enterprise.HighAvailabilityPlcManager.FailoverEvents
public System.IObservable<IoT.Driver.S7PlcRx.Enterprise.PlcFailoverEvent> FailoverEvents { get; }
Gets the observable stream of failover events.
- Value: The
FailoverEventsvalue.
T:IoT.Driver.S7PlcRx.Enterprise.PlcConnectionConfig
public class IoT.Driver.S7PlcRx.Enterprise.PlcConnectionConfig
Represents the settings required to establish a programmable logic controller connection.
Declared public members
M:IoT.Driver.S7PlcRx.Enterprise.PlcConnectionConfig.#ctor
public IoT.Driver.S7PlcRx.Enterprise.PlcConnectionConfig()
Initializes a new instance of IoT.Driver.S7PlcRx.Enterprise.PlcConnectionConfig.
P:IoT.Driver.S7PlcRx.Enterprise.PlcConnectionConfig.ConnectionName
public string ConnectionName { get; set; }
Gets or sets the connection name.
- Value: The
ConnectionNamevalue.
P:IoT.Driver.S7PlcRx.Enterprise.PlcConnectionConfig.IPAddress
public string IPAddress { get; set; }
Gets or sets the IP address.
- Value: The
IPAddressvalue.
P:IoT.Driver.S7PlcRx.Enterprise.PlcConnectionConfig.PLCType
public IoT.Driver.S7PlcRx.Enums.CpuType PLCType { get; set; }
Gets or sets the PLC type.
- Value: The
PLCTypevalue.
P:IoT.Driver.S7PlcRx.Enterprise.PlcConnectionConfig.Rack
public short Rack { get; set; }
Gets or sets the rack number.
- Value: The
Rackvalue.
P:IoT.Driver.S7PlcRx.Enterprise.PlcConnectionConfig.Slot
public short Slot { get; set; }
Gets or sets the slot number.
- Value: The
Slotvalue.
T:IoT.Driver.S7PlcRx.Enterprise.PlcFailoverEvent
public class IoT.Driver.S7PlcRx.Enterprise.PlcFailoverEvent
Represents an event that occurs when a programmable logic controller failover takes place.
Declared public members
M:IoT.Driver.S7PlcRx.Enterprise.PlcFailoverEvent.#ctor
public IoT.Driver.S7PlcRx.Enterprise.PlcFailoverEvent()
Initializes a new instance of IoT.Driver.S7PlcRx.Enterprise.PlcFailoverEvent.
P:IoT.Driver.S7PlcRx.Enterprise.PlcFailoverEvent.NewPlc
public string NewPlc { get; set; }
Gets or sets the new PLC identifier.
- Value: The
NewPlcvalue.
P:IoT.Driver.S7PlcRx.Enterprise.PlcFailoverEvent.OldPlc
public string OldPlc { get; set; }
Gets or sets the old PLC identifier.
- Value: The
OldPlcvalue.
P:IoT.Driver.S7PlcRx.Enterprise.PlcFailoverEvent.Reason
public string Reason { get; set; }
Gets or sets the reason for failover.
- Value: The
Reasonvalue.
P:IoT.Driver.S7PlcRx.Enterprise.PlcFailoverEvent.Timestamp
public System.DateTimeOffset Timestamp { get; set; }
Gets or sets the timestamp of the failover.
- Value: The
Timestampvalue.
T:IoT.Driver.S7PlcRx.Enterprise.SecurityContext
public class IoT.Driver.S7PlcRx.Enterprise.SecurityContext
Represents the security context for a session, including encryption settings, session timing, and certificate information.
Declared public members
M:IoT.Driver.S7PlcRx.Enterprise.SecurityContext.#ctor
public IoT.Driver.S7PlcRx.Enterprise.SecurityContext()
Initializes a new instance of the T:IoT.Driver.S7PlcRx.Enterprise.SecurityContext class.
M:IoT.Driver.S7PlcRx.Enterprise.SecurityContext.#ctor(System.TimeProvider)
public IoT.Driver.S7PlcRx.Enterprise.SecurityContext(System.TimeProvider timeProvider)
Initializes a new instance of the T:IoT.Driver.S7PlcRx.Enterprise.SecurityContext class.
- Parameter
timeProvider: The time provider.
P:IoT.Driver.S7PlcRx.Enterprise.SecurityContext.CertificatePassword
public string CertificatePassword { get; }
Gets the certificate password.
- Value: The certificate password.
P:IoT.Driver.S7PlcRx.Enterprise.SecurityContext.CertificatePath
public string CertificatePath { get; }
Gets the certificate path.
- Value: The certificate path.
P:IoT.Driver.S7PlcRx.Enterprise.SecurityContext.EnableEncryption
public bool EnableEncryption { get; }
Gets a value indicating whether [enable encryption].
- Value: true if [enable encryption]; otherwise, false .
P:IoT.Driver.S7PlcRx.Enterprise.SecurityContext.EncryptionKey
public string EncryptionKey { get; set; }
Gets or sets the encryption key.
- Value: The
EncryptionKeyvalue.
P:IoT.Driver.S7PlcRx.Enterprise.SecurityContext.IsEnabled
public bool IsEnabled { get; set; }
Gets or sets a value indicating whether security is enabled.
- Value: The
IsEnabledvalue.
P:IoT.Driver.S7PlcRx.Enterprise.SecurityContext.IsSessionValid
public bool IsSessionValid { get; }
Gets a value indicating whether the session is still valid.
- Value: The
IsSessionValidvalue.
P:IoT.Driver.S7PlcRx.Enterprise.SecurityContext.PLCKey
public string PLCKey { get; set; }
Gets or sets the PLC key identifier.
- Value: The
PLCKeyvalue.
P:IoT.Driver.S7PlcRx.Enterprise.SecurityContext.SessionStartTime
public System.DateTimeOffset SessionStartTime { get; set; }
Gets or sets the session start time.
- Value: The
SessionStartTimevalue.
P:IoT.Driver.S7PlcRx.Enterprise.SecurityContext.SessionTimeout
public System.TimeSpan SessionTimeout { get; set; }
Gets or sets the session timeout.
- Value: The
SessionTimeoutvalue.
T:IoT.Driver.S7PlcRx.Enterprise.Symbol
public class IoT.Driver.S7PlcRx.Enterprise.Symbol
Represents a programmable logic controller (PLC) symbol, including its name, address, data type, length, and description.
Declared public members
M:IoT.Driver.S7PlcRx.Enterprise.Symbol.#ctor
public IoT.Driver.S7PlcRx.Enterprise.Symbol()
Initializes a new instance of IoT.Driver.S7PlcRx.Enterprise.Symbol.
P:IoT.Driver.S7PlcRx.Enterprise.Symbol.Address
public string Address { get; set; }
Gets or sets the PLC address.
- Value: The
Addressvalue.
P:IoT.Driver.S7PlcRx.Enterprise.Symbol.DataType
public string DataType { get; set; }
Gets or sets the data type.
- Value: The
DataTypevalue.
P:IoT.Driver.S7PlcRx.Enterprise.Symbol.Description
public string Description { get; set; }
Gets or sets the description.
- Value: The
Descriptionvalue.
P:IoT.Driver.S7PlcRx.Enterprise.Symbol.Length
public int Length { get; set; }
Gets or sets the length for array types.
- Value: The
Lengthvalue.
P:IoT.Driver.S7PlcRx.Enterprise.Symbol.Name
public string Name { get; set; }
Gets or sets the symbol name.
- Value: The
Namevalue.
T:IoT.Driver.S7PlcRx.Enterprise.SymbolTable
public class IoT.Driver.S7PlcRx.Enterprise.SymbolTable
Represents a read-only table of named symbols and the time at which it was loaded.
Declared public members
M:IoT.Driver.S7PlcRx.Enterprise.SymbolTable.#ctor
public IoT.Driver.S7PlcRx.Enterprise.SymbolTable()
Initializes a new instance of the T:IoT.Driver.S7PlcRx.Enterprise.SymbolTable class.
M:IoT.Driver.S7PlcRx.Enterprise.SymbolTable.#ctor(System.TimeProvider)
public IoT.Driver.S7PlcRx.Enterprise.SymbolTable(System.TimeProvider timeProvider)
Initializes a new instance of the T:IoT.Driver.S7PlcRx.Enterprise.SymbolTable class.
- Parameter
timeProvider: The time provider.
P:IoT.Driver.S7PlcRx.Enterprise.SymbolTable.LoadedAt
public System.DateTimeOffset LoadedAt { get; }
Gets the timestamp when the symbol table was loaded.
- Value: The
LoadedAtvalue.
P:IoT.Driver.S7PlcRx.Enterprise.SymbolTable.Symbols
public System.Collections.Generic.Dictionary<string, IoT.Driver.S7PlcRx.Enterprise.Symbol> Symbols { get; }
Gets the collection of symbols indexed by name.
- Value: The
Symbolsvalue.
T:IoT.Driver.S7PlcRx.Enterprise.SymbolTableFormat
public enum IoT.Driver.S7PlcRx.Enterprise.SymbolTableFormat
Specifies the supported formats for serializing or deserializing a symbol table.
Declared public members
F:IoT.Driver.S7PlcRx.Enterprise.SymbolTableFormat.Csv
public static const IoT.Driver.S7PlcRx.Enterprise.SymbolTableFormat Csv
CSV format.
F:IoT.Driver.S7PlcRx.Enterprise.SymbolTableFormat.Json
public static const IoT.Driver.S7PlcRx.Enterprise.SymbolTableFormat Json
JSON format.
F:IoT.Driver.S7PlcRx.Enterprise.SymbolTableFormat.Xml
public static const IoT.Driver.S7PlcRx.Enterprise.SymbolTableFormat Xml
XML format.
T:IoT.Driver.S7PlcRx.Enums.CpuType
public enum IoT.Driver.S7PlcRx.Enums.CpuType
Specifies the supported CPU types for Siemens programmable logic controllers (PLCs).
Declared public members
F:IoT.Driver.S7PlcRx.Enums.CpuType.Logo0BA8
public static const IoT.Driver.S7PlcRx.Enums.CpuType Logo0BA8
The logo0ba8.
F:IoT.Driver.S7PlcRx.Enums.CpuType.S71200
public static const IoT.Driver.S7PlcRx.Enums.CpuType S71200
The Siemens S7 1200 CPU family.
F:IoT.Driver.S7PlcRx.Enums.CpuType.S71500
public static const IoT.Driver.S7PlcRx.Enums.CpuType S71500
The Siemens S7 1500 CPU family.
F:IoT.Driver.S7PlcRx.Enums.CpuType.S7200
public static const IoT.Driver.S7PlcRx.Enums.CpuType S7200
The S7200.
F:IoT.Driver.S7PlcRx.Enums.CpuType.S7300
public static const IoT.Driver.S7PlcRx.Enums.CpuType S7300
The S7300.
F:IoT.Driver.S7PlcRx.Enums.CpuType.S7400
public static const IoT.Driver.S7PlcRx.Enums.CpuType S7400
The S7400.
T:IoT.Driver.S7PlcRx.Enums.ErrorCode
public enum IoT.Driver.S7PlcRx.Enums.ErrorCode
Specifies error codes that indicate the result of an operation or the type of error encountered.
Declared public members
F:IoT.Driver.S7PlcRx.Enums.ErrorCode.ConnectionError
public static const IoT.Driver.S7PlcRx.Enums.ErrorCode ConnectionError
The connection error.
F:IoT.Driver.S7PlcRx.Enums.ErrorCode.IPAddressNotAvailable
public static const IoT.Driver.S7PlcRx.Enums.ErrorCode IPAddressNotAvailable
The IP address not available.
F:IoT.Driver.S7PlcRx.Enums.ErrorCode.NoError
public static const IoT.Driver.S7PlcRx.Enums.ErrorCode NoError
The no error.
F:IoT.Driver.S7PlcRx.Enums.ErrorCode.ReadData
public static const IoT.Driver.S7PlcRx.Enums.ErrorCode ReadData
The read data.
F:IoT.Driver.S7PlcRx.Enums.ErrorCode.SendData
public static const IoT.Driver.S7PlcRx.Enums.ErrorCode SendData
The send data.
F:IoT.Driver.S7PlcRx.Enums.ErrorCode.WriteData
public static const IoT.Driver.S7PlcRx.Enums.ErrorCode WriteData
The write data.
F:IoT.Driver.S7PlcRx.Enums.ErrorCode.WrongCPUType
public static const IoT.Driver.S7PlcRx.Enums.ErrorCode WrongCPUType
The wrong CPU type.
F:IoT.Driver.S7PlcRx.Enums.ErrorCode.WrongNumberReceivedBytes
public static const IoT.Driver.S7PlcRx.Enums.ErrorCode WrongNumberReceivedBytes
The wrong number received bytes.
F:IoT.Driver.S7PlcRx.Enums.ErrorCode.WrongVarFormat
public static const IoT.Driver.S7PlcRx.Enums.ErrorCode WrongVarFormat
The wrong variable format.
T:IoT.Driver.S7PlcRx.Enums.S7StringType
public enum IoT.Driver.S7PlcRx.Enums.S7StringType
Specifies the string encoding type used for S7 PLC string variables.
Declared public members
F:IoT.Driver.S7PlcRx.Enums.S7StringType.None
public static const IoT.Driver.S7PlcRx.Enums.S7StringType None
No S7 string encoding type has been selected.
F:IoT.Driver.S7PlcRx.Enums.S7StringType.S7String
public static const IoT.Driver.S7PlcRx.Enums.S7StringType S7String
ASCII string.
F:IoT.Driver.S7PlcRx.Enums.S7StringType.S7WString
public static const IoT.Driver.S7PlcRx.Enums.S7StringType S7WString
Unicode string.
T:IoT.Driver.S7PlcRx.IRxS7
public interface IoT.Driver.S7PlcRx.IRxS7
Defines an interface for reactive communication with a Siemens S7 PLC, providing observable access to connection status, errors, tag values, and PLC information, as well as methods for reading and writing variables asynchronously.
Declared public members
M:IoT.Driver.S7PlcRx.IRxS7.GetCpuInfo
public System.IObservable<string[]> GetCpuInfo()
Retrieves an observable sequence containing information about the system's CPU.
- Returns: An observable sequence of string arrays, where each array contains details about the CPU. It emits new arrays when CPU information is updated.
M:IoT.Driver.S7PlcRx.IRxS7.Observe``1(IoT.Driver.Core.LogicalTagKey1{``0})`
public System.IObservable<T> Observe<T>(IoT.Driver.Core.LogicalTagKey<T> tag)
Executes the Observe operation.
- Parameter
tag: Thetagvalue. - Returns: A
System.IObservable<T>result.
M:IoT.Driver.S7PlcRx.IRxS7.ReadAsync``1(IoT.Driver.Core.LogicalTagKey1{``0})`
public System.Threading.Tasks.Task<T> ReadAsync<T>(IoT.Driver.Core.LogicalTagKey<T> tag)
Executes the ReadAsync operation.
- Parameter
tag: Thetagvalue. - Returns: A
System.Threading.Tasks.Task<T>result.
M:IoT.Driver.S7PlcRx.IRxS7.ReadAsync``1(IoT.Driver.Core.LogicalTagKey1{``0},System.Threading.CancellationToken)`
public System.Threading.Tasks.Task<T> ReadAsync<T>(IoT.Driver.Core.LogicalTagKey<T> tag, System.Threading.CancellationToken cancellationToken)
Executes the ReadAsync operation.
- Parameter
tag: Thetagvalue. - Parameter
cancellationToken: ThecancellationTokenvalue. - Returns: A
System.Threading.Tasks.Task<T>result.
M:IoT.Driver.S7PlcRx.IRxS7.Value``1(System.String,``0)
public void Value<T>(string variable, T value)
Sets the value of a variable with the specified name and value.
- Parameter
variable: The name of the variable to set. Can be null to indicate an unnamed or default variable. - Parameter
value: The value to assign to the variable. Can be null if the variable type allows null values.
P:IoT.Driver.S7PlcRx.IRxS7.IP
public string IP { get; }
Gets the IP address associated with the current instance.
- Value: The
IPvalue.
P:IoT.Driver.S7PlcRx.IRxS7.IsConnected
public System.IObservable<bool> IsConnected { get; }
Gets an observable sequence that indicates whether the connection is currently established.
- Value: The
IsConnectedvalue.
P:IoT.Driver.S7PlcRx.IRxS7.IsConnectedValue
public bool IsConnectedValue { get; }
Gets a value indicating whether the connection is currently established.
- Value: The
IsConnectedValuevalue.
P:IoT.Driver.S7PlcRx.IRxS7.IsPaused
public System.IObservable<bool> IsPaused { get; }
Gets an observable sequence that indicates whether the operation is currently paused.
- Value: The
IsPausedvalue.
P:IoT.Driver.S7PlcRx.IRxS7.LastError
public System.IObservable<string> LastError { get; }
Gets an observable sequence that provides error messages encountered during operation.
- Value: The
LastErrorvalue.
P:IoT.Driver.S7PlcRx.IRxS7.LastErrorCode
public System.IObservable<IoT.Driver.S7PlcRx.Enums.ErrorCode> LastErrorCode { get; }
Gets an observable sequence of the most recent error codes.
- Value: The
LastErrorCodevalue.
P:IoT.Driver.S7PlcRx.IRxS7.ObserveAll
public System.IObservable<IoT.Driver.S7PlcRx.Tag> ObserveAll { get; }
Gets an observable sequence that emits all tag updates as they occur.
- Value: The
ObserveAllvalue.
P:IoT.Driver.S7PlcRx.IRxS7.PLCType
public IoT.Driver.S7PlcRx.Enums.CpuType PLCType { get; }
Gets the type of programmable logic controller (PLC) associated with this instance.
- Value: The
PLCTypevalue.
P:IoT.Driver.S7PlcRx.IRxS7.Rack
public short Rack { get; }
Gets the rack number associated with the device or connection.
- Value: The
Rackvalue.
P:IoT.Driver.S7PlcRx.IRxS7.ReadTime
public System.IObservable<long> ReadTime { get; }
Gets an observable sequence that provides the current read time in ticks.
- Value: The
ReadTimevalue.
P:IoT.Driver.S7PlcRx.IRxS7.ShowWatchDogWriting
public bool ShowWatchDogWriting { get; set; }
Gets or sets a value indicating whether WatchDog writing operations are displayed.
- Value: The
ShowWatchDogWritingvalue.
P:IoT.Driver.S7PlcRx.IRxS7.Slot
public short Slot { get; }
Gets the slot number associated with the current instance.
- Value: The
Slotvalue.
P:IoT.Driver.S7PlcRx.IRxS7.Status
public System.IObservable<string> Status { get; }
Gets an observable sequence that provides status updates as strings.
- Value: The
Statusvalue.
P:IoT.Driver.S7PlcRx.IRxS7.TagList
public IoT.Driver.S7PlcRx.Tags TagList { get; }
Gets the collection of tags associated with the current instance.
- Value: The
TagListvalue.
P:IoT.Driver.S7PlcRx.IRxS7.WatchDogAddress
public string WatchDogAddress { get; }
Gets the network address of the WatchDog service, if configured.
- Value: The
WatchDogAddressvalue.
P:IoT.Driver.S7PlcRx.IRxS7.WatchDogValueToWrite
public ushort WatchDogValueToWrite { get; set; }
Gets or sets the value to be written to the watchdog register.
- Value: The
WatchDogValueToWritevalue.
P:IoT.Driver.S7PlcRx.IRxS7.WatchDogWritingTime
public int WatchDogWritingTime { get; }
Gets the time interval, in milliseconds, used by the watchdog for writing operations.
- Value: The
WatchDogWritingTimevalue.
T:IoT.Driver.S7PlcRx.ITag
public interface IoT.Driver.S7PlcRx.ITag
Represents a tag that can be configured to control polling behavior.
Declared public members
M:IoT.Driver.S7PlcRx.ITag.SetDoNotPoll(System.Boolean)
public void SetDoNotPoll(bool value)
Sets whether the object should be excluded from polling operations.
- Parameter
value: true to prevent the object from being polled; otherwise, false.
T:IoT.Driver.S7PlcRx.LogicalTags.S7LogicalTagClient
public class IoT.Driver.S7PlcRx.LogicalTags.S7LogicalTagClient
Composes an S7 connection with the common logical-tag catalog, persistence, and client contracts.
Declared public members
M:IoT.Driver.S7PlcRx.LogicalTags.S7LogicalTagClient.#ctor(IoT.Driver.S7PlcRx.IRxS7,IoT.Driver.Core.ILogicalTagCatalog)
public IoT.Driver.S7PlcRx.LogicalTags.S7LogicalTagClient(IoT.Driver.S7PlcRx.IRxS7 plc, IoT.Driver.Core.ILogicalTagCatalog catalog)
Initializes a new instance of the T:IoT.Driver.S7PlcRx.LogicalTags.S7LogicalTagClient class.
- Parameter
plc: The S7 connection. - Parameter
catalog: The common logical-tag catalog.
M:IoT.Driver.S7PlcRx.LogicalTags.S7LogicalTagClient.#ctor(IoT.Driver.S7PlcRx.IRxS7,IoT.Driver.Core.ILogicalTagCatalog,IoT.Driver.Core.LogicalTagSqliteStore)
public IoT.Driver.S7PlcRx.LogicalTags.S7LogicalTagClient(IoT.Driver.S7PlcRx.IRxS7 plc, IoT.Driver.Core.ILogicalTagCatalog catalog, IoT.Driver.Core.LogicalTagSqliteStore store)
Initializes a new instance of the T:IoT.Driver.S7PlcRx.LogicalTags.S7LogicalTagClient class.
- Parameter
plc: The S7 connection. - Parameter
catalog: The common logical-tag catalog. - Parameter
store: The SQLite store used by persistence forwarding methods, or .
M:IoT.Driver.S7PlcRx.LogicalTags.S7LogicalTagClient.#ctor(IoT.Driver.S7PlcRx.IRxS7,IoT.Driver.Core.ILogicalTagCatalog,IoT.Driver.Core.LogicalTagSqliteStore,System.TimeProvider)
public IoT.Driver.S7PlcRx.LogicalTags.S7LogicalTagClient(IoT.Driver.S7PlcRx.IRxS7 plc, IoT.Driver.Core.ILogicalTagCatalog catalog, IoT.Driver.Core.LogicalTagSqliteStore store, System.TimeProvider timeProvider)
Initializes a new instance of the T:IoT.Driver.S7PlcRx.LogicalTags.S7LogicalTagClient class.
- Parameter
plc: The S7 connection. - Parameter
catalog: The common logical-tag catalog. - Parameter
store: The SQLite store used by persistence forwarding methods, or . - Parameter
timeProvider: The time provider.
M:IoT.Driver.S7PlcRx.LogicalTags.S7LogicalTagClient.#ctor(IoT.Driver.S7PlcRx.IRxS7,IoT.Driver.Core.ILogicalTagCatalog,System.TimeProvider)
public IoT.Driver.S7PlcRx.LogicalTags.S7LogicalTagClient(IoT.Driver.S7PlcRx.IRxS7 plc, IoT.Driver.Core.ILogicalTagCatalog catalog, System.TimeProvider timeProvider)
Initializes a new instance of the T:IoT.Driver.S7PlcRx.LogicalTags.S7LogicalTagClient class.
- Parameter
plc: The S7 connection. - Parameter
catalog: The common logical-tag catalog. - Parameter
timeProvider: The time provider.
M:IoT.Driver.S7PlcRx.LogicalTags.S7LogicalTagClient.CreateTag(IoT.Driver.Core.LogicalTag)
public IoT.Driver.Core.LogicalTag CreateTag(IoT.Driver.Core.LogicalTag tag)
Registers and returns an S7 logical tag.
- Parameter
tag: The logical tag to register. - Returns: The registered logical tag.
M:IoT.Driver.S7PlcRx.LogicalTags.S7LogicalTagClient.DeleteGroupAsync(System.String)
public System.Threading.Tasks.Task<bool> DeleteGroupAsync(string name)
Deletes a persisted logical group.
- Parameter
name: The logical group name. - Returns: True when the group was deleted.
M:IoT.Driver.S7PlcRx.LogicalTags.S7LogicalTagClient.DeleteGroupAsync(System.String,System.Threading.CancellationToken)
public System.Threading.Tasks.Task<bool> DeleteGroupAsync(string name, System.Threading.CancellationToken cancellationToken)
Deletes a persisted logical group.
- Parameter
name: The logical group name. - Parameter
cancellationToken: The cancellation token. - Returns: True when the group was deleted.
M:IoT.Driver.S7PlcRx.LogicalTags.S7LogicalTagClient.DeleteTagAsync(System.String)
public System.Threading.Tasks.Task<bool> DeleteTagAsync(string name)
Deletes a persisted tag and removes it from the live catalog when successful.
- Parameter
name: The logical tag name. - Returns: True when the tag was deleted.
M:IoT.Driver.S7PlcRx.LogicalTags.S7LogicalTagClient.DeleteTagAsync(System.String,System.Threading.CancellationToken)
public System.Threading.Tasks.Task<bool> DeleteTagAsync(string name, System.Threading.CancellationToken cancellationToken)
Deletes a persisted tag and removes it from the live catalog when successful.
- Parameter
name: The logical tag name. - Parameter
cancellationToken: The cancellation token. - Returns: True when the tag was deleted.
M:IoT.Driver.S7PlcRx.LogicalTags.S7LogicalTagClient.Dispose
public void Dispose()
Inherits XML documentation from its implemented or overridden member.
M:IoT.Driver.S7PlcRx.LogicalTags.S7LogicalTagClient.EditTagAsync(IoT.Driver.Core.LogicalTag)
public System.Threading.Tasks.Task<bool> EditTagAsync(IoT.Driver.Core.LogicalTag tag)
Edits an existing persisted logical tag and updates the live catalog when successful.
- Parameter
tag: The logical tag. - Returns: True when the tag was updated.
M:IoT.Driver.S7PlcRx.LogicalTags.S7LogicalTagClient.EditTagAsync(IoT.Driver.Core.LogicalTag,System.Threading.CancellationToken)
public System.Threading.Tasks.Task<bool> EditTagAsync(IoT.Driver.Core.LogicalTag tag, System.Threading.CancellationToken cancellationToken)
Edits an existing persisted logical tag and updates the live catalog when successful.
- Parameter
tag: The logical tag. - Parameter
cancellationToken: The cancellation token. - Returns: True when the tag was updated.
M:IoT.Driver.S7PlcRx.LogicalTags.S7LogicalTagClient.ExportCsvAsync(System.IO.TextWriter)
public System.Threading.Tasks.Task ExportCsvAsync(System.IO.TextWriter writer)
Exports the catalog using the common RFC 4180 CSV representation.
- Parameter
writer: The CSV writer. - Returns: A task that represents the export operation.
M:IoT.Driver.S7PlcRx.LogicalTags.S7LogicalTagClient.ExportCsvAsync(System.IO.TextWriter,System.Char)
public System.Threading.Tasks.Task ExportCsvAsync(System.IO.TextWriter writer, char delimiter)
Exports the catalog using the common CSV representation.
- Parameter
writer: The CSV writer. - Parameter
delimiter: The CSV delimiter. - Returns: A task that represents the export operation.
M:IoT.Driver.S7PlcRx.LogicalTags.S7LogicalTagClient.ExportCsvAsync(System.IO.TextWriter,System.Char,System.Threading.CancellationToken)
public System.Threading.Tasks.Task ExportCsvAsync(System.IO.TextWriter writer, char delimiter, System.Threading.CancellationToken cancellationToken)
Exports the catalog using the common CSV representation.
- Parameter
writer: The CSV writer. - Parameter
delimiter: The CSV delimiter. - Parameter
cancellationToken: The cancellation token. - Returns: A task that represents the export operation.
M:IoT.Driver.S7PlcRx.LogicalTags.S7LogicalTagClient.GetGroupAsync(System.String)
public System.Threading.Tasks.Task<IoT.Driver.Core.LogicalTagGroup> GetGroupAsync(string name)
Gets a persisted logical group.
- Parameter
name: The logical group name. - Returns: The persisted logical group, if found.
M:IoT.Driver.S7PlcRx.LogicalTags.S7LogicalTagClient.GetGroupAsync(System.String,System.Threading.CancellationToken)
public System.Threading.Tasks.Task<IoT.Driver.Core.LogicalTagGroup> GetGroupAsync(string name, System.Threading.CancellationToken cancellationToken)
Gets a persisted logical group.
- Parameter
name: The logical group name. - Parameter
cancellationToken: The cancellation token. - Returns: The persisted logical group, if found.
M:IoT.Driver.S7PlcRx.LogicalTags.S7LogicalTagClient.GetTagAsync(System.String)
public System.Threading.Tasks.Task<IoT.Driver.Core.LogicalTag> GetTagAsync(string name)
Gets a persisted logical tag.
- Parameter
name: The logical tag name. - Returns: The persisted logical tag, if found.
M:IoT.Driver.S7PlcRx.LogicalTags.S7LogicalTagClient.GetTagAsync(System.String,System.Threading.CancellationToken)
public System.Threading.Tasks.Task<IoT.Driver.Core.LogicalTag> GetTagAsync(string name, System.Threading.CancellationToken cancellationToken)
Gets a persisted logical tag.
- Parameter
name: The logical tag name. - Parameter
cancellationToken: The cancellation token. - Returns: The persisted logical tag, if found.
M:IoT.Driver.S7PlcRx.LogicalTags.S7LogicalTagClient.ImportCsvAsync(System.IO.TextReader)
public System.Threading.Tasks.Task<System.Collections.Generic.IReadOnlyList<IoT.Driver.Core.LogicalTag>> ImportCsvAsync(System.IO.TextReader reader)
Imports RFC 4180 common-tag CSV and dynamically upserts every definition.
- Parameter
reader: The CSV reader. - Returns: The imported logical tags.
M:IoT.Driver.S7PlcRx.LogicalTags.S7LogicalTagClient.ImportCsvAsync(System.IO.TextReader,System.Char)
public System.Threading.Tasks.Task<System.Collections.Generic.IReadOnlyList<IoT.Driver.Core.LogicalTag>> ImportCsvAsync(System.IO.TextReader reader, char delimiter)
Imports common-tag CSV and dynamically upserts every definition.
- Parameter
reader: The CSV reader. - Parameter
delimiter: The CSV delimiter. - Returns: The imported logical tags.
M:IoT.Driver.S7PlcRx.LogicalTags.S7LogicalTagClient.ImportCsvAsync(System.IO.TextReader,System.Char,System.Threading.CancellationToken)
public System.Threading.Tasks.Task<System.Collections.Generic.IReadOnlyList<IoT.Driver.Core.LogicalTag>> ImportCsvAsync(System.IO.TextReader reader, char delimiter, System.Threading.CancellationToken cancellationToken)
Imports common-tag CSV and dynamically upserts every definition.
- Parameter
reader: The CSV reader. - Parameter
delimiter: The CSV delimiter. - Parameter
cancellationToken: The cancellation token. - Returns: The imported logical tags.
M:IoT.Driver.S7PlcRx.LogicalTags.S7LogicalTagClient.InitializeStoreAsync(IoT.Driver.Core.LogicalTagSqliteStore)
public System.Threading.Tasks.Task InitializeStoreAsync(IoT.Driver.Core.LogicalTagSqliteStore store)
Assigns and initializes the SQLite store used by this client.
- Parameter
store: The SQLite store. - Returns: A task that represents the initialization operation.
M:IoT.Driver.S7PlcRx.LogicalTags.S7LogicalTagClient.InitializeStoreAsync(IoT.Driver.Core.LogicalTagSqliteStore,System.Threading.CancellationToken)
public System.Threading.Tasks.Task InitializeStoreAsync(IoT.Driver.Core.LogicalTagSqliteStore store, System.Threading.CancellationToken cancellationToken)
Assigns and initializes the SQLite store used by this client.
- Parameter
store: The SQLite store. - Parameter
cancellationToken: The cancellation token. - Returns: A task that represents the initialization operation.
M:IoT.Driver.S7PlcRx.LogicalTags.S7LogicalTagClient.InitializeStoreAsync(System.Threading.CancellationToken)
public System.Threading.Tasks.Task InitializeStoreAsync(System.Threading.CancellationToken cancellationToken)
Inherits XML documentation from its implemented or overridden member.
- Parameter
cancellationToken: ThecancellationTokenvalue. - Returns: A
System.Threading.Tasks.Taskresult.
M:IoT.Driver.S7PlcRx.LogicalTags.S7LogicalTagClient.ListGroupsAsync
public System.Threading.Tasks.Task<System.Collections.Generic.IReadOnlyList<IoT.Driver.Core.LogicalTagGroup>> ListGroupsAsync()
Lists persisted logical groups.
- Returns: The persisted logical groups.
M:IoT.Driver.S7PlcRx.LogicalTags.S7LogicalTagClient.ListGroupsAsync(System.Threading.CancellationToken)
public System.Threading.Tasks.Task<System.Collections.Generic.IReadOnlyList<IoT.Driver.Core.LogicalTagGroup>> ListGroupsAsync(System.Threading.CancellationToken cancellationToken)
Lists persisted logical groups.
- Parameter
cancellationToken: The cancellation token. - Returns: The persisted logical groups.
M:IoT.Driver.S7PlcRx.LogicalTags.S7LogicalTagClient.ListTagsAsync
public System.Threading.Tasks.Task<System.Collections.Generic.IReadOnlyList<IoT.Driver.Core.LogicalTag>> ListTagsAsync()
Lists persisted logical tags.
- Returns: The persisted logical tags.
M:IoT.Driver.S7PlcRx.LogicalTags.S7LogicalTagClient.ListTagsAsync(System.Threading.CancellationToken)
public System.Threading.Tasks.Task<System.Collections.Generic.IReadOnlyList<IoT.Driver.Core.LogicalTag>> ListTagsAsync(System.Threading.CancellationToken cancellationToken)
Lists persisted logical tags.
- Parameter
cancellationToken: The cancellation token. - Returns: The persisted logical tags.
M:IoT.Driver.S7PlcRx.LogicalTags.S7LogicalTagClient.LoadTagsAsync
public System.Threading.Tasks.Task<System.Collections.Generic.IReadOnlyList<IoT.Driver.Core.LogicalTag>> LoadTagsAsync()
Loads every SQLite tag into the live catalog.
- Returns: The loaded logical tags.
M:IoT.Driver.S7PlcRx.LogicalTags.S7LogicalTagClient.LoadTagsAsync(System.Threading.CancellationToken)
public System.Threading.Tasks.Task<System.Collections.Generic.IReadOnlyList<IoT.Driver.Core.LogicalTag>> LoadTagsAsync(System.Threading.CancellationToken cancellationToken)
Loads every SQLite tag into the live catalog.
- Parameter
cancellationToken: The cancellation token. - Returns: The loaded logical tags.
M:IoT.Driver.S7PlcRx.LogicalTags.S7LogicalTagClient.Observe(System.String)
public System.IObservable<IoT.Driver.Core.LogicalTagValue> Observe(string tagName)
Inherits XML documentation from its implemented or overridden member.
- Parameter
tagName: ThetagNamevalue. - Returns: A
System.IObservable<IoT.Driver.Core.LogicalTagValue>result.
M:IoT.Driver.S7PlcRx.LogicalTags.S7LogicalTagClient.ObserveAsync(System.String,System.Threading.CancellationToken)
public System.Collections.Generic.IAsyncEnumerable<IoT.Driver.Core.LogicalTagValue> ObserveAsync(string tagName, System.Threading.CancellationToken cancellationToken)
Inherits XML documentation from its implemented or overridden member.
- Parameter
tagName: ThetagNamevalue. - Parameter
cancellationToken: ThecancellationTokenvalue. - Returns: A
System.Collections.Generic.IAsyncEnumerable<IoT.Driver.Core.LogicalTagValue>result.
M:IoT.Driver.S7PlcRx.LogicalTags.S7LogicalTagClient.ObserveMany(System.Collections.Generic.IReadOnlyCollection1{System.String})`
public System.IObservable<IoT.Driver.Core.LogicalTagValue> ObserveMany(System.Collections.Generic.IReadOnlyCollection<string> tagNames)
Executes the ObserveMany operation.
- Parameter
tagNames: ThetagNamesvalue. - Returns: A
System.IObservable<IoT.Driver.Core.LogicalTagValue>result.
M:IoT.Driver.S7PlcRx.LogicalTags.S7LogicalTagClient.ObserveManyAsync(System.Collections.Generic.IReadOnlyCollection1{System.String},System.Threading.CancellationToken)`
public System.Collections.Generic.IAsyncEnumerable<IoT.Driver.Core.LogicalTagValue> ObserveManyAsync(System.Collections.Generic.IReadOnlyCollection<string> tagNames, System.Threading.CancellationToken cancellationToken)
Executes the ObserveManyAsync operation.
- Parameter
tagNames: ThetagNamesvalue. - Parameter
cancellationToken: ThecancellationTokenvalue. - Returns: A
System.Collections.Generic.IAsyncEnumerable<IoT.Driver.Core.LogicalTagValue>result.
M:IoT.Driver.S7PlcRx.LogicalTags.S7LogicalTagClient.ReadAsync(System.String,System.Threading.CancellationToken)
public System.Threading.Tasks.Task<IoT.Driver.Core.TagOperationResult<IoT.Driver.Core.LogicalTagValue>> ReadAsync(string tagName, System.Threading.CancellationToken cancellationToken)
Inherits XML documentation from its implemented or overridden member.
- Parameter
tagName: ThetagNamevalue. - Parameter
cancellationToken: ThecancellationTokenvalue. - Returns: A
System.Threading.Tasks.Task<IoT.Driver.Core.TagOperationResult<IoT.Driver.Core.LogicalTagValue>>result.
M:IoT.Driver.S7PlcRx.LogicalTags.S7LogicalTagClient.ReadManyAsync(System.Collections.Generic.IReadOnlyCollection1{System.String},System.Threading.CancellationToken)`
public System.Threading.Tasks.Task<System.Collections.Generic.IReadOnlyList<IoT.Driver.Core.TagOperationResult<IoT.Driver.Core.LogicalTagValue>>> ReadManyAsync(System.Collections.Generic.IReadOnlyCollection<string> tagNames, System.Threading.CancellationToken cancellationToken)
Executes the ReadManyAsync operation.
- Parameter
tagNames: ThetagNamesvalue. - Parameter
cancellationToken: ThecancellationTokenvalue. - Returns: A
System.Threading.Tasks.Task<System.Collections.Generic.IReadOnlyList<IoT.Driver.Core.TagOperationResult<IoT.Driver.Core.LogicalTagValue>>>result.
M:IoT.Driver.S7PlcRx.LogicalTags.S7LogicalTagClient.RegisterTag(IoT.Driver.Core.LogicalTag)
public void RegisterTag(IoT.Driver.Core.LogicalTag tag)
Adds or replaces a logical definition and registers it with the S7 connection.
- Parameter
tag: The logical tag.
M:IoT.Driver.S7PlcRx.LogicalTags.S7LogicalTagClient.RemoveTag(System.String)
public bool RemoveTag(string name)
Removes a logical definition and its S7 registration.
- Parameter
name: The logical tag name. - Returns: True when the tag existed.
M:IoT.Driver.S7PlcRx.LogicalTags.S7LogicalTagClient.UpdateTagAsync(IoT.Driver.Core.LogicalTag)
public System.Threading.Tasks.Task<bool> UpdateTagAsync(IoT.Driver.Core.LogicalTag tag)
Alias for M:IoT.Driver.S7PlcRx.LogicalTags.S7LogicalTagClient.EditTagAsync(IoT.Driver.Core.LogicalTag) .
- Parameter
tag: The logical tag. - Returns: True when the tag was updated.
M:IoT.Driver.S7PlcRx.LogicalTags.S7LogicalTagClient.UpdateTagAsync(IoT.Driver.Core.LogicalTag,System.Threading.CancellationToken)
public System.Threading.Tasks.Task<bool> UpdateTagAsync(IoT.Driver.Core.LogicalTag tag, System.Threading.CancellationToken cancellationToken)
Alias for M:IoT.Driver.S7PlcRx.LogicalTags.S7LogicalTagClient.EditTagAsync(IoT.Driver.Core.LogicalTag,System.Threading.CancellationToken) .
- Parameter
tag: The logical tag. - Parameter
cancellationToken: The cancellation token. - Returns: True when the tag was updated.
M:IoT.Driver.S7PlcRx.LogicalTags.S7LogicalTagClient.UpsertGroupAsync(IoT.Driver.Core.LogicalTagGroup)
public System.Threading.Tasks.Task UpsertGroupAsync(IoT.Driver.Core.LogicalTagGroup group)
Persists a logical group.
- Parameter
group: The logical group. - Returns: A task that represents the persistence operation.
M:IoT.Driver.S7PlcRx.LogicalTags.S7LogicalTagClient.UpsertGroupAsync(IoT.Driver.Core.LogicalTagGroup,System.Threading.CancellationToken)
public System.Threading.Tasks.Task UpsertGroupAsync(IoT.Driver.Core.LogicalTagGroup group, System.Threading.CancellationToken cancellationToken)
Persists a logical group.
- Parameter
group: The logical group. - Parameter
cancellationToken: The cancellation token. - Returns: A task that represents the persistence operation.
M:IoT.Driver.S7PlcRx.LogicalTags.S7LogicalTagClient.UpsertTagAsync(IoT.Driver.Core.LogicalTag)
public System.Threading.Tasks.Task UpsertTagAsync(IoT.Driver.Core.LogicalTag tag)
Persists and dynamically registers a logical tag.
- Parameter
tag: The logical tag. - Returns: A task that represents the persistence operation.
M:IoT.Driver.S7PlcRx.LogicalTags.S7LogicalTagClient.UpsertTagAsync(IoT.Driver.Core.LogicalTag,System.Threading.CancellationToken)
public System.Threading.Tasks.Task UpsertTagAsync(IoT.Driver.Core.LogicalTag tag, System.Threading.CancellationToken cancellationToken)
Persists and dynamically registers a logical tag.
- Parameter
tag: The logical tag. - Parameter
cancellationToken: The cancellation token. - Returns: A task that represents the persistence operation.
M:IoT.Driver.S7PlcRx.LogicalTags.S7LogicalTagClient.WriteAsync(IoT.Driver.Core.LogicalTagValue,System.Threading.CancellationToken)
public System.Threading.Tasks.Task<IoT.Driver.Core.TagOperationResult<IoT.Driver.Core.LogicalTagValue>> WriteAsync(IoT.Driver.Core.LogicalTagValue value, System.Threading.CancellationToken cancellationToken)
Inherits XML documentation from its implemented or overridden member.
- Parameter
value: Thevaluevalue. - Parameter
cancellationToken: ThecancellationTokenvalue. - Returns: A
System.Threading.Tasks.Task<IoT.Driver.Core.TagOperationResult<IoT.Driver.Core.LogicalTagValue>>result.
M:IoT.Driver.S7PlcRx.LogicalTags.S7LogicalTagClient.WriteManyAsync(System.Collections.Generic.IReadOnlyCollection1{IoT.Driver.Core.LogicalTagValue},System.Threading.CancellationToken)`
public System.Threading.Tasks.Task<System.Collections.Generic.IReadOnlyList<IoT.Driver.Core.TagOperationResult<IoT.Driver.Core.LogicalTagValue>>> WriteManyAsync(System.Collections.Generic.IReadOnlyCollection<IoT.Driver.Core.LogicalTagValue> values, System.Threading.CancellationToken cancellationToken)
Executes the WriteManyAsync operation.
- Parameter
values: Thevaluesvalue. - Parameter
cancellationToken: ThecancellationTokenvalue. - Returns: A
System.Threading.Tasks.Task<System.Collections.Generic.IReadOnlyList<IoT.Driver.Core.TagOperationResult<IoT.Driver.Core.LogicalTagValue>>>result.
P:IoT.Driver.S7PlcRx.LogicalTags.S7LogicalTagClient.Catalog
public IoT.Driver.Core.ILogicalTagCatalog Catalog { get; }
Gets the mutable logical-tag catalog observed by this client.
- Value: The
Catalogvalue.
T:IoT.Driver.S7PlcRx.LogicalTags.S7LogicalTagExtensions
public class IoT.Driver.S7PlcRx.LogicalTags.S7LogicalTagExtensions
Creates common logical clients and typed operation-result projections for S7 callers.
Declared public members
M:IoT.Driver.S7PlcRx.LogicalTags.S7LogicalTagExtensions.CreateLogicalTagCatalog(System.Collections.Generic.IEnumerable1{IoT.Driver.S7PlcRx.Binding.S7TagDefinition})`
public static IoT.Driver.Core.LogicalTagCatalog CreateLogicalTagCatalog(System.Collections.Generic.IEnumerable<IoT.Driver.S7PlcRx.Binding.S7TagDefinition> definitions)
Executes the CreateLogicalTagCatalog operation.
- Parameter
definitions: Thedefinitionsvalue. - Returns: A
IoT.Driver.Core.LogicalTagCatalogresult.
M:IoT.Driver.S7PlcRx.LogicalTags.S7LogicalTagExtensions.CreateLogicalTagClient(IoT.Driver.S7PlcRx.IRxS7,IoT.Driver.Core.ILogicalTagCatalog)
public static IoT.Driver.S7PlcRx.LogicalTags.S7LogicalTagClient CreateLogicalTagClient(IoT.Driver.S7PlcRx.IRxS7 plc, IoT.Driver.Core.ILogicalTagCatalog catalog)
Creates a dynamically synchronized logical client.
- Parameter
plc: The S7 connection. - Parameter
catalog: The logical-tag catalog. - Returns: The dynamically synchronized logical client.
M:IoT.Driver.S7PlcRx.LogicalTags.S7LogicalTagExtensions.CreateLogicalTagClient(IoT.Driver.S7PlcRx.IRxS7,IoT.Driver.Core.ILogicalTagCatalog,IoT.Driver.Core.LogicalTagSqliteStore)
public static IoT.Driver.S7PlcRx.LogicalTags.S7LogicalTagClient CreateLogicalTagClient(IoT.Driver.S7PlcRx.IRxS7 plc, IoT.Driver.Core.ILogicalTagCatalog catalog, IoT.Driver.Core.LogicalTagSqliteStore store)
Creates a dynamically synchronized logical client with persistence.
- Parameter
plc: The S7 connection. - Parameter
catalog: The logical-tag catalog. - Parameter
store: The SQLite store. - Returns: The dynamically synchronized logical client.
M:IoT.Driver.S7PlcRx.LogicalTags.S7LogicalTagExtensions.ReadAsync``1(IoT.Driver.Core.ILogicalTagClient,System.String,``0)
public static System.Threading.Tasks.Task<IoT.Driver.Core.TagOperationResult<T>> ReadAsync<T>(IoT.Driver.Core.ILogicalTagClient client, string tagName, T type)
Reads and converts a common logical result to the requested payload type.
- Parameter
client: The logical-tag client. - Parameter
tagName: The logical tag name. - Parameter
type: A value that supplies the requested payload type. - Returns: The typed tag operation result.
M:IoT.Driver.S7PlcRx.LogicalTags.S7LogicalTagExtensions.ReadAsync``1(IoT.Driver.Core.ILogicalTagClient,System.String,``0,System.Threading.CancellationToken)
public static System.Threading.Tasks.Task<IoT.Driver.Core.TagOperationResult<T>> ReadAsync<T>(IoT.Driver.Core.ILogicalTagClient client, string tagName, T type, System.Threading.CancellationToken cancellationToken)
Reads and converts a common logical result to the requested payload type.
- Parameter
client: The logical-tag client. - Parameter
tagName: The logical tag name. - Parameter
type: A value that supplies the requested payload type. - Parameter
cancellationToken: The cancellation token. - Returns: The typed tag operation result.
M:IoT.Driver.S7PlcRx.LogicalTags.S7LogicalTagExtensions.WriteAsync``1(IoT.Driver.Core.ILogicalTagClient,System.String,``0,System.Threading.CancellationToken)
public static System.Threading.Tasks.Task<IoT.Driver.Core.TagOperationResult<T>> WriteAsync<T>(IoT.Driver.Core.ILogicalTagClient client, string tagName, T value, System.Threading.CancellationToken cancellationToken)
Writes a typed common logical value and projects the result payload.
- Parameter
client: The logical-tag client. - Parameter
tagName: The logical tag name. - Parameter
value: The value to write. - Parameter
cancellationToken: The cancellation token. - Returns: The typed tag operation result.
M:IoT.Driver.S7PlcRx.LogicalTags.S7LogicalTagExtensions.WriteAsync``1(IoT.Driver.Core.ILogicalTagClient,System.String,``0,System.TimeProvider,System.Threading.CancellationToken)
public static System.Threading.Tasks.Task<IoT.Driver.Core.TagOperationResult<T>> WriteAsync<T>(IoT.Driver.Core.ILogicalTagClient client, string tagName, T value, System.TimeProvider timeProvider, System.Threading.CancellationToken cancellationToken)
Writes a typed common logical value and projects the result payload.
- Parameter
client: The logical-tag client. - Parameter
tagName: The logical tag name. - Parameter
value: The value to write. - Parameter
timeProvider: The time provider. - Parameter
cancellationToken: The cancellation token. - Returns: The typed tag operation result.
T:IoT.Driver.S7PlcRx.Optimization.OptimizationExtensions
public class IoT.Driver.S7PlcRx.Optimization.OptimizationExtensions
Provides extension methods for IRxS7 to enable optimized tag monitoring, intelligent value caching, and cache management for PLC data access.
Declared public members
M:IoT.Driver.S7PlcRx.Optimization.OptimizationExtensions.ClearCache(IoT.Driver.S7PlcRx.IRxS7)
public static void ClearCache(IoT.Driver.S7PlcRx.IRxS7 plc)
Clears all cached values for the specified PLC instance.
- Parameter
plc: The PLC instance.
M:IoT.Driver.S7PlcRx.Optimization.OptimizationExtensions.ClearCache(IoT.Driver.S7PlcRx.IRxS7,System.String)
public static void ClearCache(IoT.Driver.S7PlcRx.IRxS7 plc, string tagName)
Clears a cached value for the specified PLC tag.
- Parameter
plc: The PLC instance. - Parameter
tagName: The name of the tag to clear from the cache.
M:IoT.Driver.S7PlcRx.Optimization.OptimizationExtensions.GetCacheStatistics(IoT.Driver.S7PlcRx.IRxS7)
public static IoT.Driver.S7PlcRx.Cache.CacheStatistics GetCacheStatistics(IoT.Driver.S7PlcRx.IRxS7 plc)
Retrieves cache usage statistics for the specified PLC instance.
- Parameter
plc: The PLC instance. - Returns: A CacheStatistics object containing aggregated cache metrics for the specified PLC.
M:IoT.Driver.S7PlcRx.Optimization.OptimizationExtensions.GetCacheStatistics(IoT.Driver.S7PlcRx.IRxS7,System.TimeProvider)
public static IoT.Driver.S7PlcRx.Cache.CacheStatistics GetCacheStatistics(IoT.Driver.S7PlcRx.IRxS7 plc, System.TimeProvider timeProvider)
Retrieves cache usage statistics for the specified PLC instance.
- Parameter
plc: The PLC instance. - Parameter
timeProvider: The time provider. - Returns: A CacheStatistics object containing aggregated cache metrics for the specified PLC.
M:IoT.Driver.S7PlcRx.Optimization.OptimizationExtensions.MonitorTagSmart``1(IoT.Driver.S7PlcRx.IRxS7,System.String,System.Collections.Generic.IEqualityComparer1{``0},System.Double,System.Int32)`
public static System.IObservable<IoT.Driver.S7PlcRx.Optimization.SmartTagChange<T>> MonitorTagSmart<T>(IoT.Driver.S7PlcRx.IRxS7 plc, string tagName, System.Collections.Generic.IEqualityComparer<T> comparer, double changeThreshold, int debounceMs)
Executes the MonitorTagSmart operation.
- Parameter
plc: Theplcvalue. - Parameter
tagName: ThetagNamevalue. - Parameter
comparer: Thecomparervalue. - Parameter
changeThreshold: ThechangeThresholdvalue. - Parameter
debounceMs: ThedebounceMsvalue. - Returns: A
System.IObservable<IoT.Driver.S7PlcRx.Optimization.SmartTagChange<T>>result.
M:IoT.Driver.S7PlcRx.Optimization.OptimizationExtensions.MonitorTagSmart``1(IoT.Driver.S7PlcRx.IRxS7,System.String,System.Collections.Generic.IEqualityComparer1{``0},System.Double,System.Int32,System.TimeProvider)`
public static System.IObservable<IoT.Driver.S7PlcRx.Optimization.SmartTagChange<T>> MonitorTagSmart<T>(IoT.Driver.S7PlcRx.IRxS7 plc, string tagName, System.Collections.Generic.IEqualityComparer<T> comparer, double changeThreshold, int debounceMs, System.TimeProvider timeProvider)
Executes the MonitorTagSmart operation.
- Parameter
plc: Theplcvalue. - Parameter
tagName: ThetagNamevalue. - Parameter
comparer: Thecomparervalue. - Parameter
changeThreshold: ThechangeThresholdvalue. - Parameter
debounceMs: ThedebounceMsvalue. - Parameter
timeProvider: ThetimeProvidervalue. - Returns: A
System.IObservable<IoT.Driver.S7PlcRx.Optimization.SmartTagChange<T>>result.
M:IoT.Driver.S7PlcRx.Optimization.OptimizationExtensions.ValueCachedAsync``1(IoT.Driver.S7PlcRx.IRxS7,System.String,``0,System.TimeSpan)
public static System.Threading.Tasks.Task<T> ValueCachedAsync<T>(IoT.Driver.S7PlcRx.IRxS7 plc, string tagName, T fallbackValue, System.TimeSpan cacheTimeout)
Retrieves a PLC tag value, using a valid cached value when available.
- Parameter
plc: The PLC instance. - Parameter
tagName: The name of the PLC tag to read. - Parameter
fallbackValue: The value returned when the PLC does not provide a value. - Parameter
cacheTimeout: The maximum duration for which a cached value is considered valid. - Returns: A task that represents the asynchronous operation.
M:IoT.Driver.S7PlcRx.Optimization.OptimizationExtensions.ValueCachedAsync``1(IoT.Driver.S7PlcRx.IRxS7,System.String,``0,System.TimeSpan,System.TimeProvider)
public static System.Threading.Tasks.Task<T> ValueCachedAsync<T>(IoT.Driver.S7PlcRx.IRxS7 plc, string tagName, T fallbackValue, System.TimeSpan cacheTimeout, System.TimeProvider timeProvider)
Retrieves a PLC tag value, using a valid cached value when available.
- Parameter
plc: The PLC instance. - Parameter
tagName: The name of the PLC tag to read. - Parameter
fallbackValue: The value returned when the PLC does not provide a value. - Parameter
cacheTimeout: The maximum duration for which a cached value is considered valid. - Parameter
timeProvider: The time provider. - Returns: A task that represents the asynchronous operation.
T:IoT.Driver.S7PlcRx.Optimization.OptimizationRequestPriority
public enum IoT.Driver.S7PlcRx.Optimization.OptimizationRequestPriority
Specifies the priority level for an optimization request.
Declared public members
F:IoT.Driver.S7PlcRx.Optimization.OptimizationRequestPriority.Critical
public static const IoT.Driver.S7PlcRx.Optimization.OptimizationRequestPriority Critical
Critical priority.
F:IoT.Driver.S7PlcRx.Optimization.OptimizationRequestPriority.High
public static const IoT.Driver.S7PlcRx.Optimization.OptimizationRequestPriority High
High priority.
F:IoT.Driver.S7PlcRx.Optimization.OptimizationRequestPriority.Low
public static const IoT.Driver.S7PlcRx.Optimization.OptimizationRequestPriority Low
Low priority.
F:IoT.Driver.S7PlcRx.Optimization.OptimizationRequestPriority.Normal
public static const IoT.Driver.S7PlcRx.Optimization.OptimizationRequestPriority Normal
Normal priority.
T:IoT.Driver.S7PlcRx.Optimization.ReadOptimizationConfig
public class IoT.Driver.S7PlcRx.Optimization.ReadOptimizationConfig
Provides configuration options for optimizing read operations, including parallelism, delays, concurrency limits, and timeouts within data block groups.
Declared public members
M:IoT.Driver.S7PlcRx.Optimization.ReadOptimizationConfig.#ctor
public IoT.Driver.S7PlcRx.Optimization.ReadOptimizationConfig()
Initializes a new instance of IoT.Driver.S7PlcRx.Optimization.ReadOptimizationConfig.
P:IoT.Driver.S7PlcRx.Optimization.ReadOptimizationConfig.EnableParallelReads
public bool EnableParallelReads { get; set; }
Gets or sets whether parallel reads within data block groups are enabled.
- Value: The
EnableParallelReadsvalue.
P:IoT.Driver.S7PlcRx.Optimization.ReadOptimizationConfig.InterGroupDelayMs
public int InterGroupDelayMs { get; set; }
Gets or sets the delay between data block groups in milliseconds.
- Value: The
InterGroupDelayMsvalue.
P:IoT.Driver.S7PlcRx.Optimization.ReadOptimizationConfig.MaxConcurrentReads
public int MaxConcurrentReads { get; set; }
Gets or sets the maximum number of concurrent reads.
- Value: The
MaxConcurrentReadsvalue.
P:IoT.Driver.S7PlcRx.Optimization.ReadOptimizationConfig.ReadTimeoutMs
public int ReadTimeoutMs { get; set; }
Gets or sets the read timeout in milliseconds.
- Value: The
ReadTimeoutMsvalue.
T:IoT.Driver.S7PlcRx.Optimization.SmartTagChange1`
public class IoT.Driver.S7PlcRx.Optimization.SmartTagChange`1
Represents a change to a smart tag, including its name, previous and current values, the time of change, the amount of change for numeric types, and associated metadata.
Declared public members
M:IoT.Driver.S7PlcRx.Optimization.SmartTagChange1.#ctor`
public IoT.Driver.S7PlcRx.Optimization.SmartTagChange<T>()
Initializes a new instance of IoT.Driver.S7PlcRx.Optimization.SmartTagChange1`.
P:IoT.Driver.S7PlcRx.Optimization.SmartTagChange1.ChangeAmount`
public double ChangeAmount { get; set; }
Gets or sets the amount of change for numeric types.
- Value: The
ChangeAmountvalue.
P:IoT.Driver.S7PlcRx.Optimization.SmartTagChange1.ChangeTime`
public System.DateTimeOffset ChangeTime { get; set; }
Gets or sets the change timestamp.
- Value: The
ChangeTimevalue.
P:IoT.Driver.S7PlcRx.Optimization.SmartTagChange1.CurrentValue`
public T CurrentValue { get; set; }
Gets or sets the current value.
- Value: The
CurrentValuevalue.
P:IoT.Driver.S7PlcRx.Optimization.SmartTagChange1.Metadata`
public System.Collections.Generic.Dictionary<string, object> Metadata { get; }
Gets additional metadata about the change.
- Value: The
Metadatavalue.
P:IoT.Driver.S7PlcRx.Optimization.SmartTagChange1.PreviousValue`
public T PreviousValue { get; set; }
Gets or sets the previous value.
- Value: The
PreviousValuevalue.
P:IoT.Driver.S7PlcRx.Optimization.SmartTagChange1.TagName`
public string TagName { get; set; }
Gets or sets the tag name.
- Value: The
TagNamevalue.
T:IoT.Driver.S7PlcRx.Optimization.WriteOptimizationConfig
public class IoT.Driver.S7PlcRx.Optimization.WriteOptimizationConfig
Provides configuration options for optimizing write operations, including parallelism, verification, timing, and concurrency settings.
Declared public members
M:IoT.Driver.S7PlcRx.Optimization.WriteOptimizationConfig.#ctor
public IoT.Driver.S7PlcRx.Optimization.WriteOptimizationConfig()
Initializes a new instance of IoT.Driver.S7PlcRx.Optimization.WriteOptimizationConfig.
P:IoT.Driver.S7PlcRx.Optimization.WriteOptimizationConfig.EnableParallelWrites
public bool EnableParallelWrites { get; set; }
Gets or sets whether parallel writes within data block groups are enabled.
- Value: The
EnableParallelWritesvalue.
P:IoT.Driver.S7PlcRx.Optimization.WriteOptimizationConfig.InterGroupDelayMs
public int InterGroupDelayMs { get; set; }
Gets or sets the delay between data block groups in milliseconds.
- Value: The
InterGroupDelayMsvalue.
P:IoT.Driver.S7PlcRx.Optimization.WriteOptimizationConfig.MaxConcurrentWrites
public int MaxConcurrentWrites { get; set; }
Gets or sets the maximum number of concurrent writes.
- Value: The
MaxConcurrentWritesvalue.
P:IoT.Driver.S7PlcRx.Optimization.WriteOptimizationConfig.VerifyWrites
public bool VerifyWrites { get; set; }
Gets or sets a value indicating whether writes are verified by reading them back.
- Value: The
VerifyWritesvalue.
P:IoT.Driver.S7PlcRx.Optimization.WriteOptimizationConfig.WriteTimeoutMs
public int WriteTimeoutMs { get; set; }
Gets or sets the write timeout in milliseconds.
- Value: The
WriteTimeoutMsvalue.
T:IoT.Driver.S7PlcRx.Optimization.WriteOptimizationResult
public class IoT.Driver.S7PlcRx.Optimization.WriteOptimizationResult
Represents the result of a write optimization operation, including timing information, per-write outcomes, and overall error details.
Declared public members
M:IoT.Driver.S7PlcRx.Optimization.WriteOptimizationResult.#ctor
public IoT.Driver.S7PlcRx.Optimization.WriteOptimizationResult()
Initializes a new instance of IoT.Driver.S7PlcRx.Optimization.WriteOptimizationResult.
P:IoT.Driver.S7PlcRx.Optimization.WriteOptimizationResult.EndTime
public System.DateTimeOffset EndTime { get; set; }
Gets or sets the operation end time.
- Value: The
EndTimevalue.
P:IoT.Driver.S7PlcRx.Optimization.WriteOptimizationResult.FailedWrites
public System.Collections.Generic.Dictionary<string, string> FailedWrites { get; }
Gets failed writes with error messages.
- Value: The
FailedWritesvalue.
P:IoT.Driver.S7PlcRx.Optimization.WriteOptimizationResult.OverallError
public string OverallError { get; set; }
Gets or sets any overall error message.
- Value: The
OverallErrorvalue.
P:IoT.Driver.S7PlcRx.Optimization.WriteOptimizationResult.StartTime
public System.DateTimeOffset StartTime { get; set; }
Gets or sets the operation start time.
- Value: The
StartTimevalue.
P:IoT.Driver.S7PlcRx.Optimization.WriteOptimizationResult.SuccessRate
public double SuccessRate { get; }
Gets the success rate.
- Value: The
SuccessRatevalue.
P:IoT.Driver.S7PlcRx.Optimization.WriteOptimizationResult.SuccessfulWrites
public System.Collections.Generic.Dictionary<string, System.TimeSpan> SuccessfulWrites { get; }
Gets successful writes with their durations.
- Value: The
SuccessfulWritesvalue.
P:IoT.Driver.S7PlcRx.Optimization.WriteOptimizationResult.TotalDuration
public System.TimeSpan TotalDuration { get; }
Gets the total operation duration.
- Value: The
TotalDurationvalue.
T:IoT.Driver.S7PlcRx.Performance.BenchmarkConfig
public class IoT.Driver.S7PlcRx.Performance.BenchmarkConfig
Represents the configuration settings for benchmark tests, including parameters for latency, throughput, and reliability measurements.
Declared public members
M:IoT.Driver.S7PlcRx.Performance.BenchmarkConfig.#ctor
public IoT.Driver.S7PlcRx.Performance.BenchmarkConfig()
Initializes a new instance of IoT.Driver.S7PlcRx.Performance.BenchmarkConfig.
P:IoT.Driver.S7PlcRx.Performance.BenchmarkConfig.LatencyTestCount
public int LatencyTestCount { get; set; }
Gets or sets the number of latency tests to perform.
- Value: The
LatencyTestCountvalue.
P:IoT.Driver.S7PlcRx.Performance.BenchmarkConfig.ReliabilityTestCount
public int ReliabilityTestCount { get; set; }
Gets or sets the number of reliability tests to perform.
- Value: The
ReliabilityTestCountvalue.
P:IoT.Driver.S7PlcRx.Performance.BenchmarkConfig.ThroughputTestDuration
public System.TimeSpan ThroughputTestDuration { get; set; }
Gets or sets the duration for throughput testing.
- Value: The
ThroughputTestDurationvalue.
T:IoT.Driver.S7PlcRx.Performance.BenchmarkResult
public class IoT.Driver.S7PlcRx.Performance.BenchmarkResult
Represents the results of a performance benchmark, including timing, latency, throughput, reliability, and any errors encountered during execution.
Declared public members
M:IoT.Driver.S7PlcRx.Performance.BenchmarkResult.#ctor
public IoT.Driver.S7PlcRx.Performance.BenchmarkResult()
Initializes a new instance of IoT.Driver.S7PlcRx.Performance.BenchmarkResult.
P:IoT.Driver.S7PlcRx.Performance.BenchmarkResult.AverageLatencyMs
public double AverageLatencyMs { get; set; }
Gets or sets the average latency in milliseconds.
- Value: The
AverageLatencyMsvalue.
P:IoT.Driver.S7PlcRx.Performance.BenchmarkResult.EndTime
public System.DateTimeOffset EndTime { get; set; }
Gets or sets the benchmark end time.
- Value: The
EndTimevalue.
P:IoT.Driver.S7PlcRx.Performance.BenchmarkResult.Errors
public System.Collections.Generic.List<string> Errors { get; }
Gets any errors encountered during benchmarking.
- Value: The
Errorsvalue.
P:IoT.Driver.S7PlcRx.Performance.BenchmarkResult.MaxLatencyMs
public double MaxLatencyMs { get; set; }
Gets or sets the maximum latency in milliseconds.
- Value: The
MaxLatencyMsvalue.
P:IoT.Driver.S7PlcRx.Performance.BenchmarkResult.MinLatencyMs
public double MinLatencyMs { get; set; }
Gets or sets the minimum latency in milliseconds.
- Value: The
MinLatencyMsvalue.
P:IoT.Driver.S7PlcRx.Performance.BenchmarkResult.OperationsPerSecond
public double OperationsPerSecond { get; set; }
Gets or sets the operations per second.
- Value: The
OperationsPerSecondvalue.
P:IoT.Driver.S7PlcRx.Performance.BenchmarkResult.OverallScore
public double OverallScore { get; set; }
Gets or sets the overall benchmark score (0 to 100).
- Value: The
OverallScorevalue.
P:IoT.Driver.S7PlcRx.Performance.BenchmarkResult.PLCIdentifier
public string PLCIdentifier { get; set; }
Gets or sets the PLC identifier.
- Value: The
PLCIdentifiervalue.
P:IoT.Driver.S7PlcRx.Performance.BenchmarkResult.ReliabilityRate
public double ReliabilityRate { get; set; }
Gets or sets the reliability rate (0.0 to 1.0).
- Value: The
ReliabilityRatevalue.
P:IoT.Driver.S7PlcRx.Performance.BenchmarkResult.StartTime
public System.DateTimeOffset StartTime { get; set; }
Gets or sets the benchmark start time.
- Value: The
StartTimevalue.
P:IoT.Driver.S7PlcRx.Performance.BenchmarkResult.TotalDuration
public System.TimeSpan TotalDuration { get; }
Gets the total benchmark duration.
- Value: The
TotalDurationvalue.
T:IoT.Driver.S7PlcRx.Performance.HighPerformanceTagGroup1`
public class IoT.Driver.S7PlcRx.Performance.HighPerformanceTagGroup`1
Provides high-performance batch operations for a group of PLC tags.
Declared public members
M:IoT.Driver.S7PlcRx.Performance.HighPerformanceTagGroup1.#ctor(IoT.Driver.S7PlcRx.IRxS7,System.String,System.String[])`
public IoT.Driver.S7PlcRx.Performance.HighPerformanceTagGroup<T>(IoT.Driver.S7PlcRx.IRxS7 plc, string groupName, string[] tagNames)
Initializes a new instance of the T:IoT.Driver.S7PlcRx.Performance.HighPerformanceTagGroup1` class, associating a set of tag names with a specified. PLC for optimized group operations.
- Parameter
plc: The PLC connection used to manage and access the specified tags. - Parameter
groupName: The name assigned to this tag group. Cannot be null or whitespace. - Parameter
tagNames: An array of tag names to include in the group. Cannot be null or empty.
M:IoT.Driver.S7PlcRx.Performance.HighPerformanceTagGroup1.Dispose`
public void Dispose()
Disposes this tag group.
M:IoT.Driver.S7PlcRx.Performance.HighPerformanceTagGroup1.ObserveGroup`
public System.IObservable<System.Collections.Generic.Dictionary<string, T>> ObserveGroup()
Observes changes to the group of tags and provides a stream of their current values.
- Returns: An observable sequence that emits a dictionary containing the latest values for each tag in the group. Each dictionary maps tag names to their corresponding values of type T. The sequence emits a new dictionary whenever any tag value changes.
M:IoT.Driver.S7PlcRx.Performance.HighPerformanceTagGroup1.ReadAllAsync`
public System.Threading.Tasks.Task<System.Collections.Generic.Dictionary<string, T>> ReadAllAsync()
Asynchronously reads the values of all configured PLC tags and returns a dictionary mapping tag names to their corresponding values.
- Returns: A dictionary containing the tag names as keys and their associated values of type as values. If a tag value cannot be read, its value will be .
M:IoT.Driver.S7PlcRx.Performance.HighPerformanceTagGroup1.WriteAllAsync(System.Collections.Generic.Dictionary2{System.String,0})`
public System.Threading.Tasks.Task WriteAllAsync(System.Collections.Generic.Dictionary<string, T> values)
Executes the WriteAllAsync operation.
- Parameter
values: Thevaluesvalue. - Returns: A
System.Threading.Tasks.Taskresult.
P:IoT.Driver.S7PlcRx.Performance.HighPerformanceTagGroup1.CurrentValues`
public System.Collections.Generic.IReadOnlyDictionary<string, T> CurrentValues { get; }
Gets a read-only dictionary containing the current values associated with each key.
- Value: The
CurrentValuesvalue.
P:IoT.Driver.S7PlcRx.Performance.HighPerformanceTagGroup1.GroupName`
public string GroupName { get; }
Gets the name of the group associated with this instance.
- Value: The
GroupNamevalue.
T:IoT.Driver.S7PlcRx.Performance.PerformanceAnalysis
public class IoT.Driver.S7PlcRx.Performance.PerformanceAnalysis
Represents the results and metrics of a performance analysis, including time intervals, tag change statistics, and optimization recommendations.
Declared public members
M:IoT.Driver.S7PlcRx.Performance.PerformanceAnalysis.#ctor
public IoT.Driver.S7PlcRx.Performance.PerformanceAnalysis()
Initializes a new instance of IoT.Driver.S7PlcRx.Performance.PerformanceAnalysis.
P:IoT.Driver.S7PlcRx.Performance.PerformanceAnalysis.AverageChangesPerTag
public double AverageChangesPerTag { get; set; }
Gets or sets the average changes per tag.
- Value: The
AverageChangesPerTagvalue.
P:IoT.Driver.S7PlcRx.Performance.PerformanceAnalysis.EndTime
public System.DateTimeOffset EndTime { get; set; }
Gets or sets the end time of the analysis.
- Value: The
EndTimevalue.
P:IoT.Driver.S7PlcRx.Performance.PerformanceAnalysis.MonitoringDuration
public System.TimeSpan MonitoringDuration { get; set; }
Gets or sets the monitoring duration.
- Value: The
MonitoringDurationvalue.
P:IoT.Driver.S7PlcRx.Performance.PerformanceAnalysis.Recommendations
public System.Collections.Generic.List<string> Recommendations { get; }
Gets or sets the optimization recommendations.
- Value: The
Recommendationsvalue.
P:IoT.Driver.S7PlcRx.Performance.PerformanceAnalysis.StartTime
public System.DateTimeOffset StartTime { get; set; }
Gets or sets the start time of the analysis.
- Value: The
StartTimevalue.
P:IoT.Driver.S7PlcRx.Performance.PerformanceAnalysis.TagChangeFrequencies
public System.Collections.Generic.Dictionary<string, int> TagChangeFrequencies { get; }
Gets or sets the tag change frequencies.
- Value: The
TagChangeFrequenciesvalue.
P:IoT.Driver.S7PlcRx.Performance.PerformanceAnalysis.TotalTagChanges
public int TotalTagChanges { get; set; }
Gets or sets the total tag changes observed.
- Value: The
TotalTagChangesvalue.
T:IoT.Driver.S7PlcRx.Performance.PerformanceExtensions
public class IoT.Driver.S7PlcRx.Performance.PerformanceExtensions
Provides compositional methods for IRxS7 PLC instances to enable advanced performance monitoring, optimized read and write operations, and benchmarking capabilities.
Declared public members
M:IoT.Driver.S7PlcRx.Performance.PerformanceExtensions.GetPerformanceStatistics(IoT.Driver.S7PlcRx.IRxS7)
public static IoT.Driver.S7PlcRx.Performance.PerformanceStatistics GetPerformanceStatistics(IoT.Driver.S7PlcRx.IRxS7 plc)
Retrieves aggregated performance statistics for the specified PLC connection, including operation counts, error rates, response times, and connection metrics.
- Parameter
plc: The PLC for which to retrieve performance statistics. - Returns: A PerformanceStatistics object containing metrics such as total operations, error rate, average response time, connection uptime, and reconnection count for the specified PLC.
M:IoT.Driver.S7PlcRx.Performance.PerformanceExtensions.GetPerformanceStatistics(IoT.Driver.S7PlcRx.IRxS7,System.TimeProvider)
public static IoT.Driver.S7PlcRx.Performance.PerformanceStatistics GetPerformanceStatistics(IoT.Driver.S7PlcRx.IRxS7 plc, System.TimeProvider timeProvider)
Retrieves aggregated performance statistics for the specified PLC connection, including operation counts, error rates, response times, and connection metrics.
- Parameter
plc: The PLC for which to retrieve performance statistics. - Parameter
timeProvider: The time provider. - Returns: A PerformanceStatistics object containing metrics such as total operations, error rate, average response time, connection uptime, and reconnection count for the specified PLC.
M:IoT.Driver.S7PlcRx.Performance.PerformanceExtensions.MonitorPerformance(IoT.Driver.S7PlcRx.IRxS7,System.Nullable1{System.TimeSpan})`
public static System.IObservable<IoT.Driver.S7PlcRx.Performance.PerformanceMetrics> MonitorPerformance(IoT.Driver.S7PlcRx.IRxS7 plc, System.Nullable<System.TimeSpan> monitoringInterval)
Executes the MonitorPerformance operation.
- Parameter
plc: Theplcvalue. - Parameter
monitoringInterval: ThemonitoringIntervalvalue. - Returns: A
System.IObservable<IoT.Driver.S7PlcRx.Performance.PerformanceMetrics>result.
M:IoT.Driver.S7PlcRx.Performance.PerformanceExtensions.MonitorPerformance(IoT.Driver.S7PlcRx.IRxS7,System.Nullable1{System.TimeSpan},System.TimeProvider)`
public static System.IObservable<IoT.Driver.S7PlcRx.Performance.PerformanceMetrics> MonitorPerformance(IoT.Driver.S7PlcRx.IRxS7 plc, System.Nullable<System.TimeSpan> monitoringInterval, System.TimeProvider timeProvider)
Executes the MonitorPerformance operation.
- Parameter
plc: Theplcvalue. - Parameter
monitoringInterval: ThemonitoringIntervalvalue. - Parameter
timeProvider: ThetimeProvidervalue. - Returns: A
System.IObservable<IoT.Driver.S7PlcRx.Performance.PerformanceMetrics>result.
M:IoT.Driver.S7PlcRx.Performance.PerformanceExtensions.ReadOptimizedAsync``1(IoT.Driver.S7PlcRx.IRxS7,System.Collections.Generic.IEnumerable1{System.String},``0,IoT.Driver.S7PlcRx.Optimization.ReadOptimizationConfig)`
public static System.Threading.Tasks.Task<System.Collections.Generic.Dictionary<string, T>> ReadOptimizedAsync<T>(IoT.Driver.S7PlcRx.IRxS7 plc, System.Collections.Generic.IEnumerable<string> tagNames, T typeMarker, IoT.Driver.S7PlcRx.Optimization.ReadOptimizationConfig optimizationConfig)
Executes the ReadOptimizedAsync operation.
- Parameter
plc: Theplcvalue. - Parameter
tagNames: ThetagNamesvalue. - Parameter
typeMarker: ThetypeMarkervalue. - Parameter
optimizationConfig: TheoptimizationConfigvalue. - Returns: A
System.Threading.Tasks.Task<System.Collections.Generic.Dictionary<string, T>>result.
M:IoT.Driver.S7PlcRx.Performance.PerformanceExtensions.RunBenchmarkAsync(IoT.Driver.S7PlcRx.IRxS7,IoT.Driver.S7PlcRx.Performance.BenchmarkConfig)
public static System.Threading.Tasks.Task<IoT.Driver.S7PlcRx.Performance.BenchmarkResult> RunBenchmarkAsync(IoT.Driver.S7PlcRx.IRxS7 plc, IoT.Driver.S7PlcRx.Performance.BenchmarkConfig benchmarkConfig)
Runs latency, throughput, and reliability benchmarks.
- Parameter
plc: The PLC to benchmark. - Parameter
benchmarkConfig: An optional configuration object specifying benchmark parameters. If null, default settings are used. - Returns: A task that represents the asynchronous operation. The result contains detailed benchmark metrics and scores for the PLC.
M:IoT.Driver.S7PlcRx.Performance.PerformanceExtensions.RunBenchmarkAsync(IoT.Driver.S7PlcRx.IRxS7,IoT.Driver.S7PlcRx.Performance.BenchmarkConfig,System.TimeProvider)
public static System.Threading.Tasks.Task<IoT.Driver.S7PlcRx.Performance.BenchmarkResult> RunBenchmarkAsync(IoT.Driver.S7PlcRx.IRxS7 plc, IoT.Driver.S7PlcRx.Performance.BenchmarkConfig benchmarkConfig, System.TimeProvider timeProvider)
Runs latency, throughput, and reliability benchmarks.
- Parameter
plc: The PLC to benchmark. - Parameter
benchmarkConfig: An optional configuration object specifying benchmark parameters. If null, default settings are used. - Parameter
timeProvider: The time provider. - Returns: A task that represents the asynchronous operation. The result contains detailed benchmark metrics and scores for the PLC.
M:IoT.Driver.S7PlcRx.Performance.PerformanceExtensions.WriteOptimizedAsync``1(IoT.Driver.S7PlcRx.IRxS7,System.Collections.Generic.Dictionary2{System.String,``0},IoT.Driver.S7PlcRx.Optimization.WriteOptimizationConfig)`
public static System.Threading.Tasks.Task<IoT.Driver.S7PlcRx.Optimization.WriteOptimizationResult> WriteOptimizedAsync<T>(IoT.Driver.S7PlcRx.IRxS7 plc, System.Collections.Generic.Dictionary<string, T> values, IoT.Driver.S7PlcRx.Optimization.WriteOptimizationConfig optimizationConfig)
Executes the WriteOptimizedAsync operation.
- Parameter
plc: Theplcvalue. - Parameter
values: Thevaluesvalue. - Parameter
optimizationConfig: TheoptimizationConfigvalue. - Returns: A
System.Threading.Tasks.Task<IoT.Driver.S7PlcRx.Optimization.WriteOptimizationResult>result.
M:IoT.Driver.S7PlcRx.Performance.PerformanceExtensions.WriteOptimizedAsync``1(IoT.Driver.S7PlcRx.IRxS7,System.Collections.Generic.Dictionary2{System.String,``0},IoT.Driver.S7PlcRx.Optimization.WriteOptimizationConfig,System.TimeProvider)`
public static System.Threading.Tasks.Task<IoT.Driver.S7PlcRx.Optimization.WriteOptimizationResult> WriteOptimizedAsync<T>(IoT.Driver.S7PlcRx.IRxS7 plc, System.Collections.Generic.Dictionary<string, T> values, IoT.Driver.S7PlcRx.Optimization.WriteOptimizationConfig optimizationConfig, System.TimeProvider timeProvider)
Executes the WriteOptimizedAsync operation.
- Parameter
plc: Theplcvalue. - Parameter
values: Thevaluesvalue. - Parameter
optimizationConfig: TheoptimizationConfigvalue. - Parameter
timeProvider: ThetimeProvidervalue. - Returns: A
System.Threading.Tasks.Task<IoT.Driver.S7PlcRx.Optimization.WriteOptimizationResult>result.
T:IoT.Driver.S7PlcRx.Performance.PerformanceMetrics
public class IoT.Driver.S7PlcRx.Performance.PerformanceMetrics
Represents PLC performance metrics at a specific point in time.
Declared public members
M:IoT.Driver.S7PlcRx.Performance.PerformanceMetrics.#ctor
public IoT.Driver.S7PlcRx.Performance.PerformanceMetrics()
Initializes a new instance of IoT.Driver.S7PlcRx.Performance.PerformanceMetrics.
P:IoT.Driver.S7PlcRx.Performance.PerformanceMetrics.ActiveTagCount
public int ActiveTagCount { get; set; }
Gets or sets the number of active tags.
- Value: The
ActiveTagCountvalue.
P:IoT.Driver.S7PlcRx.Performance.PerformanceMetrics.AverageResponseTime
public double AverageResponseTime { get; set; }
Gets or sets the average response time in milliseconds.
- Value: The
AverageResponseTimevalue.
P:IoT.Driver.S7PlcRx.Performance.PerformanceMetrics.ConnectionUptime
public System.TimeSpan ConnectionUptime { get; set; }
Gets or sets the connection uptime.
- Value: The
ConnectionUptimevalue.
P:IoT.Driver.S7PlcRx.Performance.PerformanceMetrics.ErrorRate
public double ErrorRate { get; set; }
Gets or sets the error rate (0.0 to 1.0).
- Value: The
ErrorRatevalue.
P:IoT.Driver.S7PlcRx.Performance.PerformanceMetrics.IsConnected
public bool IsConnected { get; set; }
Gets or sets a value indicating whether gets or sets whether the PLC is connected.
- Value: The
IsConnectedvalue.
P:IoT.Driver.S7PlcRx.Performance.PerformanceMetrics.OperationsPerSecond
public double OperationsPerSecond { get; set; }
Gets or sets the operations per second.
- Value: The
OperationsPerSecondvalue.
P:IoT.Driver.S7PlcRx.Performance.PerformanceMetrics.PLCIdentifier
public string PLCIdentifier { get; set; }
Gets or sets the PLC identifier.
- Value: The
PLCIdentifiervalue.
P:IoT.Driver.S7PlcRx.Performance.PerformanceMetrics.ReconnectionCount
public int ReconnectionCount { get; set; }
Gets or sets the number of reconnections.
- Value: The
ReconnectionCountvalue.
P:IoT.Driver.S7PlcRx.Performance.PerformanceMetrics.TagCount
public int TagCount { get; set; }
Gets or sets the total number of tags.
- Value: The
TagCountvalue.
P:IoT.Driver.S7PlcRx.Performance.PerformanceMetrics.Timestamp
public System.DateTimeOffset Timestamp { get; set; }
Gets or sets the timestamp of these metrics.
- Value: The
Timestampvalue.
T:IoT.Driver.S7PlcRx.Performance.PerformanceStatistics
public class IoT.Driver.S7PlcRx.Performance.PerformanceStatistics
Represents a set of performance statistics for a programmable logic controller (PLC) connection, including operation counts, error metrics, response times, and connection status information.
Declared public members
M:IoT.Driver.S7PlcRx.Performance.PerformanceStatistics.#ctor
public IoT.Driver.S7PlcRx.Performance.PerformanceStatistics()
Initializes a new instance of IoT.Driver.S7PlcRx.Performance.PerformanceStatistics.
P:IoT.Driver.S7PlcRx.Performance.PerformanceStatistics.AverageResponseTime
public double AverageResponseTime { get; set; }
Gets or sets the average response time in milliseconds.
- Value: The
AverageResponseTimevalue.
P:IoT.Driver.S7PlcRx.Performance.PerformanceStatistics.ConnectionUptime
public System.TimeSpan ConnectionUptime { get; set; }
Gets or sets the connection uptime.
- Value: The
ConnectionUptimevalue.
P:IoT.Driver.S7PlcRx.Performance.PerformanceStatistics.ErrorRate
public double ErrorRate { get; set; }
Gets or sets the error rate (0.0 to 1.0).
- Value: The
ErrorRatevalue.
P:IoT.Driver.S7PlcRx.Performance.PerformanceStatistics.LastUpdated
public System.DateTimeOffset LastUpdated { get; set; }
Gets or sets when these statistics were last updated.
- Value: The
LastUpdatedvalue.
P:IoT.Driver.S7PlcRx.Performance.PerformanceStatistics.OperationsPerSecond
public double OperationsPerSecond { get; set; }
Gets or sets the operations per second.
- Value: The
OperationsPerSecondvalue.
P:IoT.Driver.S7PlcRx.Performance.PerformanceStatistics.PLCIdentifier
public string PLCIdentifier { get; set; }
Gets or sets the PLC identifier.
- Value: The
PLCIdentifiervalue.
P:IoT.Driver.S7PlcRx.Performance.PerformanceStatistics.ReconnectionCount
public int ReconnectionCount { get; set; }
Gets or sets the number of reconnections.
- Value: The
ReconnectionCountvalue.
P:IoT.Driver.S7PlcRx.Performance.PerformanceStatistics.TotalErrors
public long TotalErrors { get; set; }
Gets or sets the total number of errors.
- Value: The
TotalErrorsvalue.
P:IoT.Driver.S7PlcRx.Performance.PerformanceStatistics.TotalOperations
public long TotalOperations { get; set; }
Gets or sets the total number of operations.
- Value: The
TotalOperationsvalue.
T:IoT.Driver.S7PlcRx.Performance.TagPerformanceMetrics
public class IoT.Driver.S7PlcRx.Performance.TagPerformanceMetrics
Represents operation counts, timings, and success rates for a tag.
Declared public members
M:IoT.Driver.S7PlcRx.Performance.TagPerformanceMetrics.#ctor
public IoT.Driver.S7PlcRx.Performance.TagPerformanceMetrics()
Initializes a new instance of IoT.Driver.S7PlcRx.Performance.TagPerformanceMetrics.
P:IoT.Driver.S7PlcRx.Performance.TagPerformanceMetrics.AverageReadTimeMs
public double AverageReadTimeMs { get; set; }
Gets or sets the average read time in milliseconds.
- Value: The
AverageReadTimeMsvalue.
P:IoT.Driver.S7PlcRx.Performance.TagPerformanceMetrics.AverageWriteTimeMs
public double AverageWriteTimeMs { get; set; }
Gets or sets the average write time in milliseconds.
- Value: The
AverageWriteTimeMsvalue.
P:IoT.Driver.S7PlcRx.Performance.TagPerformanceMetrics.FailedOperations
public long FailedOperations { get; set; }
Gets or sets the number of failed operations.
- Value: The
FailedOperationsvalue.
P:IoT.Driver.S7PlcRx.Performance.TagPerformanceMetrics.LastOperationTime
public System.DateTimeOffset LastOperationTime { get; set; }
Gets or sets the last operation timestamp.
- Value: The
LastOperationTimevalue.
P:IoT.Driver.S7PlcRx.Performance.TagPerformanceMetrics.ReadOperations
public long ReadOperations { get; set; }
Gets or sets the total number of read operations.
- Value: The
ReadOperationsvalue.
P:IoT.Driver.S7PlcRx.Performance.TagPerformanceMetrics.SuccessRate
public double SuccessRate { get; set; }
Gets or sets the success rate (0.0 to 1.0).
- Value: The
SuccessRatevalue.
P:IoT.Driver.S7PlcRx.Performance.TagPerformanceMetrics.TagName
public string TagName { get; set; }
Gets or sets the tag name.
- Value: The
TagNamevalue.
P:IoT.Driver.S7PlcRx.Performance.TagPerformanceMetrics.WriteOperations
public long WriteOperations { get; set; }
Gets or sets the total number of write operations.
- Value: The
WriteOperationsvalue.
T:IoT.Driver.S7PlcRx.PlcException
public class IoT.Driver.S7PlcRx.PlcException
Represents errors that occur during communication with a programmable logic controller (PLC).
Declared public members
M:IoT.Driver.S7PlcRx.PlcException.#ctor
public IoT.Driver.S7PlcRx.PlcException()
Initializes a new instance of the T:IoT.Driver.S7PlcRx.PlcException class.
M:IoT.Driver.S7PlcRx.PlcException.#ctor(IoT.Driver.S7PlcRx.Enums.ErrorCode)
public IoT.Driver.S7PlcRx.PlcException(IoT.Driver.S7PlcRx.Enums.ErrorCode errorCode)
Initializes a new instance of the T:IoT.Driver.S7PlcRx.PlcException class.
- Parameter
errorCode: The error code.
M:IoT.Driver.S7PlcRx.PlcException.#ctor(IoT.Driver.S7PlcRx.Enums.ErrorCode,System.Exception)
public IoT.Driver.S7PlcRx.PlcException(IoT.Driver.S7PlcRx.Enums.ErrorCode errorCode, System.Exception innerException)
Initializes a new instance of the T:IoT.Driver.S7PlcRx.PlcException class.
- Parameter
errorCode: The error code. - Parameter
innerException: The inner exception.
M:IoT.Driver.S7PlcRx.PlcException.#ctor(IoT.Driver.S7PlcRx.Enums.ErrorCode,System.String)
public IoT.Driver.S7PlcRx.PlcException(IoT.Driver.S7PlcRx.Enums.ErrorCode errorCode, string message)
Initializes a new instance of the T:IoT.Driver.S7PlcRx.PlcException class.
- Parameter
errorCode: The error code. - Parameter
message: The message.
M:IoT.Driver.S7PlcRx.PlcException.#ctor(IoT.Driver.S7PlcRx.Enums.ErrorCode,System.String,System.Exception)
public IoT.Driver.S7PlcRx.PlcException(IoT.Driver.S7PlcRx.Enums.ErrorCode errorCode, string message, System.Exception inner)
Initializes a new instance of the T:IoT.Driver.S7PlcRx.PlcException class.
- Parameter
errorCode: The error code. - Parameter
message: The message. - Parameter
inner: The inner.
M:IoT.Driver.S7PlcRx.PlcException.#ctor(System.String)
public IoT.Driver.S7PlcRx.PlcException(string message)
Initializes a new instance of the T:IoT.Driver.S7PlcRx.PlcException class.
- Parameter
message: The message that describes the error.
M:IoT.Driver.S7PlcRx.PlcException.#ctor(System.String,System.Exception)
public IoT.Driver.S7PlcRx.PlcException(string message, System.Exception innerException)
Initializes a new instance of the T:IoT.Driver.S7PlcRx.PlcException class.
- Parameter
message: The message that describes the error. - Parameter
innerException: The exception that caused the current exception.
P:IoT.Driver.S7PlcRx.PlcException.ErrorCode
public IoT.Driver.S7PlcRx.Enums.ErrorCode ErrorCode { get; }
Gets the error code.
- Value: The error code.
T:IoT.Driver.S7PlcRx.PlcTypes.Bit
public class IoT.Driver.S7PlcRx.PlcTypes.Bit
Contains the conversion methods to convert Bit from S7 plc to C#.
Declared public members
M:IoT.Driver.S7PlcRx.PlcTypes.Bit.FromByte(System.Byte,System.Byte)
public static bool FromByte(byte v, byte bitAdr)
Determines whether the specified bit in a byte value is set.
- Parameter
v: The byte value to examine. - Parameter
bitAdr: The zero-based position of the bit to check. Must be in the range 0 to 7. - Returns: true if the bit at the specified position is set; otherwise, false.
M:IoT.Driver.S7PlcRx.PlcTypes.Bit.FromSpan(System.ReadOnlySpan1{System.Byte},System.Int32,System.Int32)`
public static bool FromSpan(System.ReadOnlySpan<byte> bytes, int byteIndex, int bitIndex)
Executes the FromSpan operation.
- Parameter
bytes: Thebytesvalue. - Parameter
byteIndex: ThebyteIndexvalue. - Parameter
bitIndex: ThebitIndexvalue. - Returns: A
boolresult.
M:IoT.Driver.S7PlcRx.PlcTypes.Bit.GetBits(System.ReadOnlySpan1{System.Byte},System.ReadOnlySpan1{System.ValueTuple2{System.Int32,System.Int32}})`
public static bool[] GetBits(System.ReadOnlySpan<byte> bytes, System.ReadOnlySpan<System.ValueTuple<int, int>> bitPositions)
Executes the GetBits operation.
- Parameter
bytes: Thebytesvalue. - Parameter
bitPositions: ThebitPositionsvalue. - Returns: A
bool[]result.
M:IoT.Driver.S7PlcRx.PlcTypes.Bit.SetBit(System.Span1{System.Byte},System.Int32,System.Int32,System.Boolean)`
public static void SetBit(System.Span<byte> bytes, int byteIndex, int bitIndex, bool value)
Executes the SetBit operation.
- Parameter
bytes: Thebytesvalue. - Parameter
byteIndex: ThebyteIndexvalue. - Parameter
bitIndex: ThebitIndexvalue. - Parameter
value: Thevaluevalue.
M:IoT.Driver.S7PlcRx.PlcTypes.Bit.SetBits(System.Span1{System.Byte},System.ReadOnlySpan1{System.ValueTuple3{System.Int32,System.Int32,System.Boolean}})`
public static void SetBits(System.Span<byte> bytes, System.ReadOnlySpan<System.ValueTuple<int, int, bool>> bitUpdates)
Executes the SetBits operation.
- Parameter
bytes: Thebytesvalue. - Parameter
bitUpdates: ThebitUpdatesvalue.
M:IoT.Driver.S7PlcRx.PlcTypes.Bit.ToBitArray(System.Byte[])
public static System.Collections.BitArray ToBitArray(byte[] bytes)
Converts bytes to a BitArray.
- Parameter
bytes: The byte array to convert. Each byte is interpreted in order, with the least significant bit first in each byte. - Returns: A BitArray containing the bits from the input byte array. If the input array is null or empty, returns an empty BitArray.
M:IoT.Driver.S7PlcRx.PlcTypes.Bit.ToBitArray(System.Byte[],System.Nullable1{System.Int32})`
public static System.Collections.BitArray ToBitArray(byte[] bytes, System.Nullable<int> length)
Executes the ToBitArray operation.
- Parameter
bytes: Thebytesvalue. - Parameter
length: Thelengthvalue. - Returns: A
System.Collections.BitArrayresult.
M:IoT.Driver.S7PlcRx.PlcTypes.Bit.ToBitArray(System.ReadOnlySpan1{System.Byte})`
public static System.Collections.BitArray ToBitArray(System.ReadOnlySpan<byte> bytes)
Executes the ToBitArray operation.
- Parameter
bytes: Thebytesvalue. - Returns: A
System.Collections.BitArrayresult.
M:IoT.Driver.S7PlcRx.PlcTypes.Bit.ToBitArray(System.ReadOnlySpan1{System.Byte},System.Nullable1{System.Int32})
public static System.Collections.BitArray ToBitArray(System.ReadOnlySpan<byte> bytes, System.Nullable<int> length)
Executes the ToBitArray operation.
- Parameter
bytes: Thebytesvalue. - Parameter
length: Thelengthvalue. - Returns: A
System.Collections.BitArrayresult.
T:IoT.Driver.S7PlcRx.PlcTypes.Boolean
public class IoT.Driver.S7PlcRx.PlcTypes.Boolean
Provides static methods for manipulating individual bits within a byte value.
Declared public members
M:IoT.Driver.S7PlcRx.PlcTypes.Boolean.ClearBit(System.Byte,System.Int32)
public static byte ClearBit(byte value, int bit)
Returns a copy of the value with the addressed bit cleared.
- Parameter
value: The input value to modify. - Parameter
bit: The index (zero based) of the bit to clear. - Returns: The modified value with the bit at index cleared.
M:IoT.Driver.S7PlcRx.PlcTypes.Boolean.ClearBit(System.Byte@,System.Int32)
public static void ClearBit(ref byte value, int bit)
Resets the value of a bit to 0 (false), given the address of the bit.
- Parameter
value: The input value to modify. - Parameter
bit: The index (zero based) of the bit to clear.
M:IoT.Driver.S7PlcRx.PlcTypes.Boolean.GetValue(System.Byte,System.Int32)
public static bool GetValue(byte value, int bit)
Determines whether the specified bit is set in the given byte value.
- Parameter
value: The byte value to examine for the specified bit. - Parameter
bit: The zero-based position of the bit to check. Must be in the range 0 to 7. - Returns: true if the bit at the specified position is set; otherwise, false.
M:IoT.Driver.S7PlcRx.PlcTypes.Boolean.SetBit(System.Byte,System.Int32)
public static byte SetBit(byte value, int bit)
Returns a copy of the value with the addressed bit set.
- Parameter
value: The input value to modify. - Parameter
bit: The index (zero based) of the bit to set. - Returns: The modified value with the bit at index set.
M:IoT.Driver.S7PlcRx.PlcTypes.Boolean.SetBit(System.Byte@,System.Int32)
public static void SetBit(ref byte value, int bit)
Sets the value of a bit to 1 (true), given the address of the bit.
- Parameter
value: The value to modify. - Parameter
bit: The index (zero based) of the bit to set.
T:IoT.Driver.S7PlcRx.PlcTypes.Byte
public class IoT.Driver.S7PlcRx.PlcTypes.Byte
Provides utility methods for converting and manipulating byte values and byte arrays.
Declared public members
M:IoT.Driver.S7PlcRx.PlcTypes.Byte.FromByteArray(System.Byte[])
public static byte FromByteArray(byte[] bytes)
Creates a byte value from the specified byte array.
- Parameter
bytes: The array of bytes to convert. Must contain at least one element. - Returns: A byte value created from the first element of the specified array.
M:IoT.Driver.S7PlcRx.PlcTypes.Byte.FromSpan(System.ReadOnlySpan1{System.Byte})`
public static byte FromSpan(System.ReadOnlySpan<byte> bytes)
Executes the FromSpan operation.
- Parameter
bytes: Thebytesvalue. - Returns: A
byteresult.
M:IoT.Driver.S7PlcRx.PlcTypes.Byte.ToByteArray(System.Byte)
public static byte[] ToByteArray(byte value)
Converts the specified byte value to a single-element byte array.
- Parameter
value: The byte value to include in the returned array. - Returns: A byte array containing the specified value as its only element.
M:IoT.Driver.S7PlcRx.PlcTypes.Byte.ToSpan(System.Byte,System.Span1{System.Byte})`
public static void ToSpan(byte value, System.Span<byte> destination)
Executes the ToSpan operation.
- Parameter
value: Thevaluevalue. - Parameter
destination: Thedestinationvalue.
M:IoT.Driver.S7PlcRx.PlcTypes.Byte.ToSpan(System.ReadOnlySpan1{System.Byte},System.Span1{System.Byte})
public static void ToSpan(System.ReadOnlySpan<byte> values, System.Span<byte> destination)
Executes the ToSpan operation.
- Parameter
values: Thevaluesvalue. - Parameter
destination: Thedestinationvalue.
T:IoT.Driver.S7PlcRx.PlcTypes.ByteArray
public class IoT.Driver.S7PlcRx.PlcTypes.ByteArray
Provides a growable pooled byte buffer.
Declared public members
M:IoT.Driver.S7PlcRx.PlcTypes.ByteArray.#ctor
public IoT.Driver.S7PlcRx.PlcTypes.ByteArray()
Initializes a new instance of the T:IoT.Driver.S7PlcRx.PlcTypes.ByteArray class.
M:IoT.Driver.S7PlcRx.PlcTypes.ByteArray.#ctor(System.Int32)
public IoT.Driver.S7PlcRx.PlcTypes.ByteArray(int size)
Provides a growable pooled byte buffer.
- Parameter
size: The initial capacity of the internal buffer, in bytes. Must be greater than zero.
M:IoT.Driver.S7PlcRx.PlcTypes.ByteArray.Add(IoT.Driver.S7PlcRx.PlcTypes.ByteArray)
public void Add(IoT.Driver.S7PlcRx.PlcTypes.ByteArray byteArray)
Adds the contents of the specified T:IoT.Driver.S7PlcRx.PlcTypes.ByteArray to the collection.
- Parameter
byteArray: TheT:IoT.Driver.S7PlcRx.PlcTypes.ByteArrayinstance whose contents will be added. Cannot be null.
M:IoT.Driver.S7PlcRx.PlcTypes.ByteArray.Add(System.Byte)
public void Add(byte item)
Adds a byte value to the end of the buffer.
- Parameter
item: The byte value to add to the buffer.
M:IoT.Driver.S7PlcRx.PlcTypes.ByteArray.Add(System.Byte[])
public void Add(byte[] items)
Adds the specified array of bytes to the collection.
- Parameter
items: An array of bytes to add. Cannot be null.
M:IoT.Driver.S7PlcRx.PlcTypes.ByteArray.Add(System.ReadOnlySpan1{System.Byte})`
public void Add(System.ReadOnlySpan<byte> items)
Executes the Add operation.
- Parameter
items: Theitemsvalue.
M:IoT.Driver.S7PlcRx.PlcTypes.ByteArray.Clear
public void Clear()
Resets the current position to the beginning.
M:IoT.Driver.S7PlcRx.PlcTypes.ByteArray.Dispose
public void Dispose()
Releases resources used by this instance.
M:IoT.Driver.S7PlcRx.PlcTypes.ByteArray.TryCopyTo(System.Span1{System.Byte})`
public bool TryCopyTo(System.Span<byte> destination)
Executes the TryCopyTo operation.
- Parameter
destination: Thedestinationvalue. - Returns: A
boolresult.
P:IoT.Driver.S7PlcRx.PlcTypes.ByteArray.Array
public byte[] Array { get; }
Gets the array. Use Span property for better performance when possible.
- Value: The array.
P:IoT.Driver.S7PlcRx.PlcTypes.ByteArray.Length
public int Length { get; }
Gets the current position (length of data).
- Value: The
Lengthvalue.
P:IoT.Driver.S7PlcRx.PlcTypes.ByteArray.Memory
public System.ReadOnlyMemory<byte> Memory { get; }
Gets the current data as memory.
- Value: The current data as memory.
P:IoT.Driver.S7PlcRx.PlcTypes.ByteArray.Span
public System.ReadOnlySpan<byte> Span { get; }
Gets the current data as a span.
- Value: The current data as a span.
T:IoT.Driver.S7PlcRx.PlcTypes.Class
public class IoT.Driver.S7PlcRx.PlcTypes.Class
Provides static methods for serializing and deserializing class and struct instances to and from byte arrays, as well as calculating the size of a class in bytes for serialization purposes.
Declared public members
M:IoT.Driver.S7PlcRx.PlcTypes.Class.FromBytes(System.Object,System.Byte[])
public static double FromBytes(object sourceClass, byte[] bytes)
Deserializes accessible properties from the beginning of a byte array.
- Parameter
sourceClass: The object whose properties receive deserialized values. - Parameter
bytes: The source byte array. - Returns: The number of bytes consumed.
M:IoT.Driver.S7PlcRx.PlcTypes.Class.FromBytes(System.Object,System.Byte[],System.Double)
public static double FromBytes(object sourceClass, byte[] bytes, double numBytes)
Deserializes accessible properties from a specified byte offset.
- Parameter
sourceClass: The object whose properties receive deserialized values. - Parameter
bytes: The source byte array. - Parameter
numBytes: The initial byte offset. - Returns: The number of bytes consumed.
M:IoT.Driver.S7PlcRx.PlcTypes.Class.FromBytes(System.Object,System.Byte[],System.Double,System.Boolean)
public static double FromBytes(object sourceClass, byte[] bytes, double numBytes, bool isInnerClass)
Deserializes accessible properties from a specified byte offset.
- Parameter
sourceClass: The object whose properties receive deserialized values. - Parameter
bytes: The source byte array. - Parameter
numBytes: The initial byte offset. - Parameter
isInnerClass: Whether the object is nested within another serialized object. - Returns: The number of bytes consumed.
M:IoT.Driver.S7PlcRx.PlcTypes.Class.GetClassSize(System.Object)
public static double GetClassSize(object instance)
Calculates the aligned serialized size of an object's accessible properties.
- Parameter
instance: The object whose accessible properties are measured. - Returns: The aligned serialized size in bytes.
M:IoT.Driver.S7PlcRx.PlcTypes.Class.GetClassSize(System.Object,System.Double)
public static double GetClassSize(object instance, double numBytes)
Calculates the aligned serialized size from a specified byte offset.
- Parameter
instance: The object whose accessible properties are measured. - Parameter
numBytes: The initial byte offset. - Returns: The aligned serialized size in bytes.
M:IoT.Driver.S7PlcRx.PlcTypes.Class.GetClassSize(System.Object,System.Double,System.Boolean)
public static double GetClassSize(object instance, double numBytes, bool isInnerProperty)
Calculates the serialized size from a specified byte offset.
- Parameter
instance: The object whose accessible properties are measured. - Parameter
numBytes: The initial byte offset. - Parameter
isInnerProperty: Whether the object is nested and should not receive final alignment. - Returns: The serialized size in bytes.
M:IoT.Driver.S7PlcRx.PlcTypes.Class.ToBytes(System.Object,System.Byte[])
public static double ToBytes(object sourceClass, byte[] bytes)
Serializes accessible properties to the beginning of a byte array.
- Parameter
sourceClass: The object whose properties are serialized. - Parameter
bytes: The destination byte array. - Returns: The number of bytes written.
M:IoT.Driver.S7PlcRx.PlcTypes.Class.ToBytes(System.Object,System.Byte[],System.Double)
public static double ToBytes(object sourceClass, byte[] bytes, double numBytes)
Serializes accessible properties to a specified byte offset.
- Parameter
sourceClass: The object whose properties are serialized. - Parameter
bytes: The destination byte array. - Parameter
numBytes: The initial byte offset. - Returns: The number of bytes written.
T:IoT.Driver.S7PlcRx.PlcTypes.Counter
public class IoT.Driver.S7PlcRx.PlcTypes.Counter
Converts between S7 Counter bytes and unsigned 16-bit values.
Declared public members
M:IoT.Driver.S7PlcRx.PlcTypes.Counter.FromByteArray(System.Byte[])
public static ushort FromByteArray(byte[] bytes)
Converts a byte array to a 16-bit unsigned integer.
- Parameter
bytes: The byte array containing the bytes to convert. Must contain at least two bytes representing the value in the expected byte order. - Returns: A 16-bit unsigned integer represented by the first two bytes of the array.
M:IoT.Driver.S7PlcRx.PlcTypes.Counter.FromByteArray(System.Byte[],System.Int32)
public static ushort FromByteArray(byte[] bytes, int start)
Reads an unsigned 16-bit value from bytes at an index.
- Parameter
bytes: The byte array containing the data to convert. Cannot be null. - Parameter
start: The zero-based index in the array at which to begin reading bytes. Must be within the bounds of the array. - Returns: A 16-bit unsigned integer represented by the bytes at the specified position in the array.
M:IoT.Driver.S7PlcRx.PlcTypes.Counter.FromBytes(System.Byte,System.Byte)
public static ushort FromBytes(byte lowValue, byte highValue)
Creates an unsigned 16-bit value from low and high bytes.
- Parameter
lowValue: The low-order byte of the resulting 16-bit unsigned integer. - Parameter
highValue: The high-order byte of the resulting 16-bit unsigned integer. - Returns: A 16-bit unsigned integer composed from the specified low and high bytes.
M:IoT.Driver.S7PlcRx.PlcTypes.Counter.FromSpan(System.ReadOnlySpan1{System.Byte})`
public static ushort FromSpan(System.ReadOnlySpan<byte> bytes)
Executes the FromSpan operation.
- Parameter
bytes: Thebytesvalue. - Returns: A
ushortresult.
M:IoT.Driver.S7PlcRx.PlcTypes.Counter.ToArray(System.Byte[])
public static ushort[] ToArray(byte[] bytes)
Converts a byte array to an array of 16-bit unsigned integers.
- Parameter
bytes: The byte array to convert. The length must be a multiple of 2. - Returns: An array of
T:System.UInt16values representing the converted data from the input byte array.
M:IoT.Driver.S7PlcRx.PlcTypes.Counter.ToArray(System.ReadOnlySpan1{System.Byte})`
public static ushort[] ToArray(System.ReadOnlySpan<byte> bytes)
Executes the ToArray operation.
- Parameter
bytes: Thebytesvalue. - Returns: A
ushort[]result.
M:IoT.Driver.S7PlcRx.PlcTypes.Counter.ToByteArray(System.UInt16)
public static byte[] ToByteArray(ushort value)
Converts the specified 16-bit unsigned integer to a byte array in little-endian order.
- Parameter
value: The 16-bit unsigned integer to convert to a byte array. - Returns: A two-element byte array containing the little-endian representation of the specified value.
M:IoT.Driver.S7PlcRx.PlcTypes.Counter.ToByteArray(System.UInt16[])
public static byte[] ToByteArray(ushort[] value)
Converts an array of 16-bit unsigned integers to a byte array.
- Parameter
value: An array ofT:System.UInt16values to convert. Cannot be . - Returns: A byte array representing the binary data of the input
T:System.UInt16array.
M:IoT.Driver.S7PlcRx.PlcTypes.Counter.ToSpan(System.ReadOnlySpan1{System.UInt16},System.Span1{System.Byte})
public static void ToSpan(System.ReadOnlySpan<ushort> values, System.Span<byte> destination)
Executes the ToSpan operation.
- Parameter
values: Thevaluesvalue. - Parameter
destination: Thedestinationvalue.
M:IoT.Driver.S7PlcRx.PlcTypes.Counter.ToSpan(System.UInt16,System.Span1{System.Byte})`
public static void ToSpan(ushort value, System.Span<byte> destination)
Executes the ToSpan operation.
- Parameter
value: Thevaluevalue. - Parameter
destination: Thedestinationvalue.
T:IoT.Driver.S7PlcRx.PlcTypes.DInt
public class IoT.Driver.S7PlcRx.PlcTypes.DInt
Provides static methods for converting between Siemens S7 DInt (32-bit signed integer) representations and .NET int values.
Declared public members
M:IoT.Driver.S7PlcRx.PlcTypes.DInt.CDWord(System.Int64)
public static int CDWord(long value)
Converts a 64-bit signed value to the S7 32-bit signed representation.
- Parameter
value: The 64-bit signed integer value to convert. - Returns: A 32-bit signed integer representing the converted value. For values greater than
F:System.Int32.MaxValue, a custom transformation is applied before conversion.
M:IoT.Driver.S7PlcRx.PlcTypes.DInt.FromByteArray(System.Byte[])
public static int FromByteArray(byte[] bytes)
Creates an integer value from the specified byte array.
- Parameter
bytes: The byte array containing the bytes to convert to an integer. The array must contain at least the number of bytes required to represent an integer. - Returns: An integer value represented by the specified byte array.
M:IoT.Driver.S7PlcRx.PlcTypes.DInt.FromByteArray(System.Byte[],System.Int32)
public static int FromByteArray(byte[] bytes, int start)
Creates an integer value from a byte array starting at the specified index.
- Parameter
bytes: The byte array containing the data to convert. - Parameter
start: The zero-based index in the array at which to begin reading bytes. - Returns: The integer value represented by the bytes starting at the specified index.
M:IoT.Driver.S7PlcRx.PlcTypes.DInt.FromBytes(System.Byte,System.Byte,System.Byte,System.Byte)
public static int FromBytes(byte v1, byte v2, byte v3, byte v4)
Creates a 32-bit signed integer from four bytes, using little-endian byte order.
- Parameter
v1: The least significant byte of the resulting integer. - Parameter
v2: The second byte of the resulting integer. - Parameter
v3: The third byte of the resulting integer. - Parameter
v4: The most significant byte of the resulting integer. - Returns: A 32-bit signed integer composed from the specified bytes in little-endian order.
M:IoT.Driver.S7PlcRx.PlcTypes.DInt.FromSpan(System.ReadOnlySpan1{System.Byte})`
public static int FromSpan(System.ReadOnlySpan<byte> bytes)
Executes the FromSpan operation.
- Parameter
bytes: Thebytesvalue. - Returns: A
intresult.
M:IoT.Driver.S7PlcRx.PlcTypes.DInt.ToArray(System.Byte[])
public static int[] ToArray(byte[] bytes)
Converts a byte array to an array of 32-bit integers.
- Parameter
bytes: The byte array to convert. The length must be a multiple of 4. - Returns: An array of 32-bit integers representing the converted values from the input byte array.
M:IoT.Driver.S7PlcRx.PlcTypes.DInt.ToArray(System.ReadOnlySpan1{System.Byte})`
public static int[] ToArray(System.ReadOnlySpan<byte> bytes)
Executes the ToArray operation.
- Parameter
bytes: Thebytesvalue. - Returns: A
int[]result.
M:IoT.Driver.S7PlcRx.PlcTypes.DInt.ToByteArray(System.Int32)
public static byte[] ToByteArray(int value)
Converts the specified 32-bit signed integer to a byte array in little-endian order.
- Parameter
value: The 32-bit signed integer to convert to a byte array. - Returns: A 4-element byte array containing the little-endian representation of the specified integer.
M:IoT.Driver.S7PlcRx.PlcTypes.DInt.ToByteArray(System.Int32[])
public static byte[] ToByteArray(int[] value)
Converts an array of 32-bit integers to its equivalent byte array representation.
- Parameter
value: An array of 32-bit integers to convert. Cannot be null. - Returns: A byte array containing the binary representation of the input integer array. The length of the returned array is four times the length of the input array.
M:IoT.Driver.S7PlcRx.PlcTypes.DInt.ToSpan(System.Int32,System.Span1{System.Byte})`
public static void ToSpan(int value, System.Span<byte> destination)
Executes the ToSpan operation.
- Parameter
value: Thevaluevalue. - Parameter
destination: Thedestinationvalue.
M:IoT.Driver.S7PlcRx.PlcTypes.DInt.ToSpan(System.ReadOnlySpan1{System.Int32},System.Span1{System.Byte})
public static void ToSpan(System.ReadOnlySpan<int> values, System.Span<byte> destination)
Executes the ToSpan operation.
- Parameter
values: Thevaluesvalue. - Parameter
destination: Thedestinationvalue.
T:IoT.Driver.S7PlcRx.PlcTypes.DWord
public class IoT.Driver.S7PlcRx.PlcTypes.DWord
Converts between S7 DWord bytes and unsigned 32-bit values.
Declared public members
M:IoT.Driver.S7PlcRx.PlcTypes.DWord.FromByteArray(System.Byte[])
public static uint FromByteArray(byte[] bytes)
Creates a 32-bit unsigned integer from a byte array.
- Parameter
bytes: The byte array containing the bytes to convert. Must contain at least four bytes starting at the beginning of the array. - Returns: A 32-bit unsigned integer represented by the first four bytes of the array.
M:IoT.Driver.S7PlcRx.PlcTypes.DWord.FromByteArray(System.Byte[],System.Int32)
public static uint FromByteArray(byte[] bytes, int start)
Reads an unsigned 32-bit value from bytes at an index.
- Parameter
bytes: The array containing the bytes to convert. - Parameter
start: The zero-based index in the array at which to begin reading bytes. - Returns: A 32-bit unsigned integer representing the converted value from the specified byte sequence.
M:IoT.Driver.S7PlcRx.PlcTypes.DWord.FromBytes(System.Byte,System.Byte,System.Byte,System.Byte)
public static uint FromBytes(byte v1, byte v2, byte v3, byte v4)
Creates a 32-bit unsigned integer from four individual bytes, using little-endian byte order.
- Parameter
v1: The least significant byte of the resulting 32-bit unsigned integer. - Parameter
v2: The second byte, which becomes the second least significant byte of the resulting value. - Parameter
v3: The third byte, which becomes the third least significant byte of the resulting value. - Parameter
v4: The most significant byte of the resulting 32-bit unsigned integer. - Returns: A 32-bit unsigned integer composed from the specified bytes in little-endian order.
M:IoT.Driver.S7PlcRx.PlcTypes.DWord.FromSpan(System.ReadOnlySpan1{System.Byte})`
public static uint FromSpan(System.ReadOnlySpan<byte> bytes)
Executes the FromSpan operation.
- Parameter
bytes: Thebytesvalue. - Returns: A
uintresult.
M:IoT.Driver.S7PlcRx.PlcTypes.DWord.ToArray(System.Byte[])
public static uint[] ToArray(byte[] bytes)
Converts the specified byte array to an array of 32-bit unsigned integers.
- Parameter
bytes: The byte array to convert. The length must be a multiple of 4. - Returns: An array of 32-bit unsigned integers representing the converted values from the input byte array.
M:IoT.Driver.S7PlcRx.PlcTypes.DWord.ToArray(System.ReadOnlySpan1{System.Byte})`
public static uint[] ToArray(System.ReadOnlySpan<byte> bytes)
Executes the ToArray operation.
- Parameter
bytes: Thebytesvalue. - Returns: A
uint[]result.
M:IoT.Driver.S7PlcRx.PlcTypes.DWord.ToByteArray(System.UInt32)
public static byte[] ToByteArray(uint value)
Converts the specified 32-bit unsigned integer to a byte array in little-endian order.
- Parameter
value: The 32-bit unsigned integer to convert to a byte array. - Returns: A 4-element byte array containing the bytes of the specified value in little-endian order.
M:IoT.Driver.S7PlcRx.PlcTypes.DWord.ToByteArray(System.UInt32[])
public static byte[] ToByteArray(uint[] value)
Converts the specified array of 32-bit unsigned integers to a byte array.
- Parameter
value: An array of 32-bit unsigned integers to convert. Cannot be null. - Returns: A byte array containing the binary representation of the input values. The length of the returned array is four times the length of the input array.
M:IoT.Driver.S7PlcRx.PlcTypes.DWord.ToSpan(System.ReadOnlySpan1{System.UInt32},System.Span1{System.Byte})
public static void ToSpan(System.ReadOnlySpan<uint> values, System.Span<byte> destination)
Executes the ToSpan operation.
- Parameter
values: Thevaluesvalue. - Parameter
destination: Thedestinationvalue.
M:IoT.Driver.S7PlcRx.PlcTypes.DWord.ToSpan(System.UInt32,System.Span1{System.Byte})`
public static void ToSpan(uint value, System.Span<byte> destination)
Executes the ToSpan operation.
- Parameter
value: Thevaluevalue. - Parameter
destination: Thedestinationvalue.
T:IoT.Driver.S7PlcRx.PlcTypes.DateTime
public class IoT.Driver.S7PlcRx.PlcTypes.DateTime
Converts offset-aware values to and from the S7 date-time representation.
Declared public members
F:IoT.Driver.S7PlcRx.PlcTypes.DateTime.SpecMaximumDateTime
public static System.DateTimeOffset SpecMaximumDateTime
The maximum value supported by the specification.
F:IoT.Driver.S7PlcRx.PlcTypes.DateTime.SpecMinimumDateTime
public static System.DateTimeOffset SpecMinimumDateTime
The minimum value supported by the specification.
M:IoT.Driver.S7PlcRx.PlcTypes.DateTime.FromByteArray(System.Byte[])
public static System.DateTimeOffset FromByteArray(byte[] bytes)
Parses a T:System.DateTimeOffset value from bytes.
- Parameter
bytes: Input bytes read from PLC. - Returns: A value representing the date and time read from the PLC.
M:IoT.Driver.S7PlcRx.PlcTypes.DateTime.FromSpan(System.ReadOnlySpan1{System.Byte})`
public static System.DateTimeOffset FromSpan(System.ReadOnlySpan<byte> bytes)
Executes the FromSpan operation.
- Parameter
bytes: Thebytesvalue. - Returns: A
System.DateTimeOffsetresult.
M:IoT.Driver.S7PlcRx.PlcTypes.DateTime.ToArray(System.Byte[])
public static System.DateTimeOffset[] ToArray(byte[] bytes)
Parses an array of T:System.DateTimeOffset values from bytes.
- Parameter
bytes: Input bytes read from PLC. - Returns: An array of values representing the dates and times read from the PLC.
M:IoT.Driver.S7PlcRx.PlcTypes.DateTime.ToArray(System.ReadOnlySpan1{System.Byte})`
public static System.DateTimeOffset[] ToArray(System.ReadOnlySpan<byte> bytes)
Executes the ToArray operation.
- Parameter
bytes: Thebytesvalue. - Returns: A
System.DateTimeOffset[]result.
M:IoT.Driver.S7PlcRx.PlcTypes.DateTime.ToByteArray(System.DateTimeOffset)
public static byte[] ToByteArray(System.DateTimeOffset dateTime)
Converts a T:System.DateTimeOffset value to a byte array.
- Parameter
dateTime: The date and time value to convert. - Returns: A byte array containing the S7 date time representation of
dateTime.
M:IoT.Driver.S7PlcRx.PlcTypes.DateTime.ToByteArray(System.DateTimeOffset[])
public static byte[] ToByteArray(System.DateTimeOffset[] dateTimes)
Converts an array of date and time values to a byte array.
- Parameter
dateTimes: The date and time values to convert. - Returns: A byte array containing the S7 date time representations of
dateTimes.
M:IoT.Driver.S7PlcRx.PlcTypes.DateTime.ToSpan(System.DateTimeOffset,System.Span1{System.Byte})`
public static void ToSpan(System.DateTimeOffset dateTime, System.Span<byte> destination)
Executes the ToSpan operation.
- Parameter
dateTime: ThedateTimevalue. - Parameter
destination: Thedestinationvalue.
M:IoT.Driver.S7PlcRx.PlcTypes.DateTime.ToSpan(System.ReadOnlySpan1{System.DateTimeOffset},System.Span1{System.Byte})
public static void ToSpan(System.ReadOnlySpan<System.DateTimeOffset> dateTimes, System.Span<byte> destination)
Executes the ToSpan operation.
- Parameter
dateTimes: ThedateTimesvalue. - Parameter
destination: Thedestinationvalue.
T:IoT.Driver.S7PlcRx.PlcTypes.DateTimeLong
public class IoT.Driver.S7PlcRx.PlcTypes.DateTimeLong
Converts offset-aware values to and from the S7 DateTimeLong representation.
Declared public members
F:IoT.Driver.S7PlcRx.PlcTypes.DateTimeLong.SpecMaximumDateTime
public static System.DateTimeOffset SpecMaximumDateTime
The maximum value supported by the specification.
F:IoT.Driver.S7PlcRx.PlcTypes.DateTimeLong.SpecMinimumDateTime
public static System.DateTimeOffset SpecMinimumDateTime
The minimum value supported by the specification.
F:IoT.Driver.S7PlcRx.PlcTypes.DateTimeLong.TypeLengthInBytes
public static int TypeLengthInBytes
The type length in bytes.
M:IoT.Driver.S7PlcRx.PlcTypes.DateTimeLong.FromByteArray(System.Byte[])
public static System.DateTimeOffset FromByteArray(byte[] bytes)
Parses a T:System.DateTimeOffset value from bytes.
- Parameter
bytes: Input bytes read from PLC. - Returns: A value representing the date and time read from the PLC.
M:IoT.Driver.S7PlcRx.PlcTypes.DateTimeLong.FromSpan(System.ReadOnlySpan1{System.Byte})`
public static System.DateTimeOffset FromSpan(System.ReadOnlySpan<byte> bytes)
Executes the FromSpan operation.
- Parameter
bytes: Thebytesvalue. - Returns: A
System.DateTimeOffsetresult.
M:IoT.Driver.S7PlcRx.PlcTypes.DateTimeLong.ToArray(System.Byte[])
public static System.DateTimeOffset[] ToArray(byte[] bytes)
Parses an array of T:System.DateTime values from bytes.
- Parameter
bytes: Input bytes read from PLC. - Returns: An array of
T:System.DateTimeobjects representing the values read from PLC.
M:IoT.Driver.S7PlcRx.PlcTypes.DateTimeLong.ToArray(System.ReadOnlySpan1{System.Byte})`
public static System.DateTimeOffset[] ToArray(System.ReadOnlySpan<byte> bytes)
Executes the ToArray operation.
- Parameter
bytes: Thebytesvalue. - Returns: A
System.DateTimeOffset[]result.
M:IoT.Driver.S7PlcRx.PlcTypes.DateTimeLong.ToByteArray(System.DateTimeOffset)
public static byte[] ToByteArray(System.DateTimeOffset dateTime)
Converts a T:System.DateTime value to a byte array.
- Parameter
dateTime: The DateTime value to convert. - Returns: A byte array containing the S7 DateTimeLong representation of
dateTime.
M:IoT.Driver.S7PlcRx.PlcTypes.DateTimeLong.ToByteArray(System.DateTimeOffset[])
public static byte[] ToByteArray(System.DateTimeOffset[] dateTimes)
Converts an array of T:System.DateTime values to a byte array.
- Parameter
dateTimes: The DateTime values to convert. - Returns: A byte array containing the S7 DateTimeLong representations of
dateTimes.
M:IoT.Driver.S7PlcRx.PlcTypes.DateTimeLong.ToSpan(System.DateTimeOffset,System.Span1{System.Byte})`
public static void ToSpan(System.DateTimeOffset dateTime, System.Span<byte> destination)
Executes the ToSpan operation.
- Parameter
dateTime: ThedateTimevalue. - Parameter
destination: Thedestinationvalue.
M:IoT.Driver.S7PlcRx.PlcTypes.DateTimeLong.ToSpan(System.ReadOnlySpan1{System.DateTimeOffset},System.Span1{System.Byte})
public static void ToSpan(System.ReadOnlySpan<System.DateTimeOffset> dateTimes, System.Span<byte> destination)
Executes the ToSpan operation.
- Parameter
dateTimes: ThedateTimesvalue. - Parameter
destination: Thedestinationvalue.
T:IoT.Driver.S7PlcRx.PlcTypes.Int
public class IoT.Driver.S7PlcRx.PlcTypes.Int
Provides static methods for converting between S7 Int (16-bit signed integer) representations and .NET types, including byte arrays and spans.
Declared public members
M:IoT.Driver.S7PlcRx.PlcTypes.Int.CWord(System.Int32)
public static short CWord(int value)
Converts a 32-bit signed integer to a 16-bit signed integer, applying a custom transformation for values greater than 32,767.
- Parameter
value: The 32-bit signed integer to convert. - Returns: A 16-bit signed integer representing the converted value.
M:IoT.Driver.S7PlcRx.PlcTypes.Int.FromByteArray(System.Byte[])
public static short FromByteArray(byte[] bytes)
Converts a byte array to a 16-bit signed integer.
- Parameter
bytes: The byte array containing the bytes to convert. Must contain at least two bytes starting at index zero. - Returns: A 16-bit signed integer represented by the first two bytes of the array.
M:IoT.Driver.S7PlcRx.PlcTypes.Int.FromByteArray(System.Byte[],System.Int32)
public static short FromByteArray(byte[] bytes, int start)
Reads a signed 16-bit value from bytes at an index.
- Parameter
bytes: The byte array containing the data to convert. - Parameter
start: The zero-based index in the array at which to begin reading the bytes. - Returns: A 16-bit signed integer represented by the two bytes starting at the specified index in the array.
M:IoT.Driver.S7PlcRx.PlcTypes.Int.FromBytes(System.Byte,System.Byte)
public static short FromBytes(byte lowValue, byte highValue)
Creates a 16-bit signed integer from two bytes, using the specified low and high byte values.
- Parameter
lowValue: The low-order byte of the 16-bit value. - Parameter
highValue: The high-order byte of the 16-bit value. - Returns: A 16-bit signed integer formed by combining the specified low and high bytes.
M:IoT.Driver.S7PlcRx.PlcTypes.Int.FromSpan(System.ReadOnlySpan1{System.Byte})`
public static short FromSpan(System.ReadOnlySpan<byte> bytes)
Executes the FromSpan operation.
- Parameter
bytes: Thebytesvalue. - Returns: A
shortresult.
M:IoT.Driver.S7PlcRx.PlcTypes.Int.ToArray(System.Byte[])
public static short[] ToArray(byte[] bytes)
Converts the specified byte array to an array of 16-bit signed integers.
- Parameter
bytes: The byte array to convert. The length must be a multiple of 2. - Returns: An array of 16-bit signed integers representing the converted values from the input byte array.
M:IoT.Driver.S7PlcRx.PlcTypes.Int.ToArray(System.ReadOnlySpan1{System.Byte})`
public static short[] ToArray(System.ReadOnlySpan<byte> bytes)
Executes the ToArray operation.
- Parameter
bytes: Thebytesvalue. - Returns: A
short[]result.
M:IoT.Driver.S7PlcRx.PlcTypes.Int.ToByteArray(System.Int16)
public static byte[] ToByteArray(short value)
Converts the specified 16-bit signed integer to a byte array.
- Parameter
value: The 16-bit signed integer to convert. - Returns: A byte array containing the two bytes that represent the specified value.
M:IoT.Driver.S7PlcRx.PlcTypes.Int.ToByteArray(System.Int16[])
public static byte[] ToByteArray(short[] value)
Converts an array of 16-bit signed integers to a byte array.
- Parameter
value: An array of 16-bit signed integers to convert. Cannot be null. - Returns: A byte array containing the binary representation of the input values.
M:IoT.Driver.S7PlcRx.PlcTypes.Int.ToSpan(System.Int16,System.Span1{System.Byte})`
public static void ToSpan(short value, System.Span<byte> destination)
Executes the ToSpan operation.
- Parameter
value: Thevaluevalue. - Parameter
destination: Thedestinationvalue.
M:IoT.Driver.S7PlcRx.PlcTypes.Int.ToSpan(System.ReadOnlySpan1{System.Int16},System.Span1{System.Byte})
public static void ToSpan(System.ReadOnlySpan<short> values, System.Span<byte> destination)
Executes the ToSpan operation.
- Parameter
values: Thevaluesvalue. - Parameter
destination: Thedestinationvalue.
T:IoT.Driver.S7PlcRx.PlcTypes.LReal
public class IoT.Driver.S7PlcRx.PlcTypes.LReal
Converts between S7 LReal bytes and .NET double values.
Declared public members
M:IoT.Driver.S7PlcRx.PlcTypes.LReal.FromByteArray(System.Byte[])
public static double FromByteArray(byte[] bytes)
Converts a byte array to a double-precision floating-point number.
- Parameter
bytes: The byte array containing the binary representation of a double-precision floating-point value. Must be at least 8 bytes in length. - Returns: A double-precision floating-point number represented by the specified byte array.
M:IoT.Driver.S7PlcRx.PlcTypes.LReal.FromByteArray(System.Byte[],System.Int32)
public static double FromByteArray(byte[] bytes, int start)
Converts a sequence of bytes from the specified array, starting at the given index, to a double-precision floating-point number.
- Parameter
bytes: The byte array containing the value to convert. - Parameter
start: The zero-based index in the array at which to begin reading the bytes. - Returns: A double-precision floating-point number represented by the specified bytes.
M:IoT.Driver.S7PlcRx.PlcTypes.LReal.FromDWord(System.Int32)
public static double FromDWord(int value)
Converts an S7 32-bit signed value to a double.
- Parameter
value: The 32-bit signed integer value in DWord format to convert. - Returns: A double-precision floating-point value that represents the specified DWord.
M:IoT.Driver.S7PlcRx.PlcTypes.LReal.FromDWord(System.UInt32)
public static double FromDWord(uint value)
Converts an unsigned 32-bit value to a double.
- Parameter
value: The 32-bit unsigned integer value to convert. - Returns: A double-precision floating-point number that represents the specified 32-bit unsigned integer.
M:IoT.Driver.S7PlcRx.PlcTypes.LReal.FromSpan(System.ReadOnlySpan1{System.Byte})`
public static double FromSpan(System.ReadOnlySpan<byte> bytes)
Executes the FromSpan operation.
- Parameter
bytes: Thebytesvalue. - Returns: A
doubleresult.
M:IoT.Driver.S7PlcRx.PlcTypes.LReal.ToArray(System.Byte[])
public static double[] ToArray(byte[] bytes)
Converts a byte array to an array of double-precision floating-point values.
- Parameter
bytes: The byte array to convert. The length must be a multiple of the size of a double (8 bytes). - Returns: An array of double values created from the input byte array.
M:IoT.Driver.S7PlcRx.PlcTypes.LReal.ToArray(System.ReadOnlySpan1{System.Byte})`
public static double[] ToArray(System.ReadOnlySpan<byte> bytes)
Executes the ToArray operation.
- Parameter
bytes: Thebytesvalue. - Returns: A
double[]result.
M:IoT.Driver.S7PlcRx.PlcTypes.LReal.ToByteArray(System.Double)
public static byte[] ToByteArray(double value)
Converts a double to its 8-byte representation.
- Parameter
value: The double-precision floating-point number to convert. - Returns: A byte array containing the 8-byte binary representation of the specified value.
M:IoT.Driver.S7PlcRx.PlcTypes.LReal.ToByteArray(System.Double[])
public static byte[] ToByteArray(double[] value)
Converts an array of double-precision floating-point numbers to a byte array representation.
- Parameter
value: The array of double values to convert. Cannot be null. - Returns: A byte array containing the binary representation of the input double array. The array will be empty if the input array is empty.
M:IoT.Driver.S7PlcRx.PlcTypes.LReal.ToSpan(System.Double,System.Span1{System.Byte})`
public static void ToSpan(double value, System.Span<byte> destination)
Executes the ToSpan operation.
- Parameter
value: Thevaluevalue. - Parameter
destination: Thedestinationvalue.
M:IoT.Driver.S7PlcRx.PlcTypes.LReal.ToSpan(System.ReadOnlySpan1{System.Double},System.Span1{System.Byte})
public static void ToSpan(System.ReadOnlySpan<double> values, System.Span<byte> destination)
Executes the ToSpan operation.
- Parameter
values: Thevaluesvalue. - Parameter
destination: Thedestinationvalue.
T:IoT.Driver.S7PlcRx.PlcTypes.Real
public class IoT.Driver.S7PlcRx.PlcTypes.Real
Provides static methods for converting between Siemens S7 Real (4-byte IEEE 754 floating-point) representations and .NET float values.
Declared public members
M:IoT.Driver.S7PlcRx.PlcTypes.Real.FromByteArray(System.Byte[])
public static float FromByteArray(byte[] bytes)
Converts a byte array to a single-precision floating-point value.
- Parameter
bytes: The byte array containing the bytes to convert. Must contain at least four bytes representing a 32-bit floating-point value in the expected format. - Returns: A single-precision floating-point value represented by the specified byte array.
M:IoT.Driver.S7PlcRx.PlcTypes.Real.FromSpan(System.ReadOnlySpan1{System.Byte})`
public static float FromSpan(System.ReadOnlySpan<byte> bytes)
Executes the FromSpan operation.
- Parameter
bytes: Thebytesvalue. - Returns: A
floatresult.
M:IoT.Driver.S7PlcRx.PlcTypes.Real.ToArray(System.Byte[])
public static float[] ToArray(byte[] bytes)
Converts a byte array to an array of single-precision floating-point values.
- Parameter
bytes: The byte array containing the binary representation of the floating-point values. The length must be a multiple of 4. - Returns: An array of
T:System.Singlevalues converted from the specified byte array.
M:IoT.Driver.S7PlcRx.PlcTypes.Real.ToArray(System.ReadOnlySpan1{System.Byte})`
public static float[] ToArray(System.ReadOnlySpan<byte> bytes)
Executes the ToArray operation.
- Parameter
bytes: Thebytesvalue. - Returns: A
float[]result.
M:IoT.Driver.S7PlcRx.PlcTypes.Real.ToByteArray(System.Single)
public static byte[] ToByteArray(float value)
Converts a float to its byte-array representation.
- Parameter
value: The single-precision floating-point value to convert. - Returns: A 4-byte array containing the binary representation of
value.
M:IoT.Driver.S7PlcRx.PlcTypes.Real.ToByteArray(System.Single[])
public static byte[] ToByteArray(float[] value)
Converts an array of single-precision floating-point values to a byte array.
- Parameter
value: The array ofT:System.Singlevalues to convert. Cannot be null. - Returns: A byte array containing the binary representation of the input values.
M:IoT.Driver.S7PlcRx.PlcTypes.Real.ToSpan(System.ReadOnlySpan1{System.Single},System.Span1{System.Byte})
public static void ToSpan(System.ReadOnlySpan<float> values, System.Span<byte> destination)
Executes the ToSpan operation.
- Parameter
values: Thevaluesvalue. - Parameter
destination: Thedestinationvalue.
M:IoT.Driver.S7PlcRx.PlcTypes.Real.ToSpan(System.Single,System.Span1{System.Byte})`
public static void ToSpan(float value, System.Span<byte> destination)
Executes the ToSpan operation.
- Parameter
value: Thevaluevalue. - Parameter
destination: Thedestinationvalue.
T:IoT.Driver.S7PlcRx.PlcTypes.S7String
public class IoT.Driver.S7PlcRx.PlcTypes.S7String
Encodes and decodes S7 strings in the S7 protocol format.
Declared public members
M:IoT.Driver.S7PlcRx.PlcTypes.S7String.FromByteArray(System.Byte[])
public static string FromByteArray(byte[] bytes)
Converts S7 bytes to a string.
- Parameter
bytes: The bytes. - Returns: A string.
M:IoT.Driver.S7PlcRx.PlcTypes.S7String.FromSpan(System.ReadOnlySpan1{System.Byte})`
public static string FromSpan(System.ReadOnlySpan<byte> bytes)
Executes the FromSpan operation.
- Parameter
bytes: Thebytesvalue. - Returns: A
stringresult.
M:IoT.Driver.S7PlcRx.PlcTypes.S7String.GetByteLength(System.Int32)
public static int GetByteLength(int reservedLength)
Gets the total byte length for an S7 string with the specified reserved length.
- Parameter
reservedLength: The reserved length for the string. - Returns: The total byte length including header.
M:IoT.Driver.S7PlcRx.PlcTypes.S7String.ToByteArray(System.String,System.Int32)
public static byte[] ToByteArray(string value, int reservedLength)
Converts a T:string to S7 string with 2-byte header.
- Parameter
value: The string to convert to byte array. - Parameter
reservedLength: The length (in characters) allocated in PLC for the string. - Returns: A
T:byte[]containing the string header and string value with a maximum length ofreservedLength+ 2.
M:IoT.Driver.S7PlcRx.PlcTypes.S7String.ToSpan(System.String,System.Int32,System.Span1{System.Byte})`
public static int ToSpan(string value, int reservedLength, System.Span<byte> destination)
Executes the ToSpan operation.
- Parameter
value: Thevaluevalue. - Parameter
reservedLength: ThereservedLengthvalue. - Parameter
destination: Thedestinationvalue. - Returns: A
intresult.
M:IoT.Driver.S7PlcRx.PlcTypes.S7String.TryToSpan(System.String,System.Int32,System.Span1{System.Byte},System.Int32@)`
public static bool TryToSpan(string value, int reservedLength, System.Span<byte> destination, out int bytesWritten)
Executes the TryToSpan operation.
- Parameter
value: Thevaluevalue. - Parameter
reservedLength: ThereservedLengthvalue. - Parameter
destination: Thedestinationvalue. - Parameter
bytesWritten: ThebytesWrittenvalue. - Returns: A
boolresult.
P:IoT.Driver.S7PlcRx.PlcTypes.S7String.StringEncoding
public System.Text.Encoding StringEncoding { get; set; }
Gets or sets the encoding used for S7String serialization.
- Value: The string encoding.
T:IoT.Driver.S7PlcRx.PlcTypes.S7StringAttribute
public class IoT.Driver.S7PlcRx.PlcTypes.S7StringAttribute
Maps a member to an S7 string with a reserved length.
Declared public members
M:IoT.Driver.S7PlcRx.PlcTypes.S7StringAttribute.#ctor(IoT.Driver.S7PlcRx.Enums.S7StringType,System.Int32)
public IoT.Driver.S7PlcRx.PlcTypes.S7StringAttribute(IoT.Driver.S7PlcRx.Enums.S7StringType type, int reservedLength)
Initializes a new instance of the T:IoT.Driver.S7PlcRx.PlcTypes.S7StringAttribute class.
- Parameter
type: The type of S7 string to use. Must be a defined value of the S7StringType enumeration. - Parameter
reservedLength: The reserved length for the string. Specifies the maximum number of characters the string can hold.
P:IoT.Driver.S7PlcRx.PlcTypes.S7StringAttribute.ReservedLength
public int ReservedLength { get; }
Gets the number of characters reserved for the value.
- Value: The
ReservedLengthvalue.
P:IoT.Driver.S7PlcRx.PlcTypes.S7StringAttribute.ReservedLengthInBytes
public int ReservedLengthInBytes { get; }
Gets the total bytes reserved for the string.
- Value: The
ReservedLengthInBytesvalue.
P:IoT.Driver.S7PlcRx.PlcTypes.S7StringAttribute.Type
public IoT.Driver.S7PlcRx.Enums.S7StringType Type { get; }
Gets the type of the S7 string represented by this instance.
- Value: The
Typevalue.
T:IoT.Driver.S7PlcRx.PlcTypes.S7WString
public class IoT.Driver.S7PlcRx.PlcTypes.S7WString
Provides static methods for converting between S7 WString byte arrays and .NET strings.
Declared public members
M:IoT.Driver.S7PlcRx.PlcTypes.S7WString.FromByteArray(System.Byte[])
public static string FromByteArray(byte[] bytes)
Decodes an S7 WString byte array to a .NET string.
- Parameter
bytes: The byte array containing the S7 WString data, including the 4-byte header. Must not be null and must have a length of at least 4 bytes. - Returns: A string representing the decoded S7 WString value from the specified byte array.
M:IoT.Driver.S7PlcRx.PlcTypes.S7WString.ToByteArray(System.String,System.Int32)
public static byte[] ToByteArray(string value, int reservedLength)
Encodes a string as big-endian Unicode with a length prefix.
- Parameter
value: The string to convert to a byte array. Cannot be null. - Parameter
reservedLength: The number of characters to reserve in the output buffer. Must be less than or equal to 16,382 and greater than or equal to the length ofvalue. - Returns: A byte array containing a 4-byte header followed by the big-endian Unicode bytes of the string, padded to the reserved length if necessary.
T:IoT.Driver.S7PlcRx.PlcTypes.String
public class IoT.Driver.S7PlcRx.PlcTypes.String
Provides utility methods for converting between strings and byte arrays using ASCII encoding.
Declared public members
M:IoT.Driver.S7PlcRx.PlcTypes.String.FromByteArray(System.Byte[])
public static string FromByteArray(byte[] bytes)
Decodes a UTF-8 encoded byte array into a string.
- Parameter
bytes: The byte array containing the UTF-8 encoded text to decode. Cannot be null. - Returns: A string representation of the decoded UTF-8 text. Returns an empty string if the array is empty.
M:IoT.Driver.S7PlcRx.PlcTypes.String.FromByteArray(System.Byte[],System.Int32,System.Int32)
public static string FromByteArray(byte[] bytes, int start, int length)
Converts a specified range of bytes from a byte array to a string.
- Parameter
bytes: The byte array containing the data to convert. - Parameter
start: The zero-based index in the array at which to begin conversion. - Parameter
length: The number of bytes to convert starting fromstart. - Returns: A string representation of the specified range of bytes, or an empty string if the range exceeds the bounds of the array.
M:IoT.Driver.S7PlcRx.PlcTypes.String.FromSpan(System.ReadOnlySpan1{System.Byte})`
public static string FromSpan(System.ReadOnlySpan<byte> bytes)
Executes the FromSpan operation.
- Parameter
bytes: Thebytesvalue. - Returns: A
stringresult.
M:IoT.Driver.S7PlcRx.PlcTypes.String.ToByteArray(System.String)
public static byte[] ToByteArray(string value)
Converts the specified string to a byte array using ASCII encoding.
- Parameter
value: The string to convert to a byte array. If null or empty, an empty array is returned. - Returns: A byte array containing the ASCII-encoded bytes of the input string, or an empty array if the input is null or empty.
M:IoT.Driver.S7PlcRx.PlcTypes.String.ToSpan(System.String,System.Span1{System.Byte})`
public static int ToSpan(string value, System.Span<byte> destination)
Executes the ToSpan operation.
- Parameter
value: Thevaluevalue. - Parameter
destination: Thedestinationvalue. - Returns: A
intresult.
M:IoT.Driver.S7PlcRx.PlcTypes.String.TryToSpan(System.String,System.Span1{System.Byte},System.Int32@)`
public static bool TryToSpan(string value, System.Span<byte> destination, out int bytesWritten)
Executes the TryToSpan operation.
- Parameter
value: Thevaluevalue. - Parameter
destination: Thedestinationvalue. - Parameter
bytesWritten: ThebytesWrittenvalue. - Returns: A
boolresult.
T:IoT.Driver.S7PlcRx.PlcTypes.Struct
public class IoT.Driver.S7PlcRx.PlcTypes.Struct
Provides utility methods for working with struct types, including calculating their size in bytes and converting between structs and byte arrays.
Declared public members
M:IoT.Driver.S7PlcRx.PlcTypes.Struct.FromBytes(System.Type,System.Byte[])
public static object FromBytes(System.Type structType, byte[] bytes)
Deserializes a byte array into an instance of the specified structure type.
- Parameter
structType: The type of the structure to deserialize the byte array into. Must be a type with a parameterless constructor and supported field types. - Parameter
bytes: The byte array containing the serialized data for the structure. The length must match the expected size of the structure. - Returns: An object representing the deserialized structure, or null if the byte array is null or does not match the expected size.
M:IoT.Driver.S7PlcRx.PlcTypes.Struct.GetStructSize(System.Type)
public static int GetStructSize(System.Type structType)
Calculates the total size, in bytes, required to store an instance of the specified struct type, based on its fields and their types.
- Parameter
structType: The type of the struct for which to calculate the size. Must not be null. - Returns: The total size, in bytes, needed to represent an instance of the specified struct type.
M:IoT.Driver.S7PlcRx.PlcTypes.Struct.ToBytes(System.Object)
public static byte[] ToBytes(object structValue)
Converts the specified structure object to its byte array representation.
- Parameter
structValue: The structure object to convert to a byte array. Must not be null. The object's fields must be of supported types. - Returns: A byte array containing the serialized representation of the structure. Returns an empty array if
structValueis null.
T:IoT.Driver.S7PlcRx.PlcTypes.TimeSpan
public class IoT.Driver.S7PlcRx.PlcTypes.TimeSpan
Converts between S7 PLC time values and .NET TimeSpan values.
Declared public members
F:IoT.Driver.S7PlcRx.PlcTypes.TimeSpan.SpecMaximumTimeSpan
public static System.TimeSpan SpecMaximumTimeSpan
Represents the maximum allowable time span for specification purposes, set to the largest value expressible in milliseconds as an integer.
F:IoT.Driver.S7PlcRx.PlcTypes.TimeSpan.SpecMinimumTimeSpan
public static System.TimeSpan SpecMinimumTimeSpan
Gets the minimum S7 time value.
F:IoT.Driver.S7PlcRx.PlcTypes.TimeSpan.TypeLengthInBytes
public static int TypeLengthInBytes
The size, in bytes, of the type.
M:IoT.Driver.S7PlcRx.PlcTypes.TimeSpan.FromByteArray(System.Byte[])
public static System.TimeSpan FromByteArray(byte[] bytes)
Creates a TimeSpan structure from its binary representation in a byte array.
- Parameter
bytes: A byte array containing the binary representation of a TimeSpan. The array must be at least 8 bytes in length and encoded in the expected format. - Returns: A TimeSpan value represented by the specified byte array.
M:IoT.Driver.S7PlcRx.PlcTypes.TimeSpan.FromSpan(System.ReadOnlySpan1{System.Byte})`
public static System.TimeSpan FromSpan(System.ReadOnlySpan<byte> bytes)
Executes the FromSpan operation.
- Parameter
bytes: Thebytesvalue. - Returns: A
System.TimeSpanresult.
M:IoT.Driver.S7PlcRx.PlcTypes.TimeSpan.ToArray(System.Byte[])
public static System.TimeSpan[] ToArray(byte[] bytes)
Converts a byte array to an array of T:System.TimeSpan values.
- Parameter
bytes: The byte array containing the binary representation of one or moreT:System.TimeSpanvalues. The array length must be a multiple of the size of aT:System.TimeSpanstructure. - Returns: An array of
T:System.TimeSpanvalues deserialized from the specified byte array.
M:IoT.Driver.S7PlcRx.PlcTypes.TimeSpan.ToArray(System.ReadOnlySpan1{System.Byte})`
public static System.TimeSpan[] ToArray(System.ReadOnlySpan<byte> bytes)
Executes the ToArray operation.
- Parameter
bytes: Thebytesvalue. - Returns: A
System.TimeSpan[]result.
M:IoT.Driver.S7PlcRx.PlcTypes.TimeSpan.ToByteArray(System.TimeSpan)
public static byte[] ToByteArray(System.TimeSpan timeSpan)
Converts a TimeSpan to its S7 byte representation.
- Parameter
timeSpan: TheT:System.TimeSpanvalue to convert to a byte array. - Returns: A byte array containing the binary representation of the specified
T:System.TimeSpanvalue.
M:IoT.Driver.S7PlcRx.PlcTypes.TimeSpan.ToByteArray(System.TimeSpan[])
public static byte[] ToByteArray(System.TimeSpan[] timeSpans)
Converts an array of T:System.TimeSpan values to a byte array representation.
- Parameter
timeSpans: An array ofT:System.TimeSpanvalues to convert. Cannot be null. - Returns: A byte array containing the serialized representation of the input
T:System.TimeSpanvalues. The length of the array is proportional to the number of elements intimeSpans.
M:IoT.Driver.S7PlcRx.PlcTypes.TimeSpan.ToSpan(System.ReadOnlySpan1{System.TimeSpan},System.Span1{System.Byte})
public static void ToSpan(System.ReadOnlySpan<System.TimeSpan> timeSpans, System.Span<byte> destination)
Executes the ToSpan operation.
- Parameter
timeSpans: ThetimeSpansvalue. - Parameter
destination: Thedestinationvalue.
M:IoT.Driver.S7PlcRx.PlcTypes.TimeSpan.ToSpan(System.TimeSpan,System.Span1{System.Byte})`
public static void ToSpan(System.TimeSpan timeSpan, System.Span<byte> destination)
Executes the ToSpan operation.
- Parameter
timeSpan: ThetimeSpanvalue. - Parameter
destination: Thedestinationvalue.
T:IoT.Driver.S7PlcRx.PlcTypes.Timer
public class IoT.Driver.S7PlcRx.PlcTypes.Timer
Converts between S7 Timer bytes and .NET numeric types.
Declared public members
M:IoT.Driver.S7PlcRx.PlcTypes.Timer.FromByteArray(System.Byte[])
public static double FromByteArray(byte[] bytes)
Converts a byte array to a double-precision floating-point number.
- Parameter
bytes: The byte array containing the bytes to convert. Must represent a valid double value in the expected byte order. - Returns: A double-precision floating-point number represented by the specified byte array.
M:IoT.Driver.S7PlcRx.PlcTypes.Timer.FromByteArray(System.Byte[],System.Int32)
public static double FromByteArray(byte[] bytes, int start)
Converts a sequence of bytes from the specified array, starting at the given index, to a double-precision floating-point number.
- Parameter
bytes: The byte array containing the value to convert. - Parameter
start: The zero-based index in the array at which to begin reading the bytes. - Returns: A double-precision floating-point number represented by the eight bytes starting at the specified index in the array.
M:IoT.Driver.S7PlcRx.PlcTypes.Timer.FromByteArray(System.ReadOnlySpan1{System.Byte},System.Int32)`
public static double FromByteArray(System.ReadOnlySpan<byte> bytes, int start)
Executes the FromByteArray operation.
- Parameter
bytes: Thebytesvalue. - Parameter
start: Thestartvalue. - Returns: A
doubleresult.
M:IoT.Driver.S7PlcRx.PlcTypes.Timer.FromSpan(System.ReadOnlySpan1{System.Byte})`
public static double FromSpan(System.ReadOnlySpan<byte> bytes)
Executes the FromSpan operation.
- Parameter
bytes: Thebytesvalue. - Returns: A
doubleresult.
M:IoT.Driver.S7PlcRx.PlcTypes.Timer.ToArray(System.Byte[])
public static double[] ToArray(byte[] bytes)
Converts a byte array to an array of double-precision floating-point values.
- Parameter
bytes: The byte array to convert. The length must be a multiple of the size of a double (8 bytes). - Returns: An array of double values created from the input byte array.
M:IoT.Driver.S7PlcRx.PlcTypes.Timer.ToArray(System.ReadOnlySpan1{System.Byte})`
public static double[] ToArray(System.ReadOnlySpan<byte> bytes)
Executes the ToArray operation.
- Parameter
bytes: Thebytesvalue. - Returns: A
double[]result.
M:IoT.Driver.S7PlcRx.PlcTypes.Timer.ToByteArray(System.UInt16)
public static byte[] ToByteArray(ushort value)
Converts the specified 16-bit unsigned integer to a byte array.
- Parameter
value: The 16-bit unsigned integer to convert to a byte array. - Returns: A byte array containing the two bytes of the specified value in platform endianness.
M:IoT.Driver.S7PlcRx.PlcTypes.Timer.ToByteArray(System.UInt16[])
public static byte[] ToByteArray(ushort[] value)
Converts an array of 16-bit unsigned integers to a byte array.
- Parameter
value: The array of 16-bit unsigned integers to convert. Cannot be null. - Returns: A byte array containing the binary representation of the input values.
M:IoT.Driver.S7PlcRx.PlcTypes.Timer.ToSpan(System.ReadOnlySpan1{System.UInt16},System.Span1{System.Byte})
public static void ToSpan(System.ReadOnlySpan<ushort> values, System.Span<byte> destination)
Executes the ToSpan operation.
- Parameter
values: Thevaluesvalue. - Parameter
destination: Thedestinationvalue.
M:IoT.Driver.S7PlcRx.PlcTypes.Timer.ToSpan(System.UInt16,System.Span1{System.Byte})`
public static void ToSpan(ushort value, System.Span<byte> destination)
Executes the ToSpan operation.
- Parameter
value: Thevaluevalue. - Parameter
destination: Thedestinationvalue.
T:IoT.Driver.S7PlcRx.PlcTypes.Word
public class IoT.Driver.S7PlcRx.PlcTypes.Word
Provides utility methods for converting between 16-bit unsigned integers (words) and their byte array or span representations, using big-endian (high byte first) byte order.
Declared public members
M:IoT.Driver.S7PlcRx.PlcTypes.Word.FromByteArray(System.Byte[])
public static ushort FromByteArray(byte[] bytes)
Creates a 16-bit unsigned integer from a byte array.
- Parameter
bytes: The byte array containing the bytes to convert. Must contain at least two elements. - Returns: A 16-bit unsigned integer represented by the first two bytes of the array.
M:IoT.Driver.S7PlcRx.PlcTypes.Word.FromByteArray(System.Byte[],System.Int32)
public static ushort FromByteArray(byte[] bytes, int start)
Creates a 16-bit unsigned integer from a byte array starting at the specified index.
- Parameter
bytes: The byte array containing the data to convert. - Parameter
start: The zero-based index in the array at which to begin reading the value. - Returns: A 16-bit unsigned integer formed from the specified bytes.
M:IoT.Driver.S7PlcRx.PlcTypes.Word.FromBytes(System.Byte,System.Byte)
public static ushort FromBytes(byte lowValue, byte highValue)
Creates an unsigned 16-bit value from low and high bytes.
- Parameter
lowValue: The low-order byte of the resulting 16-bit unsigned integer. - Parameter
highValue: The high-order byte of the resulting 16-bit unsigned integer. - Returns: A 16-bit unsigned integer composed from the specified low and high bytes.
M:IoT.Driver.S7PlcRx.PlcTypes.Word.FromSpan(System.ReadOnlySpan1{System.Byte})`
public static ushort FromSpan(System.ReadOnlySpan<byte> bytes)
Executes the FromSpan operation.
- Parameter
bytes: Thebytesvalue. - Returns: A
ushortresult.
M:IoT.Driver.S7PlcRx.PlcTypes.Word.ToArray(System.Byte[])
public static ushort[] ToArray(byte[] bytes)
Converts a byte array to an array of 16-bit unsigned integers.
- Parameter
bytes: The byte array to convert. The length must be a multiple of 2. - Returns: An array of 16-bit unsigned integers representing the converted values from the input byte array.
M:IoT.Driver.S7PlcRx.PlcTypes.Word.ToArray(System.ReadOnlySpan1{System.Byte})`
public static ushort[] ToArray(System.ReadOnlySpan<byte> bytes)
Executes the ToArray operation.
- Parameter
bytes: Thebytesvalue. - Returns: A
ushort[]result.
M:IoT.Driver.S7PlcRx.PlcTypes.Word.ToByteArray(System.UInt16)
public static byte[] ToByteArray(ushort value)
Converts the specified 16-bit unsigned integer to a byte array.
- Parameter
value: The 16-bit unsigned integer to convert. - Returns: A byte array containing the bytes of the specified value in little-endian order.
M:IoT.Driver.S7PlcRx.PlcTypes.Word.ToByteArray(System.UInt16,System.Array,System.Int32)
public static void ToByteArray(ushort value, System.Array destination, int start)
Copies the byte representation of the specified 16-bit unsigned integer into the given array starting at the specified index.
- Parameter
value: The 16-bit unsigned integer to convert to bytes. - Parameter
destination: The array that will receive the bytes representing the value. Must have sufficient space to accommodate two bytes starting at the specified index. - Parameter
start: The zero-based index in the destination array at which to begin copying the bytes.
M:IoT.Driver.S7PlcRx.PlcTypes.Word.ToByteArray(System.UInt16[])
public static byte[] ToByteArray(ushort[] value)
Converts an array of 16-bit unsigned integers to a byte array.
- Parameter
value: The array of 16-bit unsigned integers to convert. Cannot be null. - Returns: A byte array containing the binary representation of the input values.
M:IoT.Driver.S7PlcRx.PlcTypes.Word.ToSpan(System.ReadOnlySpan1{System.UInt16},System.Span1{System.Byte})
public static void ToSpan(System.ReadOnlySpan<ushort> values, System.Span<byte> destination)
Executes the ToSpan operation.
- Parameter
values: Thevaluesvalue. - Parameter
destination: Thedestinationvalue.
M:IoT.Driver.S7PlcRx.PlcTypes.Word.ToSpan(System.UInt16,System.Span1{System.Byte})`
public static void ToSpan(ushort value, System.Span<byte> destination)
Executes the ToSpan operation.
- Parameter
value: Thevaluevalue. - Parameter
destination: Thedestinationvalue.
T:IoT.Driver.S7PlcRx.Production.CircuitBreaker
public class IoT.Driver.S7PlcRx.Production.CircuitBreaker
Provides a thread-safe circuit breaker that prevents repeated failing operations.
Declared public members
M:IoT.Driver.S7PlcRx.Production.CircuitBreaker.#ctor(IoT.Driver.S7PlcRx.Production.ProductionErrorConfig,System.TimeProvider)
public IoT.Driver.S7PlcRx.Production.CircuitBreaker(IoT.Driver.S7PlcRx.Production.ProductionErrorConfig config, System.TimeProvider timeProvider)
Provides a thread-safe circuit breaker that prevents repeated failing operations.
- Parameter
config: The configuration settings that control circuit-breaker thresholds, retry behavior, and timeouts. - Parameter
timeProvider: The time provider; defaults toP:System.TimeProvider.System.
M:IoT.Driver.S7PlcRx.Production.CircuitBreaker.ExecuteAsync``1(System.Func1{System.Threading.Tasks.Task1{``0}})
public System.Threading.Tasks.Task<T> ExecuteAsync<T>(System.Func<System.Threading.Tasks.Task<T>> operation)
Executes the ExecuteAsync operation.
- Parameter
operation: Theoperationvalue. - Returns: A
System.Threading.Tasks.Task<T>result.
P:IoT.Driver.S7PlcRx.Production.CircuitBreaker.FailedOperations
public long FailedOperations { get; }
Gets the total number of operations that have failed.
- Value: The
FailedOperationsvalue.
P:IoT.Driver.S7PlcRx.Production.CircuitBreaker.State
public IoT.Driver.S7PlcRx.Production.CircuitBreakerState State { get; }
Gets the current state of the circuit breaker.
- Value: The
Statevalue.
P:IoT.Driver.S7PlcRx.Production.CircuitBreaker.SuccessRate
public double SuccessRate { get; }
Gets the percentage of operations that completed successfully.
- Value: The
SuccessRatevalue.
P:IoT.Driver.S7PlcRx.Production.CircuitBreaker.SuccessfulOperations
public long SuccessfulOperations { get; }
Gets the total number of operations that have completed successfully.
- Value: The
SuccessfulOperationsvalue.
P:IoT.Driver.S7PlcRx.Production.CircuitBreaker.TotalOperations
public long TotalOperations { get; }
Gets the total number of operations that have been performed.
- Value: The
TotalOperationsvalue.
T:IoT.Driver.S7PlcRx.Production.CircuitBreakerState
public enum IoT.Driver.S7PlcRx.Production.CircuitBreakerState
Specifies the operational state of a circuit breaker.
Declared public members
F:IoT.Driver.S7PlcRx.Production.CircuitBreakerState.Closed
public static const IoT.Driver.S7PlcRx.Production.CircuitBreakerState Closed
Circuit is closed (normal operation).
F:IoT.Driver.S7PlcRx.Production.CircuitBreakerState.HalfOpen
public static const IoT.Driver.S7PlcRx.Production.CircuitBreakerState HalfOpen
Circuit is half-open (testing recovery).
F:IoT.Driver.S7PlcRx.Production.CircuitBreakerState.Open
public static const IoT.Driver.S7PlcRx.Production.CircuitBreakerState Open
Circuit is open (blocking operations).
T:IoT.Driver.S7PlcRx.Production.ProductionDiagnostics
public class IoT.Driver.S7PlcRx.Production.ProductionDiagnostics
Represents diagnostic information collected from a production programmable logic controller (PLC) connection, including connection details, performance metrics, and recommendations.
Declared public members
M:IoT.Driver.S7PlcRx.Production.ProductionDiagnostics.#ctor
public IoT.Driver.S7PlcRx.Production.ProductionDiagnostics()
Initializes a new instance of IoT.Driver.S7PlcRx.Production.ProductionDiagnostics.
P:IoT.Driver.S7PlcRx.Production.ProductionDiagnostics.CPUInformation
public System.Collections.Generic.List<string> CPUInformation { get; }
Gets or sets the CPU information.
- Value: The
CPUInformationvalue.
P:IoT.Driver.S7PlcRx.Production.ProductionDiagnostics.ConnectionLatencyMs
public double ConnectionLatencyMs { get; set; }
Gets or sets the connection latency in milliseconds.
- Value: The
ConnectionLatencyMsvalue.
P:IoT.Driver.S7PlcRx.Production.ProductionDiagnostics.DiagnosticTime
public System.DateTimeOffset DiagnosticTime { get; set; }
Gets or sets when diagnostics were collected.
- Value: The
DiagnosticTimevalue.
P:IoT.Driver.S7PlcRx.Production.ProductionDiagnostics.Errors
public System.Collections.Generic.List<string> Errors { get; }
Gets or sets any errors encountered during diagnostics.
- Value: The
Errorsvalue.
P:IoT.Driver.S7PlcRx.Production.ProductionDiagnostics.IPAddress
public string IPAddress { get; set; }
Gets or sets the IP address.
- Value: The
IPAddressvalue.
P:IoT.Driver.S7PlcRx.Production.ProductionDiagnostics.IsConnected
public bool IsConnected { get; set; }
Gets or sets a value indicating whether gets or sets the connection status.
- Value: The
IsConnectedvalue.
P:IoT.Driver.S7PlcRx.Production.ProductionDiagnostics.PLCType
public IoT.Driver.S7PlcRx.Enums.CpuType PLCType { get; set; }
Gets or sets the PLC type.
- Value: The
PLCTypevalue.
P:IoT.Driver.S7PlcRx.Production.ProductionDiagnostics.Rack
public short Rack { get; set; }
Gets or sets the rack number.
- Value: The
Rackvalue.
P:IoT.Driver.S7PlcRx.Production.ProductionDiagnostics.Recommendations
public System.Collections.Generic.List<string> Recommendations { get; }
Gets or sets the optimization recommendations.
- Value: The
Recommendationsvalue.
P:IoT.Driver.S7PlcRx.Production.ProductionDiagnostics.Slot
public short Slot { get; set; }
Gets or sets the slot number.
- Value: The
Slotvalue.
P:IoT.Driver.S7PlcRx.Production.ProductionDiagnostics.TagMetrics
public IoT.Driver.S7PlcRx.Production.ProductionTagMetrics TagMetrics { get; set; }
Gets or sets the tag metrics.
- Value: The
TagMetricsvalue.
T:IoT.Driver.S7PlcRx.Production.ProductionErrorConfig
public class IoT.Driver.S7PlcRx.Production.ProductionErrorConfig
Represents production error-handling and retry configuration.
Declared public members
M:IoT.Driver.S7PlcRx.Production.ProductionErrorConfig.#ctor
public IoT.Driver.S7PlcRx.Production.ProductionErrorConfig()
Initializes a new instance of IoT.Driver.S7PlcRx.Production.ProductionErrorConfig.
P:IoT.Driver.S7PlcRx.Production.ProductionErrorConfig.BaseRetryDelayMs
public int BaseRetryDelayMs { get; set; }
Gets or sets the base retry delay in milliseconds.
- Value: The
BaseRetryDelayMsvalue.
P:IoT.Driver.S7PlcRx.Production.ProductionErrorConfig.CircuitBreakerThreshold
public int CircuitBreakerThreshold { get; set; }
Gets or sets the circuit breaker failure threshold.
- Value: The
CircuitBreakerThresholdvalue.
P:IoT.Driver.S7PlcRx.Production.ProductionErrorConfig.CircuitBreakerTimeout
public System.TimeSpan CircuitBreakerTimeout { get; set; }
Gets or sets the circuit breaker timeout.
- Value: The
CircuitBreakerTimeoutvalue.
P:IoT.Driver.S7PlcRx.Production.ProductionErrorConfig.MaxRetryAttempts
public int MaxRetryAttempts { get; set; }
Gets or sets the maximum retry attempts.
- Value: The
MaxRetryAttemptsvalue.
P:IoT.Driver.S7PlcRx.Production.ProductionErrorConfig.UseExponentialBackoff
public bool UseExponentialBackoff { get; set; }
Gets or sets a value indicating whether gets or sets whether to use exponential backoff.
- Value: The
UseExponentialBackoffvalue.
T:IoT.Driver.S7PlcRx.Production.ProductionErrorHandler
public class IoT.Driver.S7PlcRx.Production.ProductionErrorHandler
Provides error handling for production environments by executing operations with circuit breaker protection and configurable error handling policies.
Declared public members
M:IoT.Driver.S7PlcRx.Production.ProductionErrorHandler.#ctor(IoT.Driver.S7PlcRx.Production.ProductionErrorConfig)
public IoT.Driver.S7PlcRx.Production.ProductionErrorHandler(IoT.Driver.S7PlcRx.Production.ProductionErrorConfig config)
Provides error handling for production environments by executing operations with circuit breaker protection and configurable error handling policies.
- Parameter
config: The non-null settings that define error handling, circuit breaking, and retries.
M:IoT.Driver.S7PlcRx.Production.ProductionErrorHandler.ExecuteAsync``1(System.Func1{System.Threading.Tasks.Task1{``0}})
public System.Threading.Tasks.Task<T> ExecuteAsync<T>(System.Func<System.Threading.Tasks.Task<T>> operation)
Executes the ExecuteAsync operation.
- Parameter
operation: Theoperationvalue. - Returns: A
System.Threading.Tasks.Task<T>result.
T:IoT.Driver.S7PlcRx.Production.ProductionExtensions
public class IoT.Driver.S7PlcRx.Production.ProductionExtensions
Provides extension methods for enabling production-grade error handling, retry logic, and system validation on PLC instances using the circuit breaker pattern.
Declared public members
M:IoT.Driver.S7PlcRx.Production.ProductionExtensions.EnableProductionErrorHandling(IoT.Driver.S7PlcRx.IRxS7,IoT.Driver.S7PlcRx.Production.ProductionErrorConfig)
public static IoT.Driver.S7PlcRx.Production.ProductionErrorHandler EnableProductionErrorHandling(IoT.Driver.S7PlcRx.IRxS7 plc, IoT.Driver.S7PlcRx.Production.ProductionErrorConfig config)
Enables production error handling for the specified PLC using the provided configuration.
- Parameter
plc: The PLC instance. - Parameter
config: The configuration settings to use for production error handling. - Returns: A new instance of
T:IoT.Driver.S7PlcRx.Production.ProductionErrorHandlerconfigured for the specified PLC.
M:IoT.Driver.S7PlcRx.Production.ProductionExtensions.ExecuteWithErrorHandlingAsync``1(IoT.Driver.S7PlcRx.IRxS7,System.Func1{System.Threading.Tasks.Task1{``0}})
public static System.Threading.Tasks.Task<T> ExecuteWithErrorHandlingAsync<T>(IoT.Driver.S7PlcRx.IRxS7 plc, System.Func<System.Threading.Tasks.Task<T>> operation)
Executes the ExecuteWithErrorHandlingAsync operation.
- Parameter
plc: Theplcvalue. - Parameter
operation: Theoperationvalue. - Returns: A
System.Threading.Tasks.Task<T>result.
M:IoT.Driver.S7PlcRx.Production.ProductionExtensions.ExecuteWithErrorHandlingAsync``1(IoT.Driver.S7PlcRx.IRxS7,System.Func1{System.Threading.Tasks.Task1{``0}},IoT.Driver.S7PlcRx.Production.ProductionErrorConfig)
public static System.Threading.Tasks.Task<T> ExecuteWithErrorHandlingAsync<T>(IoT.Driver.S7PlcRx.IRxS7 plc, System.Func<System.Threading.Tasks.Task<T>> operation, IoT.Driver.S7PlcRx.Production.ProductionErrorConfig config)
Executes the ExecuteWithErrorHandlingAsync operation.
- Parameter
plc: Theplcvalue. - Parameter
operation: Theoperationvalue. - Parameter
config: Theconfigvalue. - Returns: A
System.Threading.Tasks.Task<T>result.
M:IoT.Driver.S7PlcRx.Production.ProductionExtensions.ValidateProductionReadinessAsync(IoT.Driver.S7PlcRx.IRxS7)
public static System.Threading.Tasks.Task<IoT.Driver.S7PlcRx.Production.SystemValidationResult> ValidateProductionReadinessAsync(IoT.Driver.S7PlcRx.IRxS7 plc)
Validates production readiness using the default validation configuration.
- Parameter
plc: The PLC instance. - Returns: A task that represents the asynchronous operation.
M:IoT.Driver.S7PlcRx.Production.ProductionExtensions.ValidateProductionReadinessAsync(IoT.Driver.S7PlcRx.IRxS7,IoT.Driver.S7PlcRx.Production.ProductionValidationConfig)
public static System.Threading.Tasks.Task<IoT.Driver.S7PlcRx.Production.SystemValidationResult> ValidateProductionReadinessAsync(IoT.Driver.S7PlcRx.IRxS7 plc, IoT.Driver.S7PlcRx.Production.ProductionValidationConfig validationConfig)
Validates whether the PLC is ready for production deployment.
- Parameter
plc: The PLC instance. - Parameter
validationConfig: The validation parameters and thresholds. - Returns: A task that represents the asynchronous operation.
M:IoT.Driver.S7PlcRx.Production.ProductionExtensions.ValidateProductionReadinessAsync(IoT.Driver.S7PlcRx.IRxS7,IoT.Driver.S7PlcRx.Production.ProductionValidationConfig,System.TimeProvider)
public static System.Threading.Tasks.Task<IoT.Driver.S7PlcRx.Production.SystemValidationResult> ValidateProductionReadinessAsync(IoT.Driver.S7PlcRx.IRxS7 plc, IoT.Driver.S7PlcRx.Production.ProductionValidationConfig validationConfig, System.TimeProvider timeProvider)
Validates whether the PLC is ready for production deployment.
- Parameter
plc: The PLC instance. - Parameter
validationConfig: The validation parameters and thresholds. - Parameter
timeProvider: The time provider. - Returns: A task that represents the asynchronous operation.
T:IoT.Driver.S7PlcRx.Production.ProductionMetrics
public class IoT.Driver.S7PlcRx.Production.ProductionMetrics
Represents a set of metrics related to the monitoring and connectivity status of a PLC (Programmable Logic Controller) over a specified period.
Declared public members
M:IoT.Driver.S7PlcRx.Production.ProductionMetrics.#ctor
public IoT.Driver.S7PlcRx.Production.ProductionMetrics()
Initializes a new instance of IoT.Driver.S7PlcRx.Production.ProductionMetrics.
P:IoT.Driver.S7PlcRx.Production.ProductionMetrics.ActiveTagCount
public int ActiveTagCount { get; set; }
Gets or sets the number of active tags.
- Value: The
ActiveTagCountvalue.
P:IoT.Driver.S7PlcRx.Production.ProductionMetrics.ConnectedTime
public System.TimeSpan ConnectedTime { get; set; }
Gets or sets the total connected time.
- Value: The
ConnectedTimevalue.
P:IoT.Driver.S7PlcRx.Production.ProductionMetrics.DisconnectedTime
public System.TimeSpan DisconnectedTime { get; set; }
Gets or sets the total disconnected time.
- Value: The
DisconnectedTimevalue.
P:IoT.Driver.S7PlcRx.Production.ProductionMetrics.IsConnected
public bool IsConnected { get; set; }
Gets or sets a value indicating whether gets or sets whether the PLC is currently connected.
- Value: The
IsConnectedvalue.
P:IoT.Driver.S7PlcRx.Production.ProductionMetrics.LastUpdateTime
public System.DateTimeOffset LastUpdateTime { get; set; }
Gets or sets the last update time.
- Value: The
LastUpdateTimevalue.
P:IoT.Driver.S7PlcRx.Production.ProductionMetrics.PLCIdentifier
public string PLCIdentifier { get; set; }
Gets or sets the PLC identifier.
- Value: The
PLCIdentifiervalue.
P:IoT.Driver.S7PlcRx.Production.ProductionMetrics.StartTime
public System.DateTimeOffset StartTime { get; set; }
Gets or sets when monitoring started.
- Value: The
StartTimevalue.
P:IoT.Driver.S7PlcRx.Production.ProductionMetrics.TotalTagCount
public int TotalTagCount { get; set; }
Gets or sets the total number of tags.
- Value: The
TotalTagCountvalue.
P:IoT.Driver.S7PlcRx.Production.ProductionMetrics.UptimePercentage
public double UptimePercentage { get; set; }
Gets or sets the uptime percentage.
- Value: The
UptimePercentagevalue.
T:IoT.Driver.S7PlcRx.Production.ProductionTagMetrics
public class IoT.Driver.S7PlcRx.Production.ProductionTagMetrics
Represents aggregate production-tag metrics.
Declared public members
M:IoT.Driver.S7PlcRx.Production.ProductionTagMetrics.#ctor
public IoT.Driver.S7PlcRx.Production.ProductionTagMetrics()
Initializes a new instance of IoT.Driver.S7PlcRx.Production.ProductionTagMetrics.
P:IoT.Driver.S7PlcRx.Production.ProductionTagMetrics.ActiveTags
public int ActiveTags { get; set; }
Gets or sets the number of active tags.
- Value: The
ActiveTagsvalue.
P:IoT.Driver.S7PlcRx.Production.ProductionTagMetrics.DataBlockDistribution
public System.Collections.Generic.Dictionary<string, int> DataBlockDistribution { get; }
Gets or sets the distribution of tags by data block.
- Value: The
DataBlockDistributionvalue.
P:IoT.Driver.S7PlcRx.Production.ProductionTagMetrics.InactiveTags
public int InactiveTags { get; set; }
Gets or sets the number of inactive tags.
- Value: The
InactiveTagsvalue.
P:IoT.Driver.S7PlcRx.Production.ProductionTagMetrics.TotalTags
public int TotalTags { get; set; }
Gets or sets the total number of tags.
- Value: The
TotalTagsvalue.
T:IoT.Driver.S7PlcRx.Production.ProductionValidationConfig
public class IoT.Driver.S7PlcRx.Production.ProductionValidationConfig
Represents configuration settings for validating production system performance and reliability.
Declared public members
M:IoT.Driver.S7PlcRx.Production.ProductionValidationConfig.#ctor
public IoT.Driver.S7PlcRx.Production.ProductionValidationConfig()
Initializes a new instance of IoT.Driver.S7PlcRx.Production.ProductionValidationConfig.
P:IoT.Driver.S7PlcRx.Production.ProductionValidationConfig.MaxAcceptableResponseTime
public System.TimeSpan MaxAcceptableResponseTime { get; set; }
Gets or sets the maximum acceptable response time.
- Value: The
MaxAcceptableResponseTimevalue.
P:IoT.Driver.S7PlcRx.Production.ProductionValidationConfig.MinimumProductionScore
public double MinimumProductionScore { get; set; }
Gets or sets the minimum production score (0 to 100).
- Value: The
MinimumProductionScorevalue.
P:IoT.Driver.S7PlcRx.Production.ProductionValidationConfig.MinimumReliabilityRate
public double MinimumReliabilityRate { get; set; }
Gets or sets the minimum reliability rate (0.0 to 1.0).
- Value: The
MinimumReliabilityRatevalue.
P:IoT.Driver.S7PlcRx.Production.ProductionValidationConfig.ReliabilityTestCount
public int ReliabilityTestCount { get; set; }
Gets or sets the number of operations to test for reliability.
- Value: The
ReliabilityTestCountvalue.
T:IoT.Driver.S7PlcRx.Production.SystemValidationResult
public class IoT.Driver.S7PlcRx.Production.SystemValidationResult
Represents the result of system validation.
Declared public members
M:IoT.Driver.S7PlcRx.Production.SystemValidationResult.#ctor
public IoT.Driver.S7PlcRx.Production.SystemValidationResult()
Initializes a new instance of IoT.Driver.S7PlcRx.Production.SystemValidationResult.
P:IoT.Driver.S7PlcRx.Production.SystemValidationResult.CriticalErrors
public System.Collections.Generic.List<string> CriticalErrors { get; }
Gets critical errors that prevent production use.
- Value: The
CriticalErrorsvalue.
P:IoT.Driver.S7PlcRx.Production.SystemValidationResult.IsProductionReady
public bool IsProductionReady { get; set; }
Gets or sets a value indicating whether the system is production ready.
- Value: The
IsProductionReadyvalue.
P:IoT.Driver.S7PlcRx.Production.SystemValidationResult.OverallScore
public double OverallScore { get; set; }
Gets or sets the overall validation score (0-100).
- Value: The
OverallScorevalue.
P:IoT.Driver.S7PlcRx.Production.SystemValidationResult.PLCIdentifier
public string PLCIdentifier { get; set; }
Gets or sets the PLC identifier.
- Value: The
PLCIdentifiervalue.
P:IoT.Driver.S7PlcRx.Production.SystemValidationResult.TotalValidationTime
public System.TimeSpan TotalValidationTime { get; }
Gets the total validation time.
- Value: The
TotalValidationTimevalue.
P:IoT.Driver.S7PlcRx.Production.SystemValidationResult.ValidationEndTime
public System.DateTimeOffset ValidationEndTime { get; set; }
Gets or sets the validation end time.
- Value: The
ValidationEndTimevalue.
P:IoT.Driver.S7PlcRx.Production.SystemValidationResult.ValidationStartTime
public System.DateTimeOffset ValidationStartTime { get; set; }
Gets or sets the validation start time.
- Value: The
ValidationStartTimevalue.
P:IoT.Driver.S7PlcRx.Production.SystemValidationResult.ValidationTests
public System.Collections.Generic.List<IoT.Driver.S7PlcRx.Production.ValidationTest> ValidationTests { get; }
Gets the individual validation tests.
- Value: The
ValidationTestsvalue.
T:IoT.Driver.S7PlcRx.Production.ValidationTest
public class IoT.Driver.S7PlcRx.Production.ValidationTest
Represents the result and metadata of a validation test.
Declared public members
M:IoT.Driver.S7PlcRx.Production.ValidationTest.#ctor
public IoT.Driver.S7PlcRx.Production.ValidationTest()
Initializes a new instance of IoT.Driver.S7PlcRx.Production.ValidationTest.
P:IoT.Driver.S7PlcRx.Production.ValidationTest.Details
public System.Collections.Generic.List<string> Details { get; }
Gets additional test details.
- Value: The
Detailsvalue.
P:IoT.Driver.S7PlcRx.Production.ValidationTest.Duration
public System.TimeSpan Duration { get; }
Gets the test duration.
- Value: The
Durationvalue.
P:IoT.Driver.S7PlcRx.Production.ValidationTest.EndTime
public System.DateTimeOffset EndTime { get; set; }
Gets or sets the test end time.
- Value: The
EndTimevalue.
P:IoT.Driver.S7PlcRx.Production.ValidationTest.ErrorMessage
public string ErrorMessage { get; set; }
Gets or sets any error message.
- Value: The
ErrorMessagevalue.
P:IoT.Driver.S7PlcRx.Production.ValidationTest.StartTime
public System.DateTimeOffset StartTime { get; set; }
Gets or sets the test start time.
- Value: The
StartTimevalue.
P:IoT.Driver.S7PlcRx.Production.ValidationTest.Success
public bool Success { get; set; }
Gets or sets a value indicating whether gets or sets whether the test was successful.
- Value: The
Successvalue.
P:IoT.Driver.S7PlcRx.Production.ValidationTest.TestName
public string TestName { get; set; }
Gets or sets the test name.
- Value: The
TestNamevalue.
T:IoT.Driver.S7PlcRx.RxS7
public class IoT.Driver.S7PlcRx.RxS7
Contains address parsing members for T:IoT.Driver.S7PlcRx.RxS7 .
Declared public members
M:IoT.Driver.S7PlcRx.RxS7.#ctor(IoT.Driver.S7PlcRx.RxS7Options)
public IoT.Driver.S7PlcRx.RxS7(IoT.Driver.S7PlcRx.RxS7Options options)
Initializes a new instance of the T:IoT.Driver.S7PlcRx.RxS7 class from composed connection settings.
- Parameter
options: The composed PLC connection settings.
M:IoT.Driver.S7PlcRx.RxS7.#ctor(IoT.Driver.S7PlcRx.RxS7Options,System.TimeProvider)
public IoT.Driver.S7PlcRx.RxS7(IoT.Driver.S7PlcRx.RxS7Options options, System.TimeProvider timeProvider)
Initializes a new instance of the T:IoT.Driver.S7PlcRx.RxS7 class from composed connection settings.
- Parameter
options: The composed PLC connection settings. - Parameter
timeProvider: The time provider.
M:IoT.Driver.S7PlcRx.RxS7.Dispose
public void Dispose()
Releases resources used by this instance.
M:IoT.Driver.S7PlcRx.RxS7.GetCpuInfo
public System.IObservable<string[]> GetCpuInfo()
Retrieves detailed information about the connected CPU as an observable sequence.
- Returns: An observable sequence that emits CPU information fields, such as the AS name, module name, copyright, serial number, module type name, order code, and version numbers. The sequence completes after emitting the data.
M:IoT.Driver.S7PlcRx.RxS7.Observe``1(IoT.Driver.Core.LogicalTagKey1{``0})`
public System.IObservable<T> Observe<T>(IoT.Driver.Core.LogicalTagKey<T> tag)
Executes the Observe operation.
- Parameter
tag: Thetagvalue. - Returns: A
System.IObservable<T>result.
M:IoT.Driver.S7PlcRx.RxS7.ReadAsync``1(IoT.Driver.Core.LogicalTagKey1{``0})`
public System.Threading.Tasks.Task<T> ReadAsync<T>(IoT.Driver.Core.LogicalTagKey<T> tag)
Executes the ReadAsync operation.
- Parameter
tag: Thetagvalue. - Returns: A
System.Threading.Tasks.Task<T>result.
M:IoT.Driver.S7PlcRx.RxS7.ReadAsync``1(IoT.Driver.Core.LogicalTagKey1{``0},System.Threading.CancellationToken)`
public System.Threading.Tasks.Task<T> ReadAsync<T>(IoT.Driver.Core.LogicalTagKey<T> tag, System.Threading.CancellationToken cancellationToken)
Executes the ReadAsync operation.
- Parameter
tag: Thetagvalue. - Parameter
cancellationToken: ThecancellationTokenvalue. - Returns: A
System.Threading.Tasks.Task<T>result.
M:IoT.Driver.S7PlcRx.RxS7.Value``1(System.String,``0)
public void Value<T>(string variable, T value)
Sets a variable value when it exists and the value is compatible with its type.
- Parameter
variable: The name of the variable whose value is to be set. Cannot be null. - Parameter
value: The value to assign to the variable. Must be compatible with the variable's type.
P:IoT.Driver.S7PlcRx.RxS7.IP
public string IP { get; }
Gets the IP address associated with the current instance.
- Value: The
IPvalue.
P:IoT.Driver.S7PlcRx.RxS7.IsConnected
public System.IObservable<bool> IsConnected { get; }
Gets an observable sequence that indicates whether the connection is currently established.
- Value: The
IsConnectedvalue.
P:IoT.Driver.S7PlcRx.RxS7.IsConnectedValue
public bool IsConnectedValue { get; }
Gets a value indicating whether the connection is currently established.
- Value: The
IsConnectedValuevalue.
P:IoT.Driver.S7PlcRx.RxS7.IsDisposed
public bool IsDisposed { get; }
Gets a value indicating whether gets a value that indicates whether the object is disposed.
- Value: The
IsDisposedvalue.
P:IoT.Driver.S7PlcRx.RxS7.IsPaused
public System.IObservable<bool> IsPaused { get; }
Gets an observable sequence that indicates whether the operation is currently paused.
- Value: The
IsPausedvalue.
P:IoT.Driver.S7PlcRx.RxS7.LastError
public System.IObservable<string> LastError { get; }
Gets an observable sequence of the component's most recent error messages.
- Value: The
LastErrorvalue.
P:IoT.Driver.S7PlcRx.RxS7.LastErrorCode
public System.IObservable<IoT.Driver.S7PlcRx.Enums.ErrorCode> LastErrorCode { get; }
Gets an observable sequence that emits the most recent error code reported by the system.
- Value: The
LastErrorCodevalue.
P:IoT.Driver.S7PlcRx.RxS7.ObserveAll
public System.IObservable<IoT.Driver.S7PlcRx.Tag> ObserveAll { get; }
Gets an observable sequence that emits all tag updates as they occur.
- Value: The
ObserveAllvalue.
P:IoT.Driver.S7PlcRx.RxS7.PLCType
public IoT.Driver.S7PlcRx.Enums.CpuType PLCType { get; }
Gets the type of PLC (Programmable Logic Controller) associated with this instance.
- Value: The
PLCTypevalue.
P:IoT.Driver.S7PlcRx.RxS7.Rack
public short Rack { get; }
Gets the rack number associated with the device or component.
- Value: The
Rackvalue.
P:IoT.Driver.S7PlcRx.RxS7.ReadTime
public System.IObservable<long> ReadTime { get; }
Gets an observable sequence that emits each read operation's duration in ticks.
- Value: The
ReadTimevalue.
P:IoT.Driver.S7PlcRx.RxS7.ShowWatchDogWriting
public bool ShowWatchDogWriting { get; set; }
Gets or sets a value indicating whether WatchDog writing output is displayed.
- Value: The
ShowWatchDogWritingvalue.
P:IoT.Driver.S7PlcRx.RxS7.Slot
public short Slot { get; }
Gets the slot number associated with this instance.
- Value: The
Slotvalue.
P:IoT.Driver.S7PlcRx.RxS7.Status
public System.IObservable<string> Status { get; }
Gets an observable sequence that provides status updates as strings.
- Value: The
Statusvalue.
P:IoT.Driver.S7PlcRx.RxS7.TagList
public IoT.Driver.S7PlcRx.Tags TagList { get; }
Gets the collection of tags associated with the current instance.
- Value: The
TagListvalue.
P:IoT.Driver.S7PlcRx.RxS7.WatchDogAddress
public string WatchDogAddress { get; }
Gets the network address of the WatchDog service, if configured.
- Value: The
WatchDogAddressvalue.
P:IoT.Driver.S7PlcRx.RxS7.WatchDogValueToWrite
public ushort WatchDogValueToWrite { get; set; }
Gets or sets the value to be written to the watchdog timer.
- Value: The
WatchDogValueToWritevalue.
P:IoT.Driver.S7PlcRx.RxS7.WatchDogWritingTime
public int WatchDogWritingTime { get; }
Gets the interval, in seconds, that the watchdog uses when writing status updates.
- Value: The
WatchDogWritingTimevalue.
T:IoT.Driver.S7PlcRx.RxS7Options
public class IoT.Driver.S7PlcRx.RxS7Options
Composes connection, polling, and optional watchdog settings for T:IoT.Driver.S7PlcRx.RxS7 .
Declared public members
M:IoT.Driver.S7PlcRx.RxS7Options.#ctor(IoT.Driver.S7PlcRx.S7ConnectionOptions,IoT.Driver.S7PlcRx.S7PollingOptions,IoT.Driver.S7PlcRx.S7WatchdogOptions)
public IoT.Driver.S7PlcRx.RxS7Options(IoT.Driver.S7PlcRx.S7ConnectionOptions connection, IoT.Driver.S7PlcRx.S7PollingOptions polling, IoT.Driver.S7PlcRx.S7WatchdogOptions watchdog)
Composes connection, polling, and optional watchdog settings for T:IoT.Driver.S7PlcRx.RxS7 .
- Parameter
connection: The PLC endpoint settings. - Parameter
polling: The polling settings, or to use defaults. - Parameter
watchdog: The optional watchdog settings.
P:IoT.Driver.S7PlcRx.RxS7Options.Connection
public IoT.Driver.S7PlcRx.S7ConnectionOptions Connection { get; }
Gets the PLC endpoint settings.
- Value: The
Connectionvalue.
P:IoT.Driver.S7PlcRx.RxS7Options.Polling
public IoT.Driver.S7PlcRx.S7PollingOptions Polling { get; }
Gets the polling settings.
- Value: The
Pollingvalue.
P:IoT.Driver.S7PlcRx.RxS7Options.Watchdog
public IoT.Driver.S7PlcRx.S7WatchdogOptions Watchdog { get; }
Gets the optional watchdog settings.
- Value: The
Watchdogvalue.
T:IoT.Driver.S7PlcRx.S71200
public class IoT.Driver.S7PlcRx.S71200
Creates connections to Siemens S7-1200 PLC devices.
Declared public members
M:IoT.Driver.S7PlcRx.S71200.Create(System.String)
public static IoT.Driver.S7PlcRx.IRxS7 Create(string ip)
Creates an S7-1200 connection with standard settings.
- Parameter
ip: The PLC IP address. - Returns: The configured PLC connection.
M:IoT.Driver.S7PlcRx.S71200.Create(System.String,System.Int16)
public static IoT.Driver.S7PlcRx.IRxS7 Create(string ip, short rack)
Creates an S7-1200 connection for a rack with standard settings.
- Parameter
ip: The PLC IP address. - Parameter
rack: The PLC rack number. - Returns: The configured PLC connection.
M:IoT.Driver.S7PlcRx.S71200.Create(System.String,System.Int16,IoT.Driver.S7PlcRx.S7PollingOptions,IoT.Driver.S7PlcRx.S7WatchdogOptions)
public static IoT.Driver.S7PlcRx.IRxS7 Create(string ip, short rack, IoT.Driver.S7PlcRx.S7PollingOptions polling, IoT.Driver.S7PlcRx.S7WatchdogOptions watchdog)
Creates an S7-1200 connection with explicit settings.
- Parameter
ip: The PLC IP address. - Parameter
rack: The PLC rack number. - Parameter
polling: The polling configuration. - Parameter
watchdog: The optional watchdog configuration. - Returns: The configured PLC connection.
T:IoT.Driver.S7PlcRx.S71500
public class IoT.Driver.S7PlcRx.S71500
Creates connections to Siemens S7-1500 PLC devices.
Declared public members
M:IoT.Driver.S7PlcRx.S71500.Create(System.String)
public static IoT.Driver.S7PlcRx.IRxS7 Create(string ip)
Creates an S7-1500 connection with standard settings.
- Parameter
ip: The PLC IP address. - Returns: The configured PLC connection.
M:IoT.Driver.S7PlcRx.S71500.Create(System.String,System.Double)
public static IoT.Driver.S7PlcRx.IRxS7 Create(string ip, double interval)
Creates an S7-1500 connection with an explicit polling interval.
- Parameter
ip: The PLC IP address. - Parameter
interval: The polling interval in milliseconds. - Returns: The configured PLC connection.
M:IoT.Driver.S7PlcRx.S71500.Create(System.String,System.Int16,System.Int16)
public static IoT.Driver.S7PlcRx.IRxS7 Create(string ip, short rack, short slot)
Creates an S7-1500 connection at a rack and slot with standard polling.
- Parameter
ip: The PLC IP address. - Parameter
rack: The PLC rack number. - Parameter
slot: The PLC CPU slot. - Returns: The configured PLC connection.
M:IoT.Driver.S7PlcRx.S71500.Create(System.String,System.Int16,System.Int16,IoT.Driver.S7PlcRx.S7PollingOptions,IoT.Driver.S7PlcRx.S7WatchdogOptions)
public static IoT.Driver.S7PlcRx.IRxS7 Create(string ip, short rack, short slot, IoT.Driver.S7PlcRx.S7PollingOptions polling, IoT.Driver.S7PlcRx.S7WatchdogOptions watchdog)
Creates an S7-1500 connection with explicit settings.
- Parameter
ip: The PLC IP address. - Parameter
rack: The PLC rack number. - Parameter
slot: The PLC CPU slot. - Parameter
polling: The polling configuration. - Parameter
watchdog: The optional watchdog configuration. - Returns: The configured PLC connection.
M:IoT.Driver.S7PlcRx.S71500.Create(System.String,System.Int16,System.Int16,System.String,System.Double)
public static IoT.Driver.S7PlcRx.IRxS7 Create(string ip, short rack, short slot, string watchDogAddress, double interval)
Creates an S7-1500 connection with legacy scalar settings.
- Parameter
ip: The PLC IP address. - Parameter
rack: The PLC rack number. - Parameter
slot: The PLC CPU slot. - Parameter
watchDogAddress: The optional watchdog address. - Parameter
interval: The polling interval in milliseconds. - Returns: The configured PLC connection.
T:IoT.Driver.S7PlcRx.S7200
public class IoT.Driver.S7PlcRx.S7200
Creates connections to Siemens S7-200 PLC devices.
Declared public members
M:IoT.Driver.S7PlcRx.S7200.Create(System.String,System.Int16,System.Int16)
public static IoT.Driver.S7PlcRx.IRxS7 Create(string ip, short rack, short slot)
Creates an S7-200 connection with standard polling.
- Parameter
ip: The PLC IP address. - Parameter
rack: The PLC rack number. - Parameter
slot: The PLC CPU slot. - Returns: The configured PLC connection.
M:IoT.Driver.S7PlcRx.S7200.Create(System.String,System.Int16,System.Int16,IoT.Driver.S7PlcRx.S7PollingOptions,IoT.Driver.S7PlcRx.S7WatchdogOptions)
public static IoT.Driver.S7PlcRx.IRxS7 Create(string ip, short rack, short slot, IoT.Driver.S7PlcRx.S7PollingOptions polling, IoT.Driver.S7PlcRx.S7WatchdogOptions watchdog)
Creates an S7-200 connection with explicit settings.
- Parameter
ip: The PLC IP address. - Parameter
rack: The PLC rack number. - Parameter
slot: The PLC CPU slot. - Parameter
polling: The polling configuration. - Parameter
watchdog: The optional watchdog configuration. - Returns: The configured PLC connection.
T:IoT.Driver.S7PlcRx.S7300
public class IoT.Driver.S7PlcRx.S7300
Creates connections to Siemens S7-300 PLC devices.
Declared public members
M:IoT.Driver.S7PlcRx.S7300.Create(System.String,System.Int16,System.Int16)
public static IoT.Driver.S7PlcRx.IRxS7 Create(string ip, short rack, short slot)
Creates an S7-300 connection with standard polling.
- Parameter
ip: The PLC IP address. - Parameter
rack: The PLC rack number. - Parameter
slot: The PLC CPU slot. - Returns: The configured PLC connection.
M:IoT.Driver.S7PlcRx.S7300.Create(System.String,System.Int16,System.Int16,IoT.Driver.S7PlcRx.S7PollingOptions,IoT.Driver.S7PlcRx.S7WatchdogOptions)
public static IoT.Driver.S7PlcRx.IRxS7 Create(string ip, short rack, short slot, IoT.Driver.S7PlcRx.S7PollingOptions polling, IoT.Driver.S7PlcRx.S7WatchdogOptions watchdog)
Creates an S7-300 connection with explicit settings.
- Parameter
ip: The PLC IP address. - Parameter
rack: The PLC rack number. - Parameter
slot: The PLC CPU slot. - Parameter
polling: The polling configuration. - Parameter
watchdog: The optional watchdog configuration. - Returns: The configured PLC connection.
T:IoT.Driver.S7PlcRx.S7400
public class IoT.Driver.S7PlcRx.S7400
Creates connections to Siemens S7-400 PLC devices.
Declared public members
M:IoT.Driver.S7PlcRx.S7400.Create(System.String,System.Int16,System.Int16)
public static IoT.Driver.S7PlcRx.IRxS7 Create(string ip, short rack, short slot)
Creates an S7-400 connection with standard polling.
- Parameter
ip: The PLC IP address. - Parameter
rack: The PLC rack number. - Parameter
slot: The PLC CPU slot. - Returns: The configured PLC connection.
M:IoT.Driver.S7PlcRx.S7400.Create(System.String,System.Int16,System.Int16,IoT.Driver.S7PlcRx.S7PollingOptions,IoT.Driver.S7PlcRx.S7WatchdogOptions)
public static IoT.Driver.S7PlcRx.IRxS7 Create(string ip, short rack, short slot, IoT.Driver.S7PlcRx.S7PollingOptions polling, IoT.Driver.S7PlcRx.S7WatchdogOptions watchdog)
Creates an S7-400 connection with explicit settings.
- Parameter
ip: The PLC IP address. - Parameter
rack: The PLC rack number. - Parameter
slot: The PLC CPU slot. - Parameter
polling: The polling configuration. - Parameter
watchdog: The optional watchdog configuration. - Returns: The configured PLC connection.
T:IoT.Driver.S7PlcRx.S7ConnectionOptions
public class IoT.Driver.S7PlcRx.S7ConnectionOptions
Describes the PLC endpoint used by an T:IoT.Driver.S7PlcRx.RxS7 connection.
Declared public members
M:IoT.Driver.S7PlcRx.S7ConnectionOptions.#ctor(IoT.Driver.S7PlcRx.Enums.CpuType,System.String,System.Int16,System.Int16)
public IoT.Driver.S7PlcRx.S7ConnectionOptions(IoT.Driver.S7PlcRx.Enums.CpuType cpuType, string address, short rack, short slot)
Describes the PLC endpoint used by an T:IoT.Driver.S7PlcRx.RxS7 connection.
- Parameter
cpuType: The PLC CPU family. - Parameter
address: The PLC IP address. - Parameter
rack: The PLC rack number. - Parameter
slot: The PLC CPU slot number.
P:IoT.Driver.S7PlcRx.S7ConnectionOptions.CpuType
public IoT.Driver.S7PlcRx.Enums.CpuType CpuType { get; }
Gets the PLC CPU family.
- Value: The
CpuTypevalue.
P:IoT.Driver.S7PlcRx.S7ConnectionOptions.IpAddress
public string IpAddress { get; }
Gets the PLC IP address.
- Value: The
IpAddressvalue.
P:IoT.Driver.S7PlcRx.S7ConnectionOptions.Rack
public short Rack { get; }
Gets the PLC rack number.
- Value: The
Rackvalue.
P:IoT.Driver.S7PlcRx.S7ConnectionOptions.Slot
public short Slot { get; }
Gets the PLC CPU slot number.
- Value: The
Slotvalue.
T:IoT.Driver.S7PlcRx.S7Exception
public class IoT.Driver.S7PlcRx.S7Exception
Represents errors that occur during S7 protocol operations.
Declared public members
M:IoT.Driver.S7PlcRx.S7Exception.#ctor
public IoT.Driver.S7PlcRx.S7Exception()
Initializes a new instance of the T:IoT.Driver.S7PlcRx.S7Exception class.
M:IoT.Driver.S7PlcRx.S7Exception.#ctor(System.String)
public IoT.Driver.S7PlcRx.S7Exception(string message)
Initializes a new instance of the T:IoT.Driver.S7PlcRx.S7Exception class.
- Parameter
message: The message that describes the error.
M:IoT.Driver.S7PlcRx.S7Exception.#ctor(System.String,System.Exception)
public IoT.Driver.S7PlcRx.S7Exception(string message, System.Exception innerException)
Initializes a new instance of the T:IoT.Driver.S7PlcRx.S7Exception class.
- Parameter
message: The error message that explains the reason for the exception. - Parameter
innerException: The exception that caused the current exception.
T:IoT.Driver.S7PlcRx.S7PollingOptions
public class IoT.Driver.S7PlcRx.S7PollingOptions
Describes periodic PLC tag polling.
Declared public members
F:IoT.Driver.S7PlcRx.S7PollingOptions.DefaultIntervalMilliseconds
public static double DefaultIntervalMilliseconds
The default polling interval in milliseconds.
M:IoT.Driver.S7PlcRx.S7PollingOptions.#ctor(System.Double)
public IoT.Driver.S7PlcRx.S7PollingOptions(double intervalMilliseconds)
Describes periodic PLC tag polling.
- Parameter
intervalMilliseconds: The polling interval in milliseconds.
P:IoT.Driver.S7PlcRx.S7PollingOptions.IntervalMilliseconds
public double IntervalMilliseconds { get; }
Gets the polling interval in milliseconds.
- Value: The
IntervalMillisecondsvalue.
T:IoT.Driver.S7PlcRx.S7WatchdogOptions
public class IoT.Driver.S7PlcRx.S7WatchdogOptions
Describes optional PLC watchdog writes.
Declared public members
F:IoT.Driver.S7PlcRx.S7WatchdogOptions.DefaultIntervalSeconds
public static int DefaultIntervalSeconds
The default watchdog interval in seconds.
F:IoT.Driver.S7PlcRx.S7WatchdogOptions.DefaultValueToWrite
public static ushort DefaultValueToWrite
The default value written during each watchdog cycle.
M:IoT.Driver.S7PlcRx.S7WatchdogOptions.#ctor(System.String,System.UInt16,System.Int32)
public IoT.Driver.S7PlcRx.S7WatchdogOptions(string address, ushort valueToWrite, int intervalSeconds)
Describes optional PLC watchdog writes.
- Parameter
address: The DBW watchdog address. - Parameter
valueToWrite: The value written during each watchdog cycle. - Parameter
intervalSeconds: The watchdog interval in seconds.
P:IoT.Driver.S7PlcRx.S7WatchdogOptions.Address
public string Address { get; }
Gets the DBW watchdog address.
- Value: The
Addressvalue.
P:IoT.Driver.S7PlcRx.S7WatchdogOptions.IntervalSeconds
public int IntervalSeconds { get; }
Gets the watchdog interval in seconds.
- Value: The
IntervalSecondsvalue.
P:IoT.Driver.S7PlcRx.S7WatchdogOptions.ValueToWrite
public ushort ValueToWrite { get; }
Gets the value written during each watchdog cycle.
- Value: The
ValueToWritevalue.
T:IoT.Driver.S7PlcRx.SourceGeneration.S7PlcBindingAttribute
public class IoT.Driver.S7PlcRx.SourceGeneration.S7PlcBindingAttribute
Marks a class as an S7 PLC binding target.
Declared public members
M:IoT.Driver.S7PlcRx.SourceGeneration.S7PlcBindingAttribute.#ctor
public IoT.Driver.S7PlcRx.SourceGeneration.S7PlcBindingAttribute()
Initializes a new instance of IoT.Driver.S7PlcRx.SourceGeneration.S7PlcBindingAttribute.
T:IoT.Driver.S7PlcRx.SourceGeneration.S7TagAttribute
public class IoT.Driver.S7PlcRx.SourceGeneration.S7TagAttribute
Marks a partial property as a PLC tag binding target.
Declared public members
M:IoT.Driver.S7PlcRx.SourceGeneration.S7TagAttribute.#ctor(System.String)
public IoT.Driver.S7PlcRx.SourceGeneration.S7TagAttribute(string address)
Initializes a new instance of the T:IoT.Driver.S7PlcRx.SourceGeneration.S7TagAttribute class.
- Parameter
address: The PLC tag address.
P:IoT.Driver.S7PlcRx.SourceGeneration.S7TagAttribute.Address
public string Address { get; }
Gets the PLC tag address.
- Value: The
Addressvalue.
P:IoT.Driver.S7PlcRx.SourceGeneration.S7TagAttribute.ArrayLength
public int ArrayLength { get; set; }
Gets or sets the PLC array length.
- Value: The
ArrayLengthvalue.
P:IoT.Driver.S7PlcRx.SourceGeneration.S7TagAttribute.Direction
public IoT.Driver.S7PlcRx.SourceGeneration.S7TagDirection Direction { get; set; }
Gets or sets the binding direction.
- Value: The
Directionvalue.
P:IoT.Driver.S7PlcRx.SourceGeneration.S7TagAttribute.PollIntervalMs
public int PollIntervalMs { get; set; }
Gets or sets the polling interval in milliseconds.
- Value: The
PollIntervalMsvalue.
T:IoT.Driver.S7PlcRx.SourceGeneration.S7TagDirection
public enum IoT.Driver.S7PlcRx.SourceGeneration.S7TagDirection
Defines PLC tag binding direction.
Declared public members
F:IoT.Driver.S7PlcRx.SourceGeneration.S7TagDirection.ReadOnly
public static const IoT.Driver.S7PlcRx.SourceGeneration.S7TagDirection ReadOnly
Reads the PLC tag only.
F:IoT.Driver.S7PlcRx.SourceGeneration.S7TagDirection.ReadWrite
public static const IoT.Driver.S7PlcRx.SourceGeneration.S7TagDirection ReadWrite
Reads and writes the PLC tag.
F:IoT.Driver.S7PlcRx.SourceGeneration.S7TagDirection.WriteOnly
public static const IoT.Driver.S7PlcRx.SourceGeneration.S7TagDirection WriteOnly
Writes the PLC tag only.
T:IoT.Driver.S7PlcRx.Tag
public class IoT.Driver.S7PlcRx.Tag
Represents a data tag with a name, address, value, type, and optional array length, typically used for storing or transferring typed values identified by address or name.
Declared public members
M:IoT.Driver.S7PlcRx.Tag.#ctor
public IoT.Driver.S7PlcRx.Tag()
Initializes a new instance of the T:IoT.Driver.S7PlcRx.Tag class.
M:IoT.Driver.S7PlcRx.Tag.#ctor(System.String,System.String,System.Object,System.Type)
public IoT.Driver.S7PlcRx.Tag(string name, string address, object value, System.Type type)
Initializes a new instance of the T:IoT.Driver.S7PlcRx.Tag class.
- Parameter
name: The name. - Parameter
address: The address. - Parameter
value: The value. - Parameter
type: The type.
M:IoT.Driver.S7PlcRx.Tag.#ctor(System.String,System.String,System.Type)
public IoT.Driver.S7PlcRx.Tag(string name, string address, System.Type type)
Initializes a new instance of the T:IoT.Driver.S7PlcRx.Tag class.
- Parameter
name: The name. - Parameter
address: The address. - Parameter
type: The type.
M:IoT.Driver.S7PlcRx.Tag.#ctor(System.String,System.String,System.Type,System.Int32)
public IoT.Driver.S7PlcRx.Tag(string name, string address, System.Type type, int arrayLength)
Initializes a new instance of the T:IoT.Driver.S7PlcRx.Tag class.
- Parameter
name: The name. - Parameter
address: The address. - Parameter
type: The type. - Parameter
arrayLength: Length of the array.
M:IoT.Driver.S7PlcRx.Tag.#ctor(System.String,System.Type)
public IoT.Driver.S7PlcRx.Tag(string address, System.Type type)
Initializes a new instance of the T:IoT.Driver.S7PlcRx.Tag class.
- Parameter
address: The address. - Parameter
type: The type.
M:IoT.Driver.S7PlcRx.Tag.#ctor(System.String,System.Type,System.Int32)
public IoT.Driver.S7PlcRx.Tag(string address, System.Type type, int arrayLength)
Initializes a new instance of the T:IoT.Driver.S7PlcRx.Tag class.
- Parameter
address: The address. - Parameter
type: The type. - Parameter
arrayLength: Length of the array.
M:IoT.Driver.S7PlcRx.Tag.SetDoNotPoll(System.Boolean)
public void SetDoNotPoll(bool value)
Sets a value indicating whether polling operations should be disabled.
- Parameter
value: true to disable polling; otherwise, false.
P:IoT.Driver.S7PlcRx.Tag.Address
public string Address { get; set; }
Gets or sets the address associated with the entity.
- Value: The
Addressvalue.
P:IoT.Driver.S7PlcRx.Tag.ArrayLength
public System.Nullable<int> ArrayLength { get; }
Gets the length of the array, if known.
- Value: The
ArrayLengthvalue.
P:IoT.Driver.S7PlcRx.Tag.DoNotPoll
public bool DoNotPoll { get; }
Gets a value indicating whether polling operations should be suppressed for this instance.
- Value: The
DoNotPollvalue.
P:IoT.Driver.S7PlcRx.Tag.Name
public string Name { get; set; }
Gets or sets the name associated with the object.
- Value: The
Namevalue.
P:IoT.Driver.S7PlcRx.Tag.NewValue
public object NewValue { get; }
Gets the new value associated with the change event.
- Value: The
NewValuevalue.
P:IoT.Driver.S7PlcRx.Tag.Type
public System.Type Type { get; }
Gets the runtime type information associated with the current instance.
- Value: The
Typevalue.
P:IoT.Driver.S7PlcRx.Tag.Value
public object Value { get; set; }
Gets or sets the value associated with this instance.
- Value: The
Valuevalue.
T:IoT.Driver.S7PlcRx.TagAddressOutOfRangeException
public class IoT.Driver.S7PlcRx.TagAddressOutOfRangeException
Thrown when a tag address is outside the valid range.
Declared public members
M:IoT.Driver.S7PlcRx.TagAddressOutOfRangeException.#ctor
public IoT.Driver.S7PlcRx.TagAddressOutOfRangeException()
Initializes a new instance of the T:IoT.Driver.S7PlcRx.TagAddressOutOfRangeException class.
M:IoT.Driver.S7PlcRx.TagAddressOutOfRangeException.#ctor(IoT.Driver.S7PlcRx.Tag)
public IoT.Driver.S7PlcRx.TagAddressOutOfRangeException(IoT.Driver.S7PlcRx.Tag tag)
Initializes a new instance of the T:IoT.Driver.S7PlcRx.TagAddressOutOfRangeException class.
- Parameter
tag: The Tag that caused the exception.
M:IoT.Driver.S7PlcRx.TagAddressOutOfRangeException.#ctor(IoT.Driver.S7PlcRx.Tag,System.Exception)
public IoT.Driver.S7PlcRx.TagAddressOutOfRangeException(IoT.Driver.S7PlcRx.Tag tag, System.Exception innerException)
Initializes a new instance of the T:IoT.Driver.S7PlcRx.TagAddressOutOfRangeException class.
- Parameter
tag: The Tag that caused the exception. - Parameter
innerException: The exception that caused the current exception, or if no inner exception is specified.
M:IoT.Driver.S7PlcRx.TagAddressOutOfRangeException.#ctor(IoT.Driver.S7PlcRx.Tag,System.Object,System.String)
public IoT.Driver.S7PlcRx.TagAddressOutOfRangeException(IoT.Driver.S7PlcRx.Tag tag, object actualValue, string message)
Initializes a new instance of the T:IoT.Driver.S7PlcRx.TagAddressOutOfRangeException class.
- Parameter
tag: The Tag that caused the exception. - Parameter
actualValue: The value of the argument that causes this exception. - Parameter
message: The message that describes the error.
M:IoT.Driver.S7PlcRx.TagAddressOutOfRangeException.#ctor(IoT.Driver.S7PlcRx.Tag,System.String)
public IoT.Driver.S7PlcRx.TagAddressOutOfRangeException(IoT.Driver.S7PlcRx.Tag tag, string message)
Initializes a new instance of the T:IoT.Driver.S7PlcRx.TagAddressOutOfRangeException class.
- Parameter
tag: The Tag that caused the exception. - Parameter
message: The message that describes the error.
M:IoT.Driver.S7PlcRx.TagAddressOutOfRangeException.#ctor(System.String)
public IoT.Driver.S7PlcRx.TagAddressOutOfRangeException(string message)
Initializes a new instance of the T:IoT.Driver.S7PlcRx.TagAddressOutOfRangeException class.
- Parameter
message: The message that describes the error.
M:IoT.Driver.S7PlcRx.TagAddressOutOfRangeException.#ctor(System.String,System.Exception)
public IoT.Driver.S7PlcRx.TagAddressOutOfRangeException(string message, System.Exception innerException)
Initializes a new instance of the T:IoT.Driver.S7PlcRx.TagAddressOutOfRangeException class.
- Parameter
message: The message that describes the error. - Parameter
innerException: The exception that caused the current exception.
M:IoT.Driver.S7PlcRx.TagAddressOutOfRangeException.#ctor(System.String,System.Object,System.String)
public IoT.Driver.S7PlcRx.TagAddressOutOfRangeException(string paramName, object actualValue, string message)
Initializes a new instance of the T:IoT.Driver.S7PlcRx.TagAddressOutOfRangeException class.
- Parameter
paramName: The parameter name. - Parameter
actualValue: The invalid value. - Parameter
message: The error message.
M:IoT.Driver.S7PlcRx.TagAddressOutOfRangeException.#ctor(System.String,System.String)
public IoT.Driver.S7PlcRx.TagAddressOutOfRangeException(string paramName, string message)
Initializes a new instance of the T:IoT.Driver.S7PlcRx.TagAddressOutOfRangeException class.
- Parameter
paramName: The parameter name. - Parameter
message: The error message.
P:IoT.Driver.S7PlcRx.TagAddressOutOfRangeException.ParamName
public string ParamName { get; }
Inherits XML documentation from its implemented or overridden member.
- Value: The
ParamNamevalue.
T:IoT.Driver.S7PlcRx.TagOperations
public class IoT.Driver.S7PlcRx.TagOperations
Provides compositional operations for managing S7 tags.
Declared public members
M:IoT.Driver.S7PlcRx.TagOperations.AddUpdateTagItem(IoT.Driver.S7PlcRx.IRxS7,System.Type,System.String,System.String)
public static IoT.Driver.S7PlcRx.TagRegistration AddUpdateTagItem(IoT.Driver.S7PlcRx.IRxS7 plc, System.Type type, string tagName, string address)
Adds or updates a scalar tag.
- Parameter
plc: The PLC instance. - Parameter
type: The tag value type. - Parameter
tagName: The tag name. - Parameter
address: The PLC address. - Returns: The registered tag and PLC.
M:IoT.Driver.S7PlcRx.TagOperations.AddUpdateTagItem(IoT.Driver.S7PlcRx.IRxS7,System.Type,System.String,System.String,System.Int32)
public static IoT.Driver.S7PlcRx.TagRegistration AddUpdateTagItem(IoT.Driver.S7PlcRx.IRxS7 plc, System.Type type, string tagName, string address, int arrayLength)
Adds or updates an array or fixed-length string tag.
- Parameter
plc: The PLC instance. - Parameter
type: The tag value type. - Parameter
tagName: The tag name. - Parameter
address: The PLC address. - Parameter
arrayLength: The fixed array or string length. - Returns: The registered tag and PLC.
M:IoT.Driver.S7PlcRx.TagOperations.AddUpdateTagItem(IoT.Driver.S7PlcRx.IRxS7,System.Type,System.String,System.String,System.Nullable1{System.Int32})`
public static IoT.Driver.S7PlcRx.TagRegistration AddUpdateTagItem(IoT.Driver.S7PlcRx.IRxS7 plc, System.Type type, string tagName, string address, System.Nullable<int> arrayLength)
Executes the AddUpdateTagItem operation.
- Parameter
plc: Theplcvalue. - Parameter
type: Thetypevalue. - Parameter
tagName: ThetagNamevalue. - Parameter
address: Theaddressvalue. - Parameter
arrayLength: ThearrayLengthvalue. - Returns: A
IoT.Driver.S7PlcRx.TagRegistrationresult.
M:IoT.Driver.S7PlcRx.TagOperations.GetTag(IoT.Driver.S7PlcRx.IRxS7,System.String)
public static IoT.Driver.S7PlcRx.TagRegistration GetTag(IoT.Driver.S7PlcRx.IRxS7 plc, string tagName)
Gets a tag by name.
- Parameter
plc: The PLC instance. - Parameter
tagName: The tag name. - Returns: The tag registration.
M:IoT.Driver.S7PlcRx.TagOperations.RemoveTagItem(IoT.Driver.S7PlcRx.IRxS7,System.String)
public static void RemoveTagItem(IoT.Driver.S7PlcRx.IRxS7 plc, string tagName)
Removes a named tag.
- Parameter
plc: The PLC instance. - Parameter
tagName: The tag name.
M:IoT.Driver.S7PlcRx.TagOperations.TagToDictionary(System.IObservable1{IoT.Driver.S7PlcRx.Tag})`
public static System.IObservable<System.Collections.Generic.IDictionary<string, object>> TagToDictionary(System.IObservable<IoT.Driver.S7PlcRx.Tag> source)
Executes the TagToDictionary operation.
- Parameter
source: Thesourcevalue. - Returns: A
System.IObservable<System.Collections.Generic.IDictionary<string, object>>result.
M:IoT.Driver.S7PlcRx.TagOperations.ToTagValue``1(System.IObservable1{``0},System.String)`
public static System.IObservable<System.ValueTuple<string, TValue>> ToTagValue<TValue>(System.IObservable<TValue> source, string tag)
Executes the ToTagValue operation.
- Parameter
source: Thesourcevalue. - Parameter
tag: Thetagvalue. - Returns: A
System.IObservable<System.ValueTuple<string, TValue>>result.
T:IoT.Driver.S7PlcRx.TagRegistration
public class IoT.Driver.S7PlcRx.TagRegistration
Represents a tag and the PLC to which it is registered.
Declared public members
M:IoT.Driver.S7PlcRx.TagRegistration.Deconstruct(IoT.Driver.S7PlcRx.ITag@,IoT.Driver.S7PlcRx.IRxS7@)
public void Deconstruct(out IoT.Driver.S7PlcRx.ITag tag, out IoT.Driver.S7PlcRx.IRxS7 plc)
Deconstructs the registration.
- Parameter
tag: The registered tag. - Parameter
plc: The PLC instance.
M:IoT.Driver.S7PlcRx.TagRegistration.SetPolling
public IoT.Driver.S7PlcRx.TagRegistration SetPolling()
Enables polling for the tag.
- Returns: This registration.
M:IoT.Driver.S7PlcRx.TagRegistration.SetPolling(System.Boolean)
public IoT.Driver.S7PlcRx.TagRegistration SetPolling(bool polling)
Enables or disables polling for the tag.
- Parameter
polling: Whether polling is enabled. - Returns: This registration.
P:IoT.Driver.S7PlcRx.TagRegistration.Plc
public IoT.Driver.S7PlcRx.IRxS7 Plc { get; }
Gets the PLC instance.
- Value: The
Plcvalue.
P:IoT.Driver.S7PlcRx.TagRegistration.Tag
public IoT.Driver.S7PlcRx.ITag Tag { get; }
Gets the registered tag.
- Value: The
Tagvalue.
T:IoT.Driver.S7PlcRx.Tags
public class IoT.Driver.S7PlcRx.Tags
Represents a thread-safe collection of tag objects, providing methods for adding, retrieving, and managing tags by key, name, or tag instance.
Declared public members
M:IoT.Driver.S7PlcRx.Tags.#ctor
public IoT.Driver.S7PlcRx.Tags()
Initializes a new instance of IoT.Driver.S7PlcRx.Tags.
M:IoT.Driver.S7PlcRx.Tags.Add(IoT.Driver.S7PlcRx.Tag)
public void Add(IoT.Driver.S7PlcRx.Tag tag)
Adds the specified tag to the collection.
- Parameter
tag: The tag to add to the collection. Cannot be null.
M:IoT.Driver.S7PlcRx.Tags.Add(System.Object,IoT.Driver.S7PlcRx.Tag)
public void Add(object key, IoT.Driver.S7PlcRx.Tag tag)
Adds the specified tag to the collection with the associated key.
- Parameter
key: The key with which the specified tag is to be associated. Cannot be null. - Parameter
tag: The tag to add to the collection. Cannot be null.
M:IoT.Driver.S7PlcRx.Tags.Add(System.Object,IoT.Driver.S7PlcRx.Tags)
public void Add(object key, IoT.Driver.S7PlcRx.Tags tags)
Adds the specified key and associated tags to the collection.
- Parameter
key: The key with which the specified tags are to be associated. Cannot be null. - Parameter
tags: The tags to associate with the specified key. Cannot be null.
M:IoT.Driver.S7PlcRx.Tags.Add(System.Object,System.Object)
public void Add(object key, object value)
Adds an element with the specified key and value to the collection in a thread-safe manner.
- Parameter
key: The key of the element to add. Cannot be null. - Parameter
value: The value of the element to add. Can be null.
M:IoT.Driver.S7PlcRx.Tags.AddRange(System.Collections.Generic.IEnumerable1{IoT.Driver.S7PlcRx.Tag})`
public void AddRange(System.Collections.Generic.IEnumerable<IoT.Driver.S7PlcRx.Tag> tags)
Executes the AddRange operation.
- Parameter
tags: Thetagsvalue.
M:IoT.Driver.S7PlcRx.Tags.Get(IoT.Driver.S7PlcRx.Tag)
public IoT.Driver.S7PlcRx.Tag Get(IoT.Driver.S7PlcRx.Tag tag)
Gets the tag from the collection that matches the specified tag's name, if present.
- Parameter
tag: The tag whose name identifies the collection entry. - Returns: The matching tag, or when no tag matches.
M:IoT.Driver.S7PlcRx.Tags.GetTags
public IoT.Driver.S7PlcRx.Tags GetTags()
Retrieves a collection of tags that have non-null values.
- Returns: A collection containing every tag with a non-null value.
M:IoT.Driver.S7PlcRx.Tags.ToList
public System.Collections.Generic.List<IoT.Driver.S7PlcRx.Tag> ToList()
Returns a list containing all tags in the collection.
- Returns: A snapshot of the tags, or an empty list when retrieval fails.
P:IoT.Driver.S7PlcRx.Tags.Item(System.Object)
public object Item[object key] { get; set; }
Gets or sets the value associated with the specified key.
- Parameter
key: The key whose value to get or set. Cannot be null. - Returns: The associated value, or when the key is absent.
- Value: The
Itemvalue.
P:IoT.Driver.S7PlcRx.Tags.Item(System.String)
public IoT.Driver.S7PlcRx.Tag Item[string name] { get; }
Gets the tag with the specified name, if it exists.
- Parameter
name: The tag name. - Returns: The tag associated with the specified name, or null if no tag with that name exists.
- Value: The
Itemvalue.
| Product | Versions Compatible and additional computed target framework versions. |
|---|---|
| .NET | 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. net9.0 is compatible. net9.0-android was computed. net9.0-browser was computed. net9.0-ios was computed. net9.0-maccatalyst was computed. net9.0-macos was computed. net9.0-tvos was computed. net9.0-windows was computed. net10.0 is compatible. net10.0-android was computed. net10.0-browser was computed. net10.0-ios was computed. net10.0-maccatalyst was computed. net10.0-macos was computed. net10.0-tvos was computed. net10.0-windows was computed. net11.0 is compatible. |
| .NET Framework | net462 is compatible. net463 was computed. net47 was computed. net471 was computed. net472 is compatible. net48 was computed. net481 is compatible. |
-
.NETFramework 4.6.2
- IoT-Driver.Core (>= 1.0.2)
- Microsoft.Bcl.AsyncInterfaces (>= 10.0.10)
- ReactiveUI.Primitives.Async.Reactive (>= 7.1.0)
- ReactiveUI.Primitives.Reactive (>= 7.1.0)
- System.Memory (>= 4.6.3)
- System.Text.Json (>= 10.0.10)
-
.NETFramework 4.7.2
- IoT-Driver.Core (>= 1.0.2)
- Microsoft.Bcl.AsyncInterfaces (>= 10.0.10)
- ReactiveUI.Primitives.Async.Reactive (>= 7.1.0)
- ReactiveUI.Primitives.Reactive (>= 7.1.0)
- System.Memory (>= 4.6.3)
- System.Text.Json (>= 10.0.10)
-
.NETFramework 4.8.1
- IoT-Driver.Core (>= 1.0.2)
- Microsoft.Bcl.AsyncInterfaces (>= 10.0.10)
- ReactiveUI.Primitives.Async.Reactive (>= 7.1.0)
- ReactiveUI.Primitives.Reactive (>= 7.1.0)
- System.Memory (>= 4.6.3)
- System.Text.Json (>= 10.0.10)
-
net10.0
- IoT-Driver.Core (>= 1.0.2)
- Microsoft.Bcl.AsyncInterfaces (>= 10.0.10)
- ReactiveUI.Primitives.Async.Reactive (>= 7.1.0)
- ReactiveUI.Primitives.Reactive (>= 7.1.0)
-
net11.0
- IoT-Driver.Core (>= 1.0.2)
- Microsoft.Bcl.AsyncInterfaces (>= 10.0.10)
- ReactiveUI.Primitives.Async.Reactive (>= 7.1.0)
- ReactiveUI.Primitives.Reactive (>= 7.1.0)
-
net8.0
- IoT-Driver.Core (>= 1.0.2)
- Microsoft.Bcl.AsyncInterfaces (>= 10.0.10)
- ReactiveUI.Primitives.Async.Reactive (>= 7.1.0)
- ReactiveUI.Primitives.Reactive (>= 7.1.0)
-
net9.0
- IoT-Driver.Core (>= 1.0.2)
- Microsoft.Bcl.AsyncInterfaces (>= 10.0.10)
- ReactiveUI.Primitives.Async.Reactive (>= 7.1.0)
- ReactiveUI.Primitives.Reactive (>= 7.1.0)
NuGet packages (1)
Showing the top 1 NuGet packages that depend on IoT-Driver.S7PlcRx.Reactive:
| Package | Downloads |
|---|---|
|
MQTTnet.Rx.S7Plc.Reactive
ReactiveUI.Primitives extensions for MQTTnet clients, brokers, and industrial device bridges |
GitHub repositories
This package is not used by any popular GitHub repositories.
Siemens S7 logical-tag communication, native multi-variable operations, and reactive observation across supported target frameworks.