The badges below report the current NuGet version and total downloads for every package produced by this repository.
IoT-DriverCore is a collection of reactive .NET drivers and shared contracts for PLCs, industrial networks, serial devices, and edge applications. The migrated libraries retain their protocol-specific capabilities while using consistent package metadata, modern IoT.Driver.* namespaces, observable and async-observable streams, logical tags, deterministic test seams, and TUnit tests on Microsoft Testing Platform.
The repository is intentionally modular. Install only the protocol family required by an application. Each family has a default package built on the lean ReactiveUI.Primitives stack and, where listed, a .Reactive package for consumers that need the System.Reactive-compatible bridge. Do not reference both variants of one family unless the application deliberately isolates their namespaces.
Caution
PLC and field-device writes can move machinery, alter process conditions, or defeat assumptions made by an operator. Commission against simulators and non-production controllers, validate every address and type, retain independent safety interlocks, use network segmentation and least privilege, and treat a successful protocol response as communication success rather than proof of a safe machine state.
| Driver family | Protocols and transports | Typical equipment | Main capabilities | Detailed guide |
|---|---|---|---|---|
| Allen-Bradley | CIP / EtherNet/IP through libplctag | ControlLogix, CompactLogix, Micro800 where supported, PLC-5, SLC 500, MicroLogix | Typed tag registration, word-bit access, grouped scans, bulk read/write, health streams, logical tags, simulator, generated bindings | ABPlcRx README |
| Mitsubishi | MC Protocol / SLMP; TCP, UDP, and serial; 1E/3E/4E and 1C/3C/4C frames; binary and ASCII | MELSEC A, QnA, Q, L, iQ-R, iQ-F, FX5 and compatible endpoints | Device, random, block, monitor, memory, diagnostics, remote-control and loopback operations; tag databases; polling and write pipelines; simulator transports | MitsubishiRx README |
| Modbus | Modbus TCP, UDP, RTU, and ASCII | PLCs, drives, meters, remote I/O, gateways, process instruments | Client/master operations, slave/server data stores, coils and discrete inputs, input and holding registers, file records, diagnostics, logical tags, observable operations, simulation | ModbusRx README |
| Omron | FINS over TCP/UDP, Host Link FINS serial, Toolbus serial | Omron PLCs exposing FINS or supported serial endpoints | Typed memory-area tags, polling, reads/writes, clock and cycle-time operations, BCD helpers, logical tags, serial frame codecs, simulation, generated bindings | OmronPlcRx README |
| Siemens S7 | S7 communication over ISO-on-TCP | S7-200, S7-300, S7-400, S7-1200, S7-1500 | DB/input/output/marker/timer/counter addressing, polling, typed reads and queued writes, multi-variable batches, runtime and generated bindings, cache/performance/production helpers, logical tags | S7PlcRx README |
| Serial and sockets | Serial ports, TCP streams, UDP datagrams | Serial instruments, barcode readers, scales, gateways, protocol adapters, network devices | Reactive bytes/text/lines/batches, manual async reads, framing helpers, discovery, connection/error streams, TCP and UDP clients, deterministic in-memory links | SerialPortRx README |
| Beckhoff TwinCAT | ADS for TwinCAT 2 and TwinCAT 3 | Beckhoff PLC runtimes and ADS routes | Configuration-driven notifications, correlated reads/writes, typed observables, structured values, logical tags, dynamic and generated bindings, Windows service monitoring, in-memory ADS simulation | TwinCATRx README |
IoT-Driver.Core (project and assembly CP.IoT.Core) provides the protocol-neutral composition layer used by the drivers:
- strongly typed
LogicalTagKey<T>identifiers; - logical tag definitions, groups, catalogues, validation, and CSV persistence;
- single and batch read/write contracts;
- observable and
IAsyncEnumerable<T>change streams; - contiguous batch planning where a protocol can combine adjacent addresses;
- SQLite-backed stores and build-transitive integration.
This keeps application code focused on logical names while protocol adapters own wire addresses, batching, transport errors, and conversion. It also lets an application compose more than one protocol family without forcing their concrete clients into an inheritance hierarchy.
Use the unsuffixed package by default:
dotnet add package IoT-Driver.S7PlcRxChoose the matching .Reactive package when the application already uses the System.Reactive-compatible ReactiveUI.Primitives.Reactive family:
dotnet add package IoT-Driver.S7PlcRx.ReactiveThe .Reactive libraries are shared-source builds with corresponding .Reactive namespaces. Their protocol concepts match the base packages, but scheduler, unit, observable factory, and extension types can differ. Follow the package-family README for exact namespaces and signatures.
Every driver family has a standalone source-generator NuGet package. Install the matching .Generators package when generated bindings are required; no runtime package embeds a generator assembly.
| Family | Standalone generator package | Delivery |
|---|---|---|
| Allen-Bradley | IoT-Driver.ABPlcRx.Generators |
Install separately when generated bindings are required |
| Mitsubishi | IoT-Driver.MitsubishiRx.Generators |
Install separately when generated bindings are required |
| Modbus | IoT-Driver.ModbusRx.Generators |
Install separately when generated register maps are required |
| Omron | IoT-Driver.OmronPlcRx.Generators |
Install separately when generated bindings are required |
| Siemens S7 | IoT-Driver.S7PlcRx.Generators |
Install separately when generated bindings are required |
| Serial and sockets | IoT-Driver.SerialPortRx.Generators |
Install separately when generated bindings are required |
| Beckhoff TwinCAT | IoT-Driver.TwinCATRx.Generators |
Install separately when generated bindings are required |
Although wire protocols differ, driver applications generally follow the same composition:
- Select the base or
.Reactivepackage family. - Configure a transport, PLC model, endpoint, route, rack/slot, unit/node identifier, timeouts, and polling deliberately.
- Register typed physical tags or create a protocol request.
- Map important physical addresses to logical tag keys when application code should not know wire addresses.
- Subscribe to value, connection, write-result, and error streams before starting operational traffic.
- Use protocol-native batch operations for adjacent or grouped values.
- Validate writes, cancellation, retry, and reconnect behavior with the supplied simulator or in-memory seam.
- Dispose clients and subscriptions together where the public lifecycle supports it.
The complete API inventories, configuration rules, and worked C# examples live in the seven linked package guides above.
The default packages expose BCL IObservable<T> values through ReactiveUI.Primitives and, where supported, IObservableAsync<T> for async-native processing. This supports:
- value-on-change observation without polling in application code;
- connection, health, error, and write-result telemetry;
- sampling and buffering for UI, logging, and historian workloads;
- cancellation-aware async consumption;
- composition across drivers while keeping protocol clients separate.
Keep subscriptions alive for the required session and dispose them with the owning driver. A high-rate PLC or socket stream should be sampled, buffered, or otherwise bounded before it reaches a UI, database, or remote telemetry sink.
Every NuGet package includes a detailed skill at skills/<skill-name>/SKILL.md. The skills tell an AI agent which namespace and package variant to use, how to configure and operate the driver, which safety and lifecycle rules are mandatory, how to test without hardware, and where to find the full packaged README.
| Family | Packaged skill |
|---|---|
| Shared core | cp-iot-core |
| Allen-Bradley | ab-plc-rx |
| Mitsubishi | mitsubishi-rx |
| Modbus | modbus-rx |
| Omron | omron-plc-rx |
| Siemens S7 | s7-plc-rx |
| Serial and sockets | serial-port-rx |
| Beckhoff TwinCAT | twincat-rx |
The repository uses the .NET SDK pinned by global.json, NUKE for the build entry point, TUnit assertions, and Microsoft Testing Platform.
./build.cmd Compile --configuration Release
dotnet test --solution src/IoT-DriverCore.slnx --configuration Release --no-build --max-parallel-test-modules 1Hardware-facing tests require explicitly configured controllers or virtual serial ports. Use the simulator and in-memory suites for routine development; keep live PLC tests opt-in and read-only unless a test plan explicitly authorizes controlled writes.
| Path | Purpose |
|---|---|
src/ |
Runtime libraries, analyzers, tests, simulators, examples, and the solution |
packagereadme/ |
NuGet-facing README for each protocol family |
skills/ |
AI-agent skills included in the corresponding NuGet packages |
images/ |
Package icons and repository hero artwork |
build/ |
NUKE build application |
.github/workflows/ |
Build, test, package, sign, and publish workflows |
IoT-DriverCore is licensed under the MIT License.