8000 GitHub - ChrisPulman/IoT-DriverCore: IoT‑DriverCore is a modular, vendor‑neutral framework for building and managing drivers for PLCs and industrial IoT devices. It provides a unified API, consistent driver lifecycle, and scalable integration for edge, gateway, and automation systems. · GitHub
[go: up one dir, main page]

Skip to content

About

IoT‑DriverCore is a modular, vendor‑neutral framework for building and managing drivers for PLCs and industrial IoT devices. It provides a unified API, consistent driver lifecycle, and scalable integration for edge, gateway, and automation systems.

Topics

Resources

Stars

16 stars

Watchers

0 watching

Forks

Repository files navigation

A central industrial edge gateway connecting PLCs, field instruments, serial links, and reactive data streams

IoT-DriverCore

NuGet packages

The badges below report the current NuGet version and total downloads for every package produced by this repository.

Family Package Version Downloads
Shared core IoT-Driver.Core IoT-Driver.Core version IoT-Driver.Core downloads
Allen-Bradley IoT-Driver.ABPlcRx IoT-Driver.ABPlcRx version IoT-Driver.ABPlcRx downloads
Allen-Bradley IoT-Driver.ABPlcRx.Reactive IoT-Driver.ABPlcRx.Reactive version IoT-Driver.ABPlcRx.Reactive downloads
Allen-Bradley IoT-Driver.ABPlcRx.NativeImport IoT-Driver.ABPlcRx.NativeImport version IoT-Driver.ABPlcRx.NativeImport downloads
Allen-Bradley IoT-Driver.ABPlcRx.Generators IoT-Driver.ABPlcRx.Generators version IoT-Driver.ABPlcRx.Generators downloads
Mitsubishi IoT-Driver.MitsubishiRx IoT-Driver.MitsubishiRx version IoT-Driver.MitsubishiRx downloads
Mitsubishi IoT-Driver.MitsubishiRx.Reactive IoT-Driver.MitsubishiRx.Reactive version IoT-Driver.MitsubishiRx.Reactive downloads
Mitsubishi IoT-Driver.MitsubishiRx.Generators IoT-Driver.MitsubishiRx.Generators version IoT-Driver.MitsubishiRx.Generators downloads
Modbus IoT-Driver.ModbusRx IoT-Driver.ModbusRx version IoT-Driver.ModbusRx downloads
Modbus IoT-Driver.ModbusRx.Reactive IoT-Driver.ModbusRx.Reactive version IoT-Driver.ModbusRx.Reactive downloads
Modbus IoT-Driver.ModbusRx.Generators IoT-Driver.ModbusRx.Generators version IoT-Driver.ModbusRx.Generators downloads
Omron IoT-Driver.OmronPlcRx IoT-Driver.OmronPlcRx version IoT-Driver.OmronPlcRx downloads
Omron IoT-Driver.OmronPlcRx.Reactive IoT-Driver.OmronPlcRx.Reactive version IoT-Driver.OmronPlcRx.Reactive downloads
Omron IoT-Driver.OmronPlcRx.Generators IoT-Driver.OmronPlcRx.Generators version IoT-Driver.OmronPlcRx.Generators downloads
Siemens S7 IoT-Driver.S7PlcRx IoT-Driver.S7PlcRx version IoT-Driver.S7PlcRx downloads
Siemens S7 IoT-Driver.S7PlcRx.Reactive IoT-Driver.S7PlcRx.Reactive version IoT-Driver.S7PlcRx.Reactive downloads
Siemens S7 IoT-Driver.S7PlcRx.Generators IoT-Driver.S7PlcRx.Generators version IoT-Driver.S7PlcRx.Generators downloads
Serial and sockets IoT-Driver.SerialPortRx IoT-Driver.SerialPortRx version IoT-Driver.SerialPortRx downloads
Serial and sockets IoT-Driver.SerialPortRx.Reactive IoT-Driver.SerialPortRx.Reactive version IoT-Driver.SerialPortRx.Reactive downloads
Serial and sockets IoT-Driver.SerialPortRx.Generators IoT-Driver.SerialPortRx.Generators version IoT-Driver.SerialPortRx.Generators downloads
Beckhoff TwinCAT IoT-Driver.TwinCATRx IoT-Driver.TwinCATRx version IoT-Driver.TwinCATRx downloads
Beckhoff TwinCAT IoT-Driver.TwinCATRx.Reactive IoT-Driver.TwinCATRx.Reactive version IoT-Driver.TwinCATRx.Reactive downloads
Beckhoff TwinCAT IoT-Driver.TwinCATRx.Core IoT-Driver.TwinCATRx.Core version IoT-Driver.TwinCATRx.Core downloads
Beckhoff TwinCAT IoT-Driver.TwinCATRx.Core.Reactive IoT-Driver.TwinCATRx.Core.Reactive version IoT-Driver.TwinCATRx.Core.Reactive downloads
Beckhoff TwinCAT IoT-Driver.TwinCATRx.Generators IoT-Driver.TwinCATRx.Generators version IoT-Driver.TwinCATRx.Generators downloads

Overview

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.

Included drivers and transports

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

Shared logical-tag core

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.

Choose a package variant

Use the unsuffixed package by default:

dotnet add package IoT-Driver.S7PlcRx

Choose the matching .Reactive package when the application already uses the System.Reactive-compatible ReactiveUI.Primitives.Reactive family:

dotnet add package IoT-Driver.S7PlcRx.Reactive

The .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

Common usage model

Although wire protocols differ, driver applications generally follow the same composition:

  1. Select the base or .Reactive package family.
  2. Configure a transport, PLC model, endpoint, route, rack/slot, unit/node identifier, timeouts, and polling deliberately.
  3. Register typed physical tags or create a protocol request.
  4. Map important physical addresses to logical tag keys when application code should not know wire addresses.
  5. Subscribe to value, connection, write-result, and error streams before starting operational traffic.
  6. Use protocol-native batch operations for adjacent or grouped values.
  7. Validate writes, cancellation, retry, and reconnect behavior with the supplied simulator or in-memory seam.
  8. 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.

Reactive and async streams

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.

AI-agent skills

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

Build and test

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 1

Hardware-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.

Repository layout

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

License

IoT-DriverCore is licensed under the MIT License.

About

IoT‑DriverCore is a modular, vendor‑neutral framework for building and managing drivers for PLCs and industrial IoT devices. It provides a unified API, consistent driver lifecycle, and scalable integration for edge, gateway, and automation systems.

Topics

Resources

Stars

16 stars

Watchers

0 watching

Forks

Releases

Sponsor this project

Used by

Contributors

Languages

0