IoT 写
x/iotWrite组件:v0.37.0+通用采集写节点,按 driver 配置委派到具体协议的写节点。
需要额外引入扩展库: rulego-components-iot (opens new window)
# 配置
| 字段 | 类型 | 说明 | 默认值 |
|---|---|---|---|
| driver | string | 写入协议:modbus/s7/eip/snmp/opcua/mc/fins/dlt645/iec104 | 必填 |
| (其余字段) | — | 透传给对应协议写节点(server/points/timeout 等) | — |
# 输入/输出
- 输入:msg.Data 带点位列表
[{"name","addr","type","value"}],各字段支持${msg.xx}模板 - 输出:成功走 Success 链,失败走 Failure 链
# 支持的 driver
| driver | 委派节点 |
|---|---|
| modbus | x/modbusWrite |
| s7 | x/s7Write |
| eip | x/eipWrite |
| snmp | x/snmpWrite |
| opcua | x/opcuaWrite |
| mc | x/mcWrite |
| fins | x/finsWrite |
| dlt645 | x/dlt645Write |
| iec104 | x/iec104Write |
# 示例
{
"driver": "modbus",
"server": "tcp://192.168.1.100:502",
"points": [
{"name": "设定温度", "addr": "40001", "type": "INT16", "value": "${msg.targetTemp}"}
]
}
1
2
3
4
5
6
7
2
3
4
5
6
7
在 GitHub 上编辑此页 (opens new window)
上次更新: 2026/07/29, 07:07:39