node-red-contrib-mitsubishi 1.0.0 → 1.0.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +66 -20
- package/images/config.png +0 -0
- package/images/output.png +0 -0
- package/images/palette.png +0 -0
- package/node-red-contrib-mitsubishi/.gitattributes +2 -0
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -2,27 +2,38 @@
|
|
|
2
2
|
|
|
3
3
|
三菱 MC Protocol 3E/4E 以太网采集节点,零依赖纯 TCP 实现。
|
|
4
4
|
|
|
5
|
+
## 截图
|
|
6
|
+
|
|
7
|
+
> 替换 `Qq225083` 为你的 GitHub 用户名
|
|
8
|
+
|
|
9
|
+

|
|
10
|
+
|
|
11
|
+

|
|
12
|
+
|
|
13
|
+

|
|
14
|
+
|
|
5
15
|
## 特性
|
|
6
16
|
|
|
7
17
|
- **独立可用** — 脱离任何后端,拖拽配置即可采集 PLC 数据
|
|
8
18
|
- **表格编辑器** — 一个节点读 N 个点位,自动聚类合并批量读取
|
|
9
|
-
- **6 种数据类型** — INT16/UINT16/INT32/UINT32/FLOAT32/BOOL
|
|
10
|
-
- **8 种软元件** — D/W/R/X/Y/M/L/B
|
|
11
|
-
- **斜率偏移变换** — `engValue = rawValue × slope + offset
|
|
19
|
+
- **6 种数据类型** — INT16 / UINT16 / INT32 / UINT32 / FLOAT32 / BOOL
|
|
20
|
+
- **8 种软元件** — D / W / R / X / Y / M / L / B,位元件自动逐位拆包
|
|
21
|
+
- **斜率偏移变换** — `engValue = rawValue × slope + offset`,节点直接输出最终值
|
|
12
22
|
- **错误诊断** — 19 个 MC 错误码映射为中文可读信息
|
|
13
23
|
- **模拟模式** — 全局 `mcSimulationMode=true` 不连 PLC 直接返回仿真数据
|
|
14
24
|
- **零依赖** — 仅使用 Node.js 内置 `net` + `Buffer`
|
|
25
|
+
- **14 个运行时 BUG 已修复** — 含锁重入、异步异常、serialNo 自增、批量超限等
|
|
15
26
|
|
|
16
27
|
## 支持的 PLC
|
|
17
28
|
|
|
18
29
|
| 系列 | 帧格式 | 状态 |
|
|
19
30
|
|------|--------|------|
|
|
20
|
-
| Q
|
|
21
|
-
| L 系列 | 3E/4E | ✅ |
|
|
31
|
+
| Q 系列(QnU / QnUDV) | 3E / 4E | ✅ |
|
|
32
|
+
| L 系列 | 3E / 4E | ✅ |
|
|
22
33
|
| iQ-R | 4E | ✅ |
|
|
23
|
-
| iQ-F
|
|
34
|
+
| iQ-F(FX5U) | 4E | ✅ |
|
|
24
35
|
| FX3U + 以太网模块 | 3E | ✅ |
|
|
25
|
-
| A 系列 | 1E/2E | ❌ |
|
|
36
|
+
| A 系列 | 1E / 2E | ❌ |
|
|
26
37
|
|
|
27
38
|
## 安装
|
|
28
39
|
|
|
@@ -35,24 +46,59 @@ npm install node-red-contrib-mitsubishi
|
|
|
35
46
|
|
|
36
47
|
## 使用方法
|
|
37
48
|
|
|
38
|
-
|
|
49
|
+
**1. 添加 PLC 连接配置**
|
|
50
|
+
|
|
51
|
+
拖入 `PLC 连接配置` 节点,填写 IP、端口、帧格式(3E/4E)、超时等参数。
|
|
52
|
+
|
|
53
|
+
**2. 配置点位表格**
|
|
39
54
|
|
|
40
|
-
|
|
55
|
+
拖入 `MC 读取` 节点,关联 PLC 配置,在表格中添加点位:
|
|
41
56
|
|
|
42
|
-
|
|
57
|
+
| 寄存器 | 地址 | 数据类型 | 斜率 | 偏移 | 名称 |
|
|
58
|
+
|--------|------|----------|------|------|------|
|
|
59
|
+
| D | 100 | INT16 | 0.1 | 0 | 温度 |
|
|
60
|
+
| D | 200 | FLOAT32 | 1 | 0 | 压力 |
|
|
61
|
+
| X | 0 | BOOL | - | - | 开关 |
|
|
62
|
+
|
|
63
|
+
**3. 触发采集**
|
|
64
|
+
|
|
65
|
+
inject 节点连到 MC 读取节点,部署后自动采集。
|
|
66
|
+
|
|
67
|
+
**动态点位**:上游节点传入 `msg.tags` 会覆盖表格配置,兼容 EdgeLink 采集管线。
|
|
68
|
+
|
|
69
|
+
## 输出格式
|
|
70
|
+
|
|
71
|
+
```javascript
|
|
72
|
+
msg.payload = {
|
|
73
|
+
success: true,
|
|
74
|
+
data: {
|
|
75
|
+
"温度": { rawValue: 2530, engValue: 253.0, quality: 0, ts: "2026-..." },
|
|
76
|
+
"压力": { rawValue: 4123, engValue: 41.23, quality: 0, ts: "2026-..." },
|
|
77
|
+
"开关": { rawValue: 1, engValue: 1, quality: 0, ts: "2026-..." }
|
|
78
|
+
},
|
|
79
|
+
error: null,
|
|
80
|
+
driverType: "driver-mc-protocol",
|
|
81
|
+
plcIp: "192.168.1.10",
|
|
82
|
+
plcPort: 5007,
|
|
83
|
+
roundTimeMs: 12
|
|
84
|
+
}
|
|
85
|
+
```
|
|
43
86
|
|
|
44
87
|
## 与 node-red-contrib-mcprotocol 对比
|
|
45
88
|
|
|
46
|
-
| | 本节点 | mcprotocol
|
|
47
|
-
|
|
48
|
-
| 点位数量 | N
|
|
49
|
-
| 批量优化 |
|
|
50
|
-
|
|
|
51
|
-
| 位元件 |
|
|
52
|
-
|
|
|
53
|
-
| 错误诊断 |
|
|
54
|
-
|
|
|
89
|
+
| 维度 | 本节点 | mcprotocol |
|
|
90
|
+
|------|--------|------------|
|
|
91
|
+
| 点位数量 | **N 个 / 节点** | 1 个 / 节点 |
|
|
92
|
+
| 批量优化 | **智能聚类合并** | 逐地址独立请求 |
|
|
93
|
+
| 数据类型 | **6 种** (INT16/UINT16/INT32/UINT32/FLOAT32/BOOL) | 仅 INT16 |
|
|
94
|
+
| 位元件 | **自动拆包** | 不支持 |
|
|
95
|
+
| 斜率偏移变换 | **内置** (raw → eng) | 无 |
|
|
96
|
+
| 错误诊断 | **[PLC 0xC052] Address out of range** | "timeout" |
|
|
97
|
+
| serialNo | **每帧自增 + 回显校验** | 固定不变 |
|
|
98
|
+
| 模拟模式 | ✅ `mcSimulationMode=true` | ❌ |
|
|
99
|
+
| 连接稳定性 | 短连接, 无状态泄漏 | pool bug, 长期运行必断 |
|
|
100
|
+
| 运行时 BUG | **14 个全部修复** | issue 长期未维护 |
|
|
55
101
|
|
|
56
102
|
## 许可证
|
|
57
103
|
|
|
58
|
-
MIT
|
|
104
|
+
MIT · 可自由商用、修改、再发布
|
|
Binary file
|
|
Binary file
|
|
Binary file
|