ZL.IotHub
2.2.17
dotnet add package ZL.IotHub --version 2.2.17
NuGet\Install-Package ZL.IotHub -Version 2.2.17
<PackageReference Include="ZL.IotHub" Version="2.2.17" />
<PackageVersion Include="ZL.IotHub" Version="2.2.17" />
<PackageReference Include="ZL.IotHub" />
paket add ZL.IotHub --version 2.2.17
#r "nuget: ZL.IotHub, 2.2.17"
#:package ZL.IotHub@2.2.17
#addin nuget:?package=ZL.IotHub&version=2.2.17
#tool nuget:?package=ZL.IotHub&version=2.2.17
ZL.IotHub
工业 PLC 数据采集运行时(.NET)。目标框架:netstandard2.0 / net48 / net8.0 / net10.0。
它解决的不是「能不能连上 PLC」,而是「连上之后」: 几百上千个点位如何采得快、采得稳,坏一个点如何不拖垮整块。
为什么需要这一层
通用 PLC 通讯库解决的是「连上设备」。但当点表从几十个涨到几百上千个时, 瓶颈会变成另外几件事:
- 逐个读点 ⇒ 请求次数爆炸,采集周期上不去;
- 一个坏点超时 ⇒ 拖垮整块采集;
- 值没变也上报 ⇒ 无效数据淹没业务;
- 采集逻辑散在业务代码里 ⇒ 无法嵌入、无法复用。
ZL.IotHub 就是这一层运行时:把「地址 → 合并分块 → 解码 → 变化筛选 → 隔离恢复 → 通知」 收敛成一个可嵌入的内核。
实测数据
来源:仓内 docs/CORE_CAPABILITY_BRIEF.md(2026-04-09 实测)
| 指标 | 实测值 |
|---|---|
| 稳定性 | successRate = 100%,failedReads = 0 |
| 合并能力 | 300 个点位 → 4 个块,请求数减少 98.67% |
| 吞吐 | 约 670 次读取/秒、约 50,277 点位/秒 |
| 解码链路 | DecodedTagValues = 1,005,600(统计自洽) |
核心能力
- 地址合并与批量读取:
PlcReadBlockBuilder按地址间隙、块大小与效率自动分块 - 数据解码:
PlcValueExtractor支持常见基础类型(含端序 / 字序适配) - 多速率采样:按
ScanRate分组执行采样波次 - 变更感知:
Deadband死区过滤,减少无效上报 - 隔离与恢复:坏点
Quarantine+ 重试,避免单点拖垮整块 - 实时通知订阅:点位级订阅与事件推送
- OPC UA 服务端:可作为 OPC UA 数据源对外提供
- 嵌入式诊断:性能指标与报告落盘(JSON / Markdown)
协议支持(原生驱动,均在本仓实现)
| 类别 | 驱动 |
|---|---|
| 西门子 | SiemensS7Driver、S7NativeDriver |
| 三菱 / 松下 / 基恩士 | MitsubishiMcDriver、MelsecA1EDriver、MelsecFxDriver、MelsecFxLinksOverTcp、PanasonicMcDriver、KeyenceMcDriver、PanasonicMewtocolDriver |
| 欧姆龙 | OmronFinsDriver、OmronHostLinkOverTcp |
| AB / 倍福 | AllenBradleyCipDriver、BeckhoffAdsNet |
| Modbus 全系 | ModbusTcpDriver、ModbusRtuDriver、ModbusRtuOverTcpDriver、ModbusAsciiDriver |
| Modbus 语义映射 | 台达 DeltaTcpDriver、汇川 InovanceTcpDriver、信捷 XinJeTcpDriver、埃斯顿 EstunTcpDriver、麦格米特 MegMeetTcpDriver、FreedomTcpDriver |
| 其他 | FatekTcpDriver、DaliDriver、DlmsDriver、MBusDriver、HartIpDriver、MTConnectDriver、HttpRestDriver、SerialDriverBase |
上表均为本仓自研原生驱动,不依赖任何第三方 PLC 通讯库。
安装
dotnet add package ZL.IotHub
免费额度与授权
- ≤ 10 台设备:协议全开,无需授权,可直接用于生产验证;
- > 10 台:需正式设备授权(一次性设备授权码)。
授权咨询:微信 qwdingyu
相关包
| 包 | 作用 |
|---|---|
ZL.IotHub.X |
可选的外部适配包(第三方通讯库驱动接入) |
ZL.IotHub.Server |
SCADA 实时网关:SignalR 推送 + REST 查询 |
ZL.IotHub.Bridges |
本地事件桥接与可选远程推送 |
ZL.Tag |
Tag 抽象与模型 |
ZL.License |
授权基础设施 |
示例(可直接运行)
示例仓库:https://github.com/qwdingyu/ZL.IotHubDemo
每个示例都只引用 NuGet 包,可以独立编译运行、直接拷进你的项目:
| 示例 | 演示什么 |
|---|---|
| BatchRead | 地址合并批量读取:实测 300 个点位 → 6 个读取块,请求数减少 98% |
| QuickStart | 采集最小闭环:连接 → 读取 → 写入 → 读回一致 |
| Events | 变化上报 / 事件订阅:值变了才回调 |
没有真机也能跑:示例演示了如何用本机仿真器(
dotnet tool install -g PlcSimulator.Cli)先跑通。
许可
专有商业许可,详见 LICENSE.txt。
| Product | Versions Compatible and additional computed target framework versions. |
|---|---|
| .NET | net5.0 was computed. net5.0-windows was computed. net6.0 was computed. net6.0-android was computed. net6.0-ios was computed. net6.0-maccatalyst was computed. net6.0-macos was computed. net6.0-tvos was computed. net6.0-windows was computed. net7.0 was computed. net7.0-android was computed. net7.0-ios was computed. net7.0-maccatalyst was computed. net7.0-macos was computed. net7.0-tvos was computed. net7.0-windows was computed. net8.0 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 was computed. 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. |
| .NET Core | netcoreapp2.0 was computed. netcoreapp2.1 was computed. netcoreapp2.2 was computed. netcoreapp3.0 was computed. netcoreapp3.1 was computed. |
| .NET Standard | netstandard2.0 is compatible. netstandard2.1 was computed. |
| .NET Framework | net461 was computed. net462 was computed. net463 was computed. net47 was computed. net471 was computed. net472 was computed. net48 is compatible. net481 was computed. |
| MonoAndroid | monoandroid was computed. |
| MonoMac | monomac was computed. |
| MonoTouch | monotouch was computed. |
| Tizen | tizen40 was computed. tizen60 was computed. |
| Xamarin.iOS | xamarinios was computed. |
| Xamarin.Mac | xamarinmac was computed. |
| Xamarin.TVOS | xamarintvos was computed. |
| Xamarin.WatchOS | xamarinwatchos was computed. |
-
.NETFramework 4.8
- Microsoft.AspNetCore.SystemWebAdapters (>= 2.2.1)
- Microsoft.CSharp (>= 4.7.0)
- Newtonsoft.Json (>= 13.0.4)
- NLog (>= 6.0.7)
- System.Buffers (>= 4.6.1)
- System.Data.DataSetExtensions (>= 4.5.0)
- System.IO.Ports (>= 9.0.4)
- System.Memory (>= 4.6.3)
- System.Runtime.Caching (>= 10.0.1)
- System.Text.Encoding.CodePages (>= 8.0.0)
- System.Threading.Channels (>= 8.0.0)
- System.Threading.Tasks.Extensions (>= 4.5.4)
- ZL.License (>= 2.2.17)
-
.NETStandard 2.0
- Microsoft.CSharp (>= 4.7.0)
- Newtonsoft.Json (>= 13.0.4)
- NLog (>= 6.0.7)
- System.Buffers (>= 4.6.1)
- System.Data.DataSetExtensions (>= 4.5.0)
- System.IO.Ports (>= 9.0.4)
- System.Memory (>= 4.6.3)
- System.Runtime.Caching (>= 10.0.1)
- System.Text.Encoding.CodePages (>= 8.0.0)
- System.Threading.Channels (>= 8.0.0)
- System.Threading.Tasks.Extensions (>= 4.5.4)
- ZL.License (>= 2.2.17)
-
net10.0
- Newtonsoft.Json (>= 13.0.4)
- NLog (>= 6.0.7)
- OPCFoundation.NetStandard.Opc.Ua.Server (>= 1.5.378.134)
- System.Data.DataSetExtensions (>= 4.5.0)
- System.IO.Ports (>= 9.0.4)
- System.Runtime.Caching (>= 10.0.1)
- ZL.License (>= 2.2.17)
-
net8.0
- Newtonsoft.Json (>= 13.0.4)
- NLog (>= 6.0.7)
- OPCFoundation.NetStandard.Opc.Ua.Server (>= 1.5.378.134)
- System.IO.Ports (>= 9.0.4)
- System.Runtime.Caching (>= 10.0.1)
- ZL.License (>= 2.2.17)
NuGet packages (5)
Showing the top 5 NuGet packages that depend on ZL.IotHub:
| Package | Downloads |
|---|---|
|
ZL.EdgeService
Package Description |
|
|
ZL.Iot.Runner.Generator
Package Description |
|
|
ZL.Iot.Plugin
Package Description |
|
|
ZL.Iot.Runner
Package Description |
|
|
ZL.Iot.Controls
ZL.Iot.Controls 公共 WinForms 控件库,供 IotDebug 与 ZL.Iot.Runner.Desktop 共用。 |
GitHub repositories
This package is not used by any popular GitHub repositories.
| Version | Downloads | Last Updated |
|---|---|---|
| 2.2.17 | 230 | 10/27/2026 |
| 2.2.16-beta.3 | 93 | 10/15/2026 |
| 2.2.16-beta.2 | 79 | 10/15/2026 |
| 2.2.16-beta.1 | 84 | 10/15/2026 |
| 2.2.15 | 204 | 10/8/2026 |
| 2.2.14 | 192 | 10/6/2026 |
| 2.2.13 | 247 | 9/29/2026 |
| 2.2.12 | 194 | 9/28/2026 |
| 2.2.11 | 222 | 9/23/2026 |
| 2.2.10 | 163 | 9/21/2026 |
| 2.2.8 | 187 | 9/11/2026 |
| 2.2.7 | 170 | 9/11/2026 |
| 2.2.6 | 177 | 9/10/2026 |
| 2.2.5 | 185 | 9/10/2026 |
| 2.2.4 | 214 | 9/6/2026 |
| 2.2.3 | 180 | 9/4/2026 |
| 2.2.2 | 173 | 9/4/2026 |
| 2.2.1 | 484 | 6/26/2026 |
| 0.0.1-trusted | 195 | 6/26/2026 |