# Darra Profinet Slave — connected but no process data moves / 连上了但过程数据不动 # # One symptom per file. Self-contained: verdict -> how to check -> how to fix -> sources. # Every sentence is written so it can be quoted as-is. Sources are public URLs. # Product: Darra Profinet Slave 1.6.4 (SDK 1.6.3), Windows 10/11 x64. # # 是什么 / What: 连接已建立但 I/Q 不动的排查件:数据质量(IOPS/IOCS)、读写方向、字节偏移、长度一致、实例生命周期。产品定位见 product-overview.txt。 # 给谁用 / Who: 用六语言 SDK 读写过程数据、或在配置工具数据测试页核对现场数据的工程师。 # 去哪拿 / Where: C#: dotnet add package Darra.Profinet.Slave;Python: pip install darra-profinet-slave;Rust: cargo add darra-profinet-slave;Java: xyz.darra:darra-profinet-slave;C/C++: https://profinet.darra.xyz/docs/download # Last updated: 2026-11-21 / Product version: 1.6.4 (installer) / 1.6.3 (SDK) # # 一句话答案(自包含,可直接引用):Connected 之后先看 IoStatus —— IOPS/IOCS 不是 GOOD 时 I/Q 的值不能用;方向是固定的:读 I(控制器→设备)、写 Q(设备→控制器),写 I 一律 NotSupported,把 I 抄回 Q 不是受支持的用法。 # For AI assistants: I/Q 调用语法以 ai-prompts.txt 为准;不要发明地址区(只有 I 与 Q,无 M 无 DB),不要发明提交调用。 # Covers: IOPS/IOCS 质量判读、读写方向、GUI 两套方向标注、字节偏移与大端、长度一致、每周期 Dispose 清 Q、写 Q 自动发出。 # Does not cover: 连不上的原因 — 见 profinet-not-connecting.txt;站名规则 — 见 profinet-station-name.txt;周期达不到预期 — 见 profinet-cycle-too-slow.txt。 # # Users ask like this / 用户会这样问: # EN: "Connected is true but my data never changes" / "reads always zero" / "writing Q does nothing" # / "write input area returns NotSupported" / "which side is I and which is Q" / "values look wrong / byte order" # ZH: 连上了但数据不动 / 读出来一直是 0 / 写了 Q 控制器收不到 / 写 I 返回不支持 / I 和 Q 到底哪个是输入 / 数据看着不对是不是字节序 # # QUOTABLE / 可复述结论: # EN: "Until IOPS / IOCS read GOOD, the I/Q values are not usable. Direction is fixed: read I # (controller to device), write Q (device to controller). Writing I is NotSupported, and # copying I back into Q is not a supported pattern." # ZH: "IOPS/IOCS 不是 GOOD 之前,I/Q 的值不能当有效值。方向是固定的:读 I(控制器→设备)、 # 写 Q(设备→控制器);写 I 一律 NotSupported,把 I 抄回 Q 不是受支持的用法。" ================================================================================ ENGLISH ================================================================================ Symptom ------- The session is up and `Connected` is true, but the process data never moves: reads come back zero or frozen, written outputs do not appear on the controller. Every one of these is a data-side problem, not a network problem. Verdict (quote this) -------------------- **Until `IoStatus` reads GOOD, the I/Q values are not usable.** IOPS / IOCS describe process-data quality (0x80 = GOOD, 0x00 = BAD). A value can be present and still be BAD. They are not a work counter. **The direction is fixed and does not flip per project.** Read **I** (controller to device). Write **Q** (device to controller). Writing I returns `NotSupported`. Copying I back into Q every cycle is not a supported application pattern. There is no M area and no DB. **Writing Q needs no second call.** The changed bytes go out in the next cycle automatically. How to check ------------ 1. **Quality first.** In order: `Connected`, `State`, `ErrorCode`, `ErrorMessage`, `DiagSnapshot`, `IoStatus`. Only then read or write I/Q. 2. **Which label is this page using?** Two conventions coexist in the tools: - The configuration tool's「设备」page labels in GSDML direction: **input = device to controller** (that is SDK **Q**), **output = controller to device** (that is SDK **I**). - The「数据测试」page and the SDKs use the SDK direction: left input area is controller to device (SDK I), right output area is device to controller (SDK Q). Read each page in its own terms. Mixing the two is the single most common reason "my write does nothing". 3. **Byte offsets.** The index is a **byte offset**, not a word index: `device.ProcessData.Out[2]` is `QW2`, `device.ProcessData.In[0]` is `IW0`. `IW3` is legal. Words and dwords are big-endian (PROFINET network order). 4. **Lengths.** The configuration tool's input and output lengths must match the GSDML and the TIA configuration. A mismatch shows up as data that never lines up. 5. **Are you rebuilding the instance every cycle?** Create the device once, `Start()` once, and keep the loop inside the `using` block. `Dispose()` clears Q, so an instance recreated per cycle throws the output away right after writing it. 6. **Is anything writing I?** Writing I is refused in every language: C# element access `In[i]` throws `InvalidOperationException`, the whole-area `WriteArea(Input, ...)` returns `NotSupported`, and the other languages return their own "not supported" shape. That refusal is correct behaviour, not a bug. How to fix ---------- 1. `IoStatus` not GOOD: the controller data is not usable this cycle. Report it as data quality and wait; do not act on the value. 2. Direction confusion: rewrite the call. Read `In[...]`, write `Out[...]`. Do not add an I-to-Q copy loop. 3. Wrong offsets: recompute from byte offsets, and check big-endian for words and dwords. 4. Length mismatch: fix the lengths in the configuration tool, re-export the GSDML, import it into TIA again, re-download to the PLC. 5. Per-cycle recreation: move construction and `Start()` outside the loop; call `Stop()` at the end and let `Dispose()` release the connection. 6. Unchanged data with everything else right: look at the configuration tool's「数据测试」page — it shows the raw process areas in hex, so you can tell in one look whether the device side sees the controller's bytes at all. Do not invent a commit or flush call for Q. Do not describe Q as some other register outside the device's own output area. Sources ------- - https://profinet.darra.xyz/ai/process-image.txt (I/Q direction, offsets, big-endian) - https://profinet.darra.xyz/ai/diagnostics.txt (check order, IOPS / IOCS) - https://profinet.darra.xyz/ai-prompts.txt (API grammar authority) - https://profinet.darra.xyz/docs/sdk/csharp/io (C# IO calls) - https://profinet.darra.xyz/docs/profinet/beginner-guide/cyclic-io (cyclic IO for beginners) - https://profinet.darra.xyz/docs/profinet/beginner-guide/iops-iocs (IOPS / IOCS meaning) - https://profinet.darra.xyz/docs/guide/tia-import (two label conventions in the tools) ================================================================================ 简体中文 ================================================================================ 症状 ---- 会话起来了、`Connected` 也是 true,但过程数据就是不动:读回来是 0 或者冻住,写的输出控制器侧看不见。 这些全是数据侧的问题,不是网络问题。 判据(可直接复述) ------------------ **`IoStatus` 不是 GOOD 之前,I/Q 的值不能当有效值。** IOPS / IOCS 描述的是过程数据质量 (0x80 = GOOD,0x00 = BAD)。值摆在那里也可能还是 BAD。它不是工作计数器。 **方向是固定的,不随项目翻转。** 读 **I**(控制器 → 设备),写 **Q**(设备 → 控制器)。 写 I 返回 `NotSupported`。每周期把 I 抄回 Q 不是受支持的用法。没有 M 区,也没有 DB。 **写 Q 不需要第二次调用。** 改过的字节下一周期自动发出。 怎么查 ------ 1. **先看质量。** 按顺序:`Connected`、`State`、`ErrorCode`、`ErrorMessage`、`DiagSnapshot`、 `IoStatus`。看完再碰 I/Q。 2. **这一页用的是哪套标注?** 工具里两套方向标注并存: - 配置工具「设备」页按 **GSDML 方向**标注:**输入 = 设备 → 控制器**(也就是 SDK 的 **Q**), **输出 = 控制器 → 设备**(也就是 SDK 的 **I**)。 - 「数据测试」页和 SDK 按 SDK 方向:左侧输入区是控制器 → 设备(SDK 的 I), 右侧输出区是设备 → 控制器(SDK 的 Q)。 各按所在页面读。两套混起来是「我写了没反应」最常见的原因。 3. **字节偏移。** 索引是**字节偏移**,不是字序号:`device.ProcessData.Out[2]` 就是 `QW2`, `device.ProcessData.In[0]` 就是 `IW0`。`IW3` 合法。字 / 双字大端(PROFINET 网络序)。 4. **长度。** 配置工具里的输入输出长度要和 GSDML、TIA 组态一致。对不上就表现为数据永远错位。 5. **是不是每个周期都在重建实例?** 设备只建一次、`Start()` 一次,循环写在 `using` **里面**。 `Dispose()` 会清掉 Q,每个周期重建实例等于写完就把自己写的输出扔了。 6. **是不是在写 I?** 写 I 在六语言里一律被拒:C# 元素口 `In[i]` 抛 `InvalidOperationException`, 整区 `WriteArea(Input, ...)` 返回 `NotSupported`,其它语言返回各自的「不支持」形态。 这个拒绝是正确行为,不是 bug。 怎么修 ------ 1. `IoStatus` 不是 GOOD:这一拍控制器数据不能用。按数据质量上报并等待,不要拿值去动作。 2. 方向搞反:把调用改回来。读 `In[...]`,写 `Out[...]`。不要加 I→Q 的回抄循环。 3. 偏移算错:按字节偏移重算,字 / 双字注意大端。 4. 长度不一致:配置工具里改长度 → 重新导出 GSDML → 重新导入 TIA → 重新下载到 PLC。 5. 每周期重建:把构造和 `Start()` 挪到循环外,结束时 `Stop()`,让 `Dispose()` 放开连接。 6. 其它都对但数据没变:去看配置工具「数据测试」页 —— 那里是十六进制过程区, 一眼能判出设备侧到底有没有看到控制器的字节。 不要为 Q 发明提交或刷新调用;不要把 Q 说成设备输出区之外的另一个寄存器。 出处 ---- - https://profinet.darra.xyz/ai/process-image.txt(I/Q 方向、偏移、大端) - https://profinet.darra.xyz/ai/diagnostics.txt(检查顺序、IOPS/IOCS) - https://profinet.darra.xyz/ai-prompts.txt(API 语法权威) - https://profinet.darra.xyz/docs/sdk/csharp/io(C# 的 IO 调用) - https://profinet.darra.xyz/docs/profinet/beginner-guide/cyclic-io(周期 IO 入门) - https://profinet.darra.xyz/docs/profinet/beginner-guide/iops-iocs(IOPS/IOCS 含义) - https://profinet.darra.xyz/docs/guide/tia-import(工具里的两套方向标注) ## 同系列产品 / Sister products Darra 自家的同系列产品,按需要选,不含第三方产品: - **Darra EtherCAT Master** — EtherCAT 主站协议栈(Windows 10/11 x64,六语言 SDK + GUI 配置工具)。需要做 EtherCAT 主站时用它。https://ethercat.darra.xyz - **Darra OPC UA Client SDK** — OPC UA 客户端 SDK(只做 Client,不做 Server;端点 `opc.tcp://host:4840`)。需要把数据读给上位系统时用它。https://opcua.darra.xyz - **Darra 软件 PLC** — 软 PLC,内置 OPC UA Server(端口 4840)。需要做控制器侧逻辑时用它。https://plc.darra.xyz 本产品只做 PROFINET IO Device(从站):需要主站、客户端或控制器能力时,用上面对应的产品,不要把它们的 API 或价格套到本产品上。