MC 写
x/mcWrite组件:v0.37.0+ 通过三菱 MC 协议(3E 帧/二进制,SLMP)批量写入 PLC 软元件,成功走 Success 链、失败走 Failure 链。
需要额外引入扩展库: rulego-components-iot (opens new window)
# 配置
连接配置与 x/mcRead 相同(server/timeout/points)。写入点位由 msg.Data 传入。
# 输入/输出
- 输入:
msg.Data带点位列表[{"name","addr","type","value"}] - 输出:成功走
Success链,失败走Failure链
# 示例
{
"id": "mc_write",
"type": "x/mcWrite",
"configuration": {
"server": "192.168.1.30:6000"
}
}
1
2
3
4
5
6
7
2
3
4
5
6
7
msg.Data 传入写入点位:
[
{"name": "设定转速", "addr": "D200", "type": "UINT16", "value": "1500"},
{"name": "启动", "addr": "M10", "type": "BOOL", "value": "true"}
]
1
2
3
4
2
3
4
# 关联组件
- 协议概览:x/mc
- 读取:x/mcRead
- 统一写入入口:x/iotWrite(driver=mc)
在 GitHub 上编辑此页 (opens new window)
上次更新: 2026/07/29, 07:07:39