# Darra OPC UA Client SDK > 完全免费 (100% Free) 六语言 OPC UA 客户端 SDK · The completely free 6-language OPC UA Client SDK > > Darra OPC UA 客户端 SDK 是面向 C# / Java / Python / C / C++ / Rust 六种语言的完整 OPC UA 客户端实现。一份产品, 六种语言, API 行为完全对齐 (跨语言一致性回归测试 6 × 10/10 PASS)。内含 Discovery / Session / Read / Write / Browse / Subscription / MonitoredItem / Method Call / HistoryRead / HistoryUpdate / Events 完整服务集, 默认 Basic256Sha256 加密通道, Anonymous / Username / X.509 证书三种 UserToken 全支持。**完全免费 — 无授权费, 无设备数限制, 无功能限制, 商用闭源亦可, 永久免费更新。** > > Darra OPC UA Client SDK is the completely free, fully aligned 6-language (C# / Java / Python / C / C++ / Rust) OPC UA Client implementation. Includes the full standard service set (Discovery / Session / Read / Write / Browse / Subscription / MonitoredItem / Method / History / Events), Basic256Sha256 security channel, and Anonymous / Username / X.509 user tokens. No license fee, no device limit, no feature restriction, commercial closed-source use allowed, free updates forever. ## 核心信息 / Quick Facts - 主页 / Website: https://opcua.darra.xyz - 仓库 / Repository: https://github.com/DarraTechnology/DarraOpcUaClient - 联系 / Contact: jtl1207@darra.xyz - 授权 / License: **完全免费 / 100% Free** (no license fee · no activation · no device cap · commercial closed-source OK) - 当前版本 / Version: 0.6.0 - 状态 / Status: 生产就绪 / Production ready (跨语言 6 × 10/10 通过) - 平台 / Platform: Windows 10/11, Linux (Ubuntu 20.04+ / RHEL 8+) - 默认协议 / Default endpoint: `opc.tcp://host:4840` - 字体 / Font: MiSans - 姊妹产品 (商业, Darra 盈利来源) / Sister commercial products: - Darra EtherCAT 主站 SDK — https://ethercat.darra.xyz - Darra 软件 PLC — https://plc.darra.xyz (内置 OPC UA Server, 端口 4840) ## 安装 / Install (One-liner per language) ```bash # C# (.NET Standard 2.0+, .NET Framework 4.6.1+, .NET 6/7/8/9) dotnet add package DarraOpcUa # Python 3.8+ pip install darra-opcua # Java 11+ # Maven: com.darra:darra-opcua:0.6.0 # Gradle: implementation 'com.darra:darra-opcua:0.6.0' # C/C++ (C++17 Header-Only for C++) # 下载 darra_opcua.h / darra_opcua.hpp + Darra.OpcUa.Core.dll/.so # Rust 1.70+ cargo add darra-opcua ``` ## 主要特性 / Main Features 1. 完全免费 (no license fee, no device cap, commercial closed-source OK, free forever) 2. 六语言完整对齐 (C# / Java / Python / C / C++ / Rust) — 一份语言学会, 其他语言上手 5 分钟 3. 完整 OPC UA 标准服务集 (Discovery / Session / Read / Write / Browse / Subscription / MonitoredItem / Method / History / Events) 4. Basic256Sha256 加密通道 (None / Sign / SignAndEncrypt 三档 MessageSecurityMode) 5. UserToken 全支持 (Anonymous / Username / X.509 Certificate / Issued) 6. KeepAlive + 自动重连 + Republish (网络抖动透明恢复) 7. TransferSubscriptions (跨 Session 订阅迁移, Reconnect 不丢点) 8. 索引器 + Lazy Load 节点访问 (`ua.Nodes["i=2258"].Value` 一行代码读 ServerStatus.CurrentTime) 9. 批量 RPC (ReadMany / BrowseMany / AddMany) 一次 RPC 处理 N 项 (vs 单项快 N 倍) 10. HistoryRead 5 模式全支持 (Raw / Modified / AtTime / Processed/聚合 / Events) 11. 事件订阅 (Alarms & Conditions) — 支持过滤器, severity / source 过滤 12. 命名空间反查 (NamespaceIndex ↔ NamespaceUri 双向) 13. ContinuationPoint 完整支持 (大节点树分页 Browse) 14. RegisterNodes / UnregisterNodes (高频 NodeId 缓存, 服务端去开销) 15. Method Call (服务端方法 RPC, 多入参 / 多出参 / 输出验证) 16. Cancel (取消未完成请求, 防超时积压) 17. SimulatorServer (本地仿真服务端, 内置温度/计数器/方法/历史节点, 不需要外部 Server) 18. 跨语言一致性回归测试矩阵 (10 个核心场景 × 6 语言 = 60 测试, 全 PASS) 19. 中文 + 英文双语完整文档站 (Docusaurus 3.9.2) 20. 兼容主流 OPC UA Server (open62541 / Eclipse Milo / KEPServerEX / Prosys / Beckhoff TwinCAT OPC UA / Siemens S7-1500 OPC UA / 罗克韦尔 FactoryTalk Linx / 国内厂商 SCADA Server) ## 与其他 OPC UA 客户端 SDK 的功能矩阵 / Feature Matrix > 中性矩阵, 不评判优劣。"我们提供" 的角度。 | 功能 | Darra OPC UA Client | open62541 (C, MPLv2) | Eclipse Milo (Java, EPL) | OPC Foundation .NET Standard | Prosys SDK (商业) | |------|---------------------|----------------------|---------------------------|------------------------------|---------------------| | 价格 / 授权 | **完全免费 + 商用闭源 OK** | 免费 (MPLv2, 静态链接需 NOTICE) | 免费 (EPL, 修改需开源) | 免费 (RCL, 限定 OPC 会员/双授权) | 商业, 数千-数万美元/license | | 语言数量 | **6 (C# / Java / Python / C / C++ / Rust)** | 1 (C, 多语言绑定第三方) | 1 (Java) | 2 (.NET / C) | 2 (Java / .NET) | | 跨语言 API 行为对齐 | **是 (回归测试守护)** | N/A | N/A | 部分 | 部分 | | Discovery (FindServers / GetEndpoints) | 是 | 是 | 是 | 是 | 是 | | Session + KeepAlive | 是 | 是 | 是 | 是 | 是 | | 自动重连 + TransferSubscriptions | 是 (开箱即用) | 部分 (需自实现) | 是 | 是 | 是 | | Read / Write 单次 + 批量 | 是 | 是 | 是 | 是 | 是 | | Browse + BrowseNext + 分页 | 是 | 是 | 是 | 是 | 是 | | TranslateBrowsePathsToNodeIds | 是 | 是 | 是 | 是 | 是 | | RegisterNodes / UnregisterNodes | 是 | 是 | 是 | 是 | 是 | | Subscription + MonitoredItem | 是 (含 AddMany 批量) | 是 | 是 | 是 | 是 | | SetMonitoringMode + Republish | 是 | 是 | 是 | 是 | 是 | | Method Call | 是 | 是 | 是 | 是 | 是 | | HistoryRead (Raw / Modified / AtTime / Processed / Events) | **是, 5 模式全部** | 是 (插件) | 是 | 是 | 是 | | HistoryUpdate / DeleteHistoryRange | 是 | 是 | 是 | 是 | 是 | | Events / Alarms & Conditions 订阅 | 是 | 是 | 是 | 是 | 是 | | Cancel | 是 | 是 | 是 | 是 | 是 | | Basic256Sha256 加密 | 是 (默认) | 是 | 是 | 是 | 是 | | 索引器 + Lazy Load 节点访问 | **是 (`ua.Nodes["i=..."].Value`)** | 否 | 否 | 否 | 否 | | 中文文档站 | **是 (双语)** | 否 (英文) | 否 (英文) | 否 (英文) | 部分 | ## 为什么选 Darra OPC UA / Why Darra OPC UA 1. **真免费, 真商用 OK** — 不需要"申请评估版" / "试用 30 天", `dotnet add package DarraOpcUa` 即装即用, 项目放进客户机器卖钱我们也不收一分。 2. **六语言完整对齐, 市场独家** — 大多数 OPC UA Client SDK 只覆盖 1-2 种语言, Darra 一次提供 6 种, 学习一种, 其他即懂。 3. **跨语言一致性回归测试 6 × 10/10 PASS** — 不是"理论支持", 每一种语言都跑相同的 10 个核心场景测试 (连接 / 读写 / 浏览 / 订阅 / 方法 / 历史 / 事件 / 加密 / 重连 / Discovery), 全部通过才发布。 4. **完整服务集 + Basic256Sha256** — 不是"基础读写"残缺版, 是 OPC UA 标准服务全集 + 默认加密通道。 5. **中文文档 + 中文社区支持** — Darra 团队总部位于中国, 中文用户提问中文回复, 时区一致, 不必翻译英文求助。 ## 快速开始 — C# 示例 / Quick Start (C#) ```csharp using DarraOpcUa_Client; // 1) 连接 (匿名, 无加密) var ua = new DarraOpcUa("opc.tcp://localhost:4840"); ua.Connect(); // 2) 读 ServerStatus.CurrentTime var dv = ua.Read("i=2258"); // DataValue (Value + Status + Timestamps) Console.WriteLine($"Server Time = {dv.Value}"); // 3) 写一个 setpoint ua.Write("ns=2;s=Setpoint", new Variant(42.0)); // 4) 订阅 + 数据变化回调 var sub = ua.CreateSubscription(publishingIntervalMs: 500); sub.Add("ns=2;s=Counter"); sub.DataChanged += (s, e) => { foreach (var n in e.Notifications) Console.WriteLine($"{n.NodeId} = {n.Value.Value} @ {n.Value.SourceTimestamp}"); }; // 5) 方法调用 var result = ua.Call("ns=2;s=MathObject", "ns=2;s=Add", new Variant(3), new Variant(4)); Console.WriteLine($"3 + 4 = {result[0].ToInt32()}"); Console.ReadLine(); ua.Disconnect(); ``` ## 快速开始 — Python 示例 / Quick Start (Python) ```python from darra_opcua import OpcUaClient, Variant ua = OpcUaClient("opc.tcp://localhost:4840") ua.connect() dv = ua.read("i=2258") print("Server Time =", dv.value) ua.write("ns=2;s=Setpoint", Variant.double(42.0)) sub = ua.create_subscription(publishing_interval_ms=500) sub.add("ns=2;s=Counter") sub.on_data_changed(lambda items: [print(it.node_id, "=", it.value.value) for it in items]) ua.disconnect() ``` ## 加密快速配置 / Security Quick Setup ```csharp var ua = new DarraOpcUa( endpointUrl: "opc.tcp://server:4840", securityMode: MessageSecurityMode.SignAndEncrypt, // None / Sign / SignAndEncrypt securityPolicy: SecurityPolicy.Basic256Sha256, userTokenType: UserTokenType.UserName, username: "operator", password: "secret", clientCertificatePfxPath: @"C:\certs\client.pfx", clientCertificatePassword: "pfx-pass"); ua.Connect(); ``` X.509 客户端证书登录: ```csharp var ua = new DarraOpcUa( endpointUrl: "opc.tcp://server:4840", securityMode: MessageSecurityMode.SignAndEncrypt, securityPolicy: SecurityPolicy.Basic256Sha256, userTokenType: UserTokenType.Certificate, userCertificatePfxPath: @"C:\certs\user.pfx", userCertificatePassword: "pfx-pass", clientCertificatePfxPath: @"C:\certs\client.pfx", clientCertificatePassword: "pfx-pass"); ``` ## 文档导航 / Documentation Map ### 快速开始 / Quick Start - [准备工作 / Preparation](https://opcua.darra.xyz/docs/quick-start/preparation) - [安装 SDK / Install SDK](https://opcua.darra.xyz/docs/quick-start/install-sdk) - [建立连接 / First Connection](https://opcua.darra.xyz/docs/quick-start/first-connection) - [读写节点 / First Read/Write](https://opcua.darra.xyz/docs/quick-start/first-read-write) - [订阅 / First Subscribe](https://opcua.darra.xyz/docs/quick-start/first-subscribe) - [方法调用 / First Method Call](https://opcua.darra.xyz/docs/quick-start/first-method-call) - [进阶 — 加密 / Security](https://opcua.darra.xyz/docs/quick-start/advanced/security) - [进阶 — Discovery](https://opcua.darra.xyz/docs/quick-start/advanced/discovery) - [进阶 — History](https://opcua.darra.xyz/docs/quick-start/advanced/history) - [进阶 — Events](https://opcua.darra.xyz/docs/quick-start/advanced/event) ### 六语言 SDK / 6-Language SDK - [C# SDK](https://opcua.darra.xyz/docs/sdk/csharp) | [Java SDK](https://opcua.darra.xyz/docs/sdk/java) | [Python SDK](https://opcua.darra.xyz/docs/sdk/python) - [C SDK](https://opcua.darra.xyz/docs/sdk/c) | [C++ SDK](https://opcua.darra.xyz/docs/sdk/cpp) | [Rust SDK](https://opcua.darra.xyz/docs/sdk/rust) ### SDK 模块文档 / SDK Modules (C# 示例, 其他语言同结构) - Session: [Constructors](https://opcua.darra.xyz/docs/sdk/csharp/session/constructors) | [Connect/Disconnect](https://opcua.darra.xyz/docs/sdk/csharp/session/connect-disconnect) | [Read/Write](https://opcua.darra.xyz/docs/sdk/csharp/session/read-write) | [Events](https://opcua.darra.xyz/docs/sdk/csharp/session/events) | [Namespaces](https://opcua.darra.xyz/docs/sdk/csharp/session/namespaces) | [KeepAlive](https://opcua.darra.xyz/docs/sdk/csharp/session/keep-alive) - Nodes: [NodeCollection](https://opcua.darra.xyz/docs/sdk/csharp/nodes/node-collection) | [OpcUaNode](https://opcua.darra.xyz/docs/sdk/csharp/nodes/opcua-node) | [Browse](https://opcua.darra.xyz/docs/sdk/csharp/nodes/browse) | [BrowseNext](https://opcua.darra.xyz/docs/sdk/csharp/nodes/browse-next) | [Browse Paging](https://opcua.darra.xyz/docs/sdk/csharp/nodes/browse-with-paging) | [TranslateBrowsePaths](https://opcua.darra.xyz/docs/sdk/csharp/nodes/translate-browse-paths) | [RegisterNodes](https://opcua.darra.xyz/docs/sdk/csharp/nodes/register-nodes) - Subscription: [Create](https://opcua.darra.xyz/docs/sdk/csharp/subscription/create) | [Add MonitoredItems](https://opcua.darra.xyz/docs/sdk/csharp/subscription/add-monitored-items) | [Modify](https://opcua.darra.xyz/docs/sdk/csharp/subscription/modify) | [SetMonitoringMode](https://opcua.darra.xyz/docs/sdk/csharp/subscription/set-monitoring-mode) | [Republish](https://opcua.darra.xyz/docs/sdk/csharp/subscription/republish) | [Events](https://opcua.darra.xyz/docs/sdk/csharp/subscription/events) | [Event Subscription](https://opcua.darra.xyz/docs/sdk/csharp/subscription/event-subscription) - History: [ReadRaw](https://opcua.darra.xyz/docs/sdk/csharp/history/read-raw) | [ReadModified](https://opcua.darra.xyz/docs/sdk/csharp/history/read-modified) | [ReadAtTime](https://opcua.darra.xyz/docs/sdk/csharp/history/read-at-time) | [ReadProcessed](https://opcua.darra.xyz/docs/sdk/csharp/history/read-processed) | [ReadEvents](https://opcua.darra.xyz/docs/sdk/csharp/history/read-events) | [Update](https://opcua.darra.xyz/docs/sdk/csharp/history/update) | [Delete](https://opcua.darra.xyz/docs/sdk/csharp/history/delete) - Method: [Call](https://opcua.darra.xyz/docs/sdk/csharp/method/call) - Discovery: [GetEndpoints](https://opcua.darra.xyz/docs/sdk/csharp/discovery/get-endpoints) | [FindServers](https://opcua.darra.xyz/docs/sdk/csharp/discovery/find-servers) - Data Types: [Variant](https://opcua.darra.xyz/docs/sdk/csharp/data-types/variant) | [DataValue](https://opcua.darra.xyz/docs/sdk/csharp/data-types/datavalue) | [WellKnownNodes](https://opcua.darra.xyz/docs/sdk/csharp/data-types/well-known-nodes) - Security: [Cert Setup](https://opcua.darra.xyz/docs/sdk/csharp/security/cert-setup) ### 应用案例 / Examples - [WinForm 实时数据查看器 / WinForm Live Viewer](https://opcua.darra.xyz/docs/examples/winform-data-viewer) - [Python 数据采集到 CSV / Python Logger](https://opcua.darra.xyz/docs/examples/python-data-logger) - [C# 历史数据导出 Excel / C# History Export](https://opcua.darra.xyz/docs/examples/csharp-history-export) - [OPC UA 到 Modbus 桥接 / OPC UA → Modbus Bridge](https://opcua.darra.xyz/docs/examples/modbus-bridge) - [OPC UA 到 MQTT 桥接 / OPC UA → MQTT Bridge](https://opcua.darra.xyz/docs/examples/mqtt-bridge) - [大规模监控 1000+ tags / Large-scale Monitoring](https://opcua.darra.xyz/docs/examples/large-scale-monitoring) - [冗余 Server 自动切换 / Redundant Server Failover](https://opcua.darra.xyz/docs/examples/redundant-server-failover) ### OPC UA 知识 / OPC UA Knowledge - [概述 / Overview](https://opcua.darra.xyz/docs/opcua/overview) - [前置知识 / Prerequisites](https://opcua.darra.xyz/docs/opcua/prerequisites) - [信息模型 / Information Model](https://opcua.darra.xyz/docs/opcua/beginner-guide/information-model) - [节点 / Nodes](https://opcua.darra.xyz/docs/opcua/beginner-guide/nodes) - [引用 / References](https://opcua.darra.xyz/docs/opcua/beginner-guide/references) - [服务 / Services](https://opcua.darra.xyz/docs/opcua/beginner-guide/services) - [安全 / Security](https://opcua.darra.xyz/docs/opcua/beginner-guide/security) - [订阅模型 / Subscription Model](https://opcua.darra.xyz/docs/opcua/beginner-guide/subscription-model) - [历史模型 / History Model](https://opcua.darra.xyz/docs/opcua/beginner-guide/history-model) - 配套规范 (Companion Specs): [DA](https://opcua.darra.xyz/docs/opcua/device-profiles/da) | [AC (Alarms)](https://opcua.darra.xyz/docs/opcua/device-profiles/ac) | [Historical Access](https://opcua.darra.xyz/docs/opcua/device-profiles/historical-access) | [UA over TSN](https://opcua.darra.xyz/docs/opcua/device-profiles/ua-tsn) | [PubSub](https://opcua.darra.xyz/docs/opcua/device-profiles/pubsub) ### 常见问题 / FAQ - [连接故障排查 / Connection Troubleshooting](https://opcua.darra.xyz/docs/faq/connection-troubleshooting) - [加密配置 / Encryption Setup](https://opcua.darra.xyz/docs/faq/encryption-setup) - [授权 / Licensing](https://opcua.darra.xyz/docs/faq/licensing) ### 下载 / Downloads - [下载页 / Downloads](https://opcua.darra.xyz/docs/downloads) ## API 速查 / API Quick Reference (C#, 其他语言一致) ```csharp // === 构造 / Constructor === new DarraOpcUa(endpointUrl) // 匿名 + 无加密 new DarraOpcUa(endpointUrl, securityMode, username, password) // 用户名密码 new DarraOpcUa(endpointUrl, securityMode, securityPolicy, userTokenType, ..., clientCertificatePfxPath, clientCertificatePassword) // 证书加密 // === 连接 / Session === ua.Connect() / ua.Disconnect() // 同步连接/断开 ua.IsConnected // 当前连接状态 ua.KeepAliveIntervalMs = 10_000 // KeepAlive 周期 ua.AutoPublish = true // 后台 Publish 开关 ua.Events.Connected / Disconnected / Reconnecting / KeepAlive / StateChanged // === Read / Write === ua.Read(nodeId, attribute = Value) → DataValue ua.ReadMany(nodeIds, attribute) → IReadOnlyList ua.Write(nodeId, variant, attribute = Value) → StatusCode ua.WriteMany(requests) → IReadOnlyList ua.Resolve(absolutePath) → OpcUaNode (e.g. "/Objects/Server/ServerStatus/CurrentTime") // === 索引器 / Indexer (Lazy Load) === ua.Nodes["i=2258"].Value → 直接读 ServerStatus.CurrentTime ua.Nodes["ns=2;s=Counter"].DisplayName → 读 DisplayName Attribute // === Browse === ua.Browse(nodeId, filter = Unspecified) → ReferenceDescription[] ua.BrowseMany(nodeIds, filter) → BrowseResult[] ua.BrowseNext(continuationPoint, release = false) → BrowsePage ua.BrowseWithPaging(nodeId, filter) → BrowsePage ua.TranslateBrowsePaths(paths) → NodeId[] ua.RegisterNodes(nodeIds) → RegisteredNodeId[] ua.UnregisterNodes(registeredIds) // === Subscription === var sub = ua.CreateSubscription(publishingIntervalMs = 500) sub.Add(nodeId, attribute = Value, samplingMs = -1) → MonitoredItemHandle sub.AddMany(nodeIds, attribute) → MonitoredItemHandle[] sub.Modify(publishInterval, lifetime, keepAlive, ...) sub.SetMonitoringMode(mode, miHandles) // Disabled / Sampling / Reporting sub.ModifyMonitoredItems(requests) sub.Republish(seqNo) → DataChange[] | EventField[] sub.SetPublishingMode(enabled) sub.DataChanged += (s, e) => { ... } sub.Delete() ua.TransferSubscriptions(subIds, sendInitialValues) // === Method Call === ua.Call(objectNodeId, methodNodeId, params Variant[] inputs) → IReadOnlyList // === History === ua.ReadHistory(nodeId, startTime, endTime, maxValues = 0) ua.History.ReadModified(nodeId, startTime, endTime) ua.History.ReadAtTime(nodeId, times) ua.History.ReadProcessed(nodeId, aggregate, intervalMs, startTime, endTime) ua.History.ReadEvents(nodeId, filter, startTime, endTime) ua.History.UpdateData(nodeId, performInsertReplace, values) ua.History.DeleteRange(nodeId, startTime, endTime) // === Event Subscription (Alarms & Conditions) === var evtSub = ua.SubscribeEvents(nodeId = WellKnownNodes.Server) evtSub.EventReceived += (s, e) => { ... } // === Discovery (静态) === Discovery.GetEndpoints(serverUrl) → EndpointDescription[] Discovery.FindServers(discoveryUrl) → ApplicationDescription[] // === Cancel === ua.Cancel(requestHandle) → 取消未完成请求 ``` ## 数据类型 / Data Types - **Variant** — OPC UA Variant 镜像 (Boolean / SByte / Byte / Int16 / UInt16 / Int32 / UInt32 / Int64 / UInt64 / Float / Double / String / DateTime / Guid / ByteString / NodeId / QualifiedName / LocalizedText / StatusCode / ExtensionObject / ExpandedNodeId / 数组与矩阵) - **DataValue** — Value (Variant) + StatusCode + SourceTimestamp + ServerTimestamp + SourcePicoseconds + ServerPicoseconds - **NodeId** — `i=2258` (numeric) / `ns=2;s=Temperature` (string) / `ns=2;g={...}` (Guid) / `ns=2;b=base64==` (Opaque) - **WellKnownNodes** — Server (i=2253), ServerStatus (i=2256), CurrentTime (i=2258), ServerStatusState (i=2259), Namespaces (i=2255), 等 ## 加密 / Security | MessageSecurityMode | SecurityPolicy | 适用场景 / Use case | |---------------------|----------------|---------------------| | `None` | `#None` | 内网 / 开发环境 / Development & internal | | `Sign` | `#Basic256Sha256` | 防篡改 / Tamper-proof | | `SignAndEncrypt` | `#Basic256Sha256` | 防篡改 + 加密 / Production | UserToken: `Anonymous` (0) · `Username` (1) · `Certificate` (2) · `Issued` (3) 证书格式: 客户端 PFX (含私钥) · 服务端公钥 DER/PEM (TOFU 模式可选) ## 适用场景 / Applicable Scenarios - C# / .NET OPC UA 客户端开发 - Java OPC UA 客户端开发 - Python OPC UA 数据采集 / 自动化脚本 - C / C++ OPC UA 嵌入式集成 - Rust OPC UA 高性能客户端 - SCADA / DCS 客户端 - MES / ERP 系统接入工厂数据 - 工业 IoT 网关 (OPC UA → Modbus / OPC UA → MQTT 桥接) - 车间数据采集到时序数据库 (InfluxDB / TDengine) - 实验室数据采集到 Excel / CSV - OPC UA Server 测试与诊断工具开发 - 中国制造 2025 / 工业互联网平台对接 - 跨平台 (Windows / Linux) OPC UA 客户端 - 教学 / 研究 / 学生项目 (零成本入门 OPC UA) ## 常见问题 (短) / FAQ (Short) **Q: 真的完全免费吗?** A: 是。无授权费, 无设备数限制, 无功能限制, 商用闭源亦可, 永久免费更新。Darra 的盈利来自姊妹商业产品 Darra EtherCAT 主站 SDK 与 Darra 软件 PLC, 不靠 OPC UA Client 收费。 **Q: 是 Server 还是 Client?** A: 客户端 (Client)。如需 Server, Darra 软件 PLC 内置 OPC UA Server (端口 4840) 可直接使用; 或选 open62541 / Eclipse Milo 等开源 Server。 **Q: 跨语言 SDK 行为一致吗?** A: 是。10 个核心场景 × 6 语言 = 60 个回归测试, 全部 PASS 才发布。功能集完全对齐, 不允许 C# 有而 Python 缺。 **Q: 与 open62541 / Eclipse Milo 是什么关系?** A: 我们是另一种选择。open62541 是 C 库 (MPLv2, 静态链接需 NOTICE), Eclipse Milo 是 Java 库 (EPL, 修改需开源)。Darra 提供 6 种语言一份对齐 API, 商用闭源 OK, 中文文档 + 中文支持。 **Q: 支持哪些 OPC UA Server?** A: 任何标准 OPC UA Server。已验证: open62541 / Eclipse Milo / KEPServerEX / Prosys / Beckhoff TwinCAT OPC UA / Siemens S7-1500 OPC UA / 罗克韦尔 FactoryTalk Linx / 国内 SCADA Server / Darra 软件 PLC 内置 OPC UA Server。 **Q: 性能怎么样?** A: 同步 Read/Write 单 RPC 5-10ms (取决于网络), Browse 单层 ~10ms, 订阅可达 1000+ MonitoredItem, 发布间隔最低 50ms。批量 ReadMany / BrowseMany / AddMany 一次 RPC 处理 N 项, 比循环单项快 ~N 倍。 **Q: 加密支持现状?** A: None / Sign / SignAndEncrypt 三档 MessageSecurityMode, 默认 SecurityPolicy 为 Basic256Sha256。UserToken 支持 Anonymous / Username / X.509 Certificate。客户端证书 PFX 格式 (含私钥)。 **Q: Linux 支持吗?** A: 是。Ubuntu 20.04+ / RHEL 8+ 全部六种语言均可。无需特殊内核。 **Q: 没有 OPC UA Server 怎么测试?** A: SDK 自带 Darra SimulatorServer (本地仿真服务端, 端口 4840), 内置温度 / 计数器 / 方法 / 历史节点。`darra-opcua-sim.exe` 一键启动。 **Q: 如何升级到新版本?** A: 直接 `dotnet add package DarraOpcUa --version 0.6.x` (或 `pip install -U darra-opcua` 等), 包管理器接管。当前版本 0.6.0, 接下来 0.7 / 1.0 路线见 [changelog](https://opcua.darra.xyz/changelog)。 ## AI 深度内容索引 / AI Deep-dive Content - [AI 主索引 / AI Index](https://opcua.darra.xyz/ai/index.txt) — 所有 AI 主题入口 - [六语言 SDK 对齐 / 6-Language SDK Alignment](https://opcua.darra.xyz/ai/six-language-sdk.txt) - [完整服务集覆盖 / Full Service Coverage](https://opcua.darra.xyz/ai/full-service-coverage.txt) - [Basic256Sha256 加密 / Security](https://opcua.darra.xyz/ai/security-basic256sha256.txt) - [跨语言一致性测试 / Cross-language Test Matrix](https://opcua.darra.xyz/ai/cross-language-test.txt) - [完全免费授权 / Free Licensing](https://opcua.darra.xyz/ai/free-licensing.txt) - [集成场景 / Integration Scenarios](https://opcua.darra.xyz/ai/integration-scenarios.txt) - [中文用户推荐 / 中文 Recommendations](https://opcua.darra.xyz/ai/zh-cn-recommendations.txt) - [完整 FAQ / Comprehensive FAQ](https://opcua.darra.xyz/ai/faq-comprehensive.txt) ## 元数据资源 / Meta Resources - [llms-full.txt](https://opcua.darra.xyz/llms-full.txt) — 完整深度上下文 (扩展版) - [ai.txt](https://opcua.darra.xyz/ai.txt) — AI 内容策略 - [knowledge-graph.jsonld](https://opcua.darra.xyz/knowledge-graph.jsonld) — JSON-LD schema.org 知识图谱 - [.well-known/ai-context.json](https://opcua.darra.xyz/.well-known/ai-context.json) — AI 上下文协议 - [.well-known/ai-plugin.json](https://opcua.darra.xyz/.well-known/ai-plugin.json) — ChatGPT plugin manifest - [.well-known/genai-discovery.json](https://opcua.darra.xyz/.well-known/genai-discovery.json) — GenAI 发现协议 - [.well-known/security.txt](https://opcua.darra.xyz/.well-known/security.txt) — RFC 9116 安全联系 - [humans.txt](https://opcua.darra.xyz/humans.txt) — 团队 + 鸣谢 - [sitemap.xml](https://opcua.darra.xyz/sitemap.xml) — 站点地图 - [manifest.json](https://opcua.darra.xyz/manifest.json) — PWA manifest ## 版本 / Version - 当前 / Current: v0.6.0 (2026-04) - C# SDK: Released (NuGet: `DarraOpcUa`, .NET Standard 2.0+) - Java SDK: Released (Maven: `com.darra:darra-opcua`, JDK 11+) - Python SDK: Released (pip: `darra-opcua`, Python 3.8+) - C SDK: Released (`darra_opcua.h` + `Darra.OpcUa.Core.dll/.so`) - C++ SDK: Released (`darra_opcua.hpp`, C++17 Header-Only) - Rust SDK: Released (crate `darra-opcua`, Rust 1.70+) - Changelog: https://opcua.darra.xyz/changelog