CC-Link IE Field 驱动 — 技术参考(实现路线图)
PlantPulse Edge 的 CC-Link IE Field 驱动目前处于 stub(placeholder) 阶段。 在正式 read/write 功能可用之前,请使用 MELSEC (MC Protocol / SLMP) 卡片进行替代。
源码:plantpulse.driver.protocol.cclink.*
| 类 | 职责 |
|---|---|
CCLinkIEFieldDriver | 基于 AbstractStubDriver 的 placeholder —— connect 时输出 warn 日志,read/write 均返回空值/false |
为什么是 stub
PlantPulse Edge 将 Apache PLC4X 0.13.1 的各驱动作为 lib 打包(BACnet/KNXnet/CANopen/ADS/AB-ETH 等 12 个)。而 PLC4X 0.13.1 的驱动矩阵中尚未包含 CC-Link IE Field。
确认方法:
ls plantpulse-edge-driver/lib/ | grep plc4j-driver
# plc4j-driver-ab-eth, ads, bacnet, c-bus, can, canopen, eip, firmata,
# iec-60870, knxnetip, modbus, opcua, open-protocol, plc4x, profinet-ng,
# s7, simulated ← cc-link-ie 없음
正式实现路径
| 路径 | 优点 | 缺点 |
|---|---|---|
PLC4X 0.14+ 的 cc-link-ie driver | 沿用现有 wrapper 模式(继承 PLC4jProtocolDriver)—— 代码改动最小 | 依赖 PLC4X 的发布计划 |
| xingshuangs/iot-communication (Java, MIT) | 部分支持 CC-Link —— 可立即使用的库 | 需自行编写 wrapper(直接继承 BaseProtocolDriver) |
| GX Works3 SLMP 网关 | Mitsubishi 官方网关 —— 稳定性有保障 | 需要额外硬件(RJ71EN71 等),用 MELSEC 卡片 走 SLMP 即可 |
PlantPulse Edge 侧的工作:
// 정식 구현 시 (PLC4X 0.14+ 가정)
public class CCLinkIEFieldDriver extends PLC4jProtocolDriver implements ProtocolDriver {
@Override public String getProtocol() { return "cc-link-ie"; }
}
构建:
./gradlew clean build
注册表单选项(计划中)
| key | 说明 | 默认值 |
|---|---|---|
device-id | 从站 station number(1~120) | (必填) |
network-no | 网络编号(1~239) | 1 |
request-timeout | read/write 超时(ms) | 2000 |
地址表示法(计划中)
| 设备 | 含义 | 表示 |
|---|---|---|
RX#### | Remote Input bit | RX0010 |
RY#### | Remote Output bit | RY0020 |
RWr#### | Remote Word in (16-bit) | RWr0100 |
RWw#### | Remote Word out (16-bit) | RWw0100 |
SB#### | Link Special Bit | SB0001 |
SW#### | Link Special Word | SW0001 |
LB#### | Link Bit | LB0010 |
LW#### | Link Word | LW0010 |
当前行为(stub)
| 方法 | 行为 |
|---|---|
connect() | [CC-Link IE Field] 드라이버는 아직 정식 구현 전입니다 ... warn 日志 —— isConnected() 保持 false |
read() | 返回空字符串("") |
write() | 返回 false |
isWriteSupported() | false |
对网关运行无影响 —— 即使完成注册也会显示为 disconnected 状态,且不会有数据进入。
推荐替代方案:MELSEC SLMP 卡片
iQ-R / iQ-F 的 RJ71EN71(Ethernet 模块)或内置 Ethernet 端口支持 SLMP / MC Protocol —— 该方式通过 MELSEC 卡片可正式工作。
将 CC-Link IE Field 从站的数据映射到 PLC 侧设备(D#### 区域)后,网关只需读取 PLC 的 D 即可。