node-red-contrib-modbus-modpackqt 1.1.2 → 1.1.3
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 +8 -8
- package/nodes/{modpackqt-read.html → modpackqt-master-read.html} +5 -5
- package/nodes/{modpackqt-read.js → modpackqt-master-read.js} +2 -2
- package/nodes/{modpackqt-write.html → modpackqt-master-write.html} +5 -5
- package/nodes/{modpackqt-write.js → modpackqt-master-write.js} +2 -2
- package/package.json +3 -3
package/README.md
CHANGED
|
@@ -58,8 +58,8 @@ npm install node-red-contrib-modbus-modpackqt
|
|
|
58
58
|
| Node | Category | Purpose |
|
|
59
59
|
|---|---|---|
|
|
60
60
|
| `modpackqt-config` | Config | Shared gateway connection (host, port, API key) |
|
|
61
|
-
| `modpackqt-read` | Modbus Master | Read Modbus TCP registers — FC1/FC2/FC3/FC4 |
|
|
62
|
-
| `modpackqt-write` | Modbus Master | Write Modbus TCP registers — FC5/FC6/FC15/FC16 |
|
|
61
|
+
| `modpackqt-master-read` | Modbus Master | Read Modbus TCP registers — FC1/FC2/FC3/FC4 |
|
|
62
|
+
| `modpackqt-master-write` | Modbus Master | Write Modbus TCP registers — FC5/FC6/FC15/FC16 |
|
|
63
63
|
| `modpackqt-slave-read` | Modbus Slave | Read registers from a ModPackQT simulated slave |
|
|
64
64
|
| `modpackqt-slave-write` | Modbus Slave | Write registers into a ModPackQT simulated slave |
|
|
65
65
|
|
|
@@ -67,7 +67,7 @@ npm install node-red-contrib-modbus-modpackqt
|
|
|
67
67
|
|
|
68
68
|
## Node-RED Modbus Master — Read Registers (FC1/FC2/FC3/FC4)
|
|
69
69
|
|
|
70
|
-
The `modpackqt-read` node reads registers from **any Modbus TCP slave device** by routing the request through the ModPackQT Gateway app.
|
|
70
|
+
The `modpackqt-master-read` node reads registers from **any Modbus TCP slave device** by routing the request through the ModPackQT Gateway app.
|
|
71
71
|
|
|
72
72
|
**Supported function codes:**
|
|
73
73
|
- **FC1** — Read Coils
|
|
@@ -100,7 +100,7 @@ The `modpackqt-read` node reads registers from **any Modbus TCP slave device** b
|
|
|
100
100
|
|
|
101
101
|
## Node-RED Modbus Master — Write Registers (FC5/FC6/FC15/FC16)
|
|
102
102
|
|
|
103
|
-
The `modpackqt-write` node writes registers to **any Modbus TCP slave device**.
|
|
103
|
+
The `modpackqt-master-write` node writes registers to **any Modbus TCP slave device**.
|
|
104
104
|
|
|
105
105
|
**Supported function codes:**
|
|
106
106
|
- **FC5** — Write Single Coil
|
|
@@ -139,13 +139,13 @@ The `modpackqt-slave-read` and `modpackqt-slave-write` nodes interact with ModPa
|
|
|
139
139
|
### Poll Holding Registers Every 5 Seconds (Node-RED Modbus Master)
|
|
140
140
|
|
|
141
141
|
```
|
|
142
|
-
[Inject (repeat 5s)] → [modpackqt-read FC3 target=192.168.1.10:502 unitId=1 addr=0 qty=10] → [Debug]
|
|
142
|
+
[Inject (repeat 5s)] → [modpackqt-master-read FC3 target=192.168.1.10:502 unitId=1 addr=0 qty=10] → [Debug]
|
|
143
143
|
```
|
|
144
144
|
|
|
145
145
|
### Write a Setpoint Register from a Button
|
|
146
146
|
|
|
147
147
|
```
|
|
148
|
-
[Inject (payload=1234)] → [modpackqt-write FC6 target=192.168.1.10:502 unitId=1 addr=100] → [Debug]
|
|
148
|
+
[Inject (payload=1234)] → [modpackqt-master-write FC6 target=192.168.1.10:502 unitId=1 addr=100] → [Debug]
|
|
149
149
|
```
|
|
150
150
|
|
|
151
151
|
### Inject Test Values into a Modbus Slave Simulator
|
|
@@ -180,8 +180,8 @@ Add one `modpackqt-config` node per gateway instance. All other nodes reference
|
|
|
180
180
|
|
|
181
181
|
| Node | Gateway Endpoint |
|
|
182
182
|
|---|---|
|
|
183
|
-
| `modpackqt-read` | `POST /api/modbus/tcp/read` |
|
|
184
|
-
| `modpackqt-write` | `POST /api/modbus/tcp/write` |
|
|
183
|
+
| `modpackqt-master-read` | `POST /api/modbus/tcp/read` |
|
|
184
|
+
| `modpackqt-master-write` | `POST /api/modbus/tcp/write` |
|
|
185
185
|
| `modpackqt-slave-read` | `GET /api/slaves/:id/registers` |
|
|
186
186
|
| `modpackqt-slave-write` | `PATCH /api/slaves/:id/registers` |
|
|
187
187
|
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
<script type="text/javascript">
|
|
2
|
-
RED.nodes.registerType('modpackqt-read', {
|
|
2
|
+
RED.nodes.registerType('modpackqt-master-read', {
|
|
3
3
|
category: 'ModPackQT',
|
|
4
4
|
color: '#2563eb',
|
|
5
5
|
defaults: {
|
|
@@ -17,13 +17,13 @@
|
|
|
17
17
|
outputs: 1,
|
|
18
18
|
icon: 'font-awesome/fa-download',
|
|
19
19
|
label: function() {
|
|
20
|
-
return this.name || `Read FC${this.functionCode} @${this.address}`;
|
|
20
|
+
return this.name || `Master Read FC${this.functionCode} @${this.address}`;
|
|
21
21
|
},
|
|
22
|
-
paletteLabel: 'modpackqt read'
|
|
22
|
+
paletteLabel: 'modpackqt master read'
|
|
23
23
|
});
|
|
24
24
|
</script>
|
|
25
25
|
|
|
26
|
-
<script type="text/html" data-template-name="modpackqt-read">
|
|
26
|
+
<script type="text/html" data-template-name="modpackqt-master-read">
|
|
27
27
|
<div class="form-row">
|
|
28
28
|
<label for="node-input-name"><i class="fa fa-tag"></i> Name</label>
|
|
29
29
|
<input type="text" id="node-input-name" placeholder="Name">
|
|
@@ -67,7 +67,7 @@
|
|
|
67
67
|
</div>
|
|
68
68
|
</script>
|
|
69
69
|
|
|
70
|
-
<script type="text/html" data-help-name="modpackqt-read">
|
|
70
|
+
<script type="text/html" data-help-name="modpackqt-master-read">
|
|
71
71
|
<p>Reads Modbus registers from a remote device via the ModPackQT Gateway app.</p>
|
|
72
72
|
<p>Calls <code>POST /api/modbus/tcp/read</code> on the gateway, which opens a Modbus TCP connection to the target device.</p>
|
|
73
73
|
<h3>Inputs</h3>
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
module.exports = function(RED) {
|
|
2
|
-
function
|
|
2
|
+
function ModPackQTMasterReadNode(config) {
|
|
3
3
|
RED.nodes.createNode(this, config);
|
|
4
4
|
const node = this;
|
|
5
5
|
const server = RED.nodes.getNode(config.server);
|
|
@@ -46,5 +46,5 @@ module.exports = function(RED) {
|
|
|
46
46
|
node.on('input', async function() { await doRead(); });
|
|
47
47
|
node.on('close', function() { if (timer) clearInterval(timer); });
|
|
48
48
|
}
|
|
49
|
-
RED.nodes.registerType('modpackqt-read',
|
|
49
|
+
RED.nodes.registerType('modpackqt-master-read', ModPackQTMasterReadNode);
|
|
50
50
|
};
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
<script type="text/javascript">
|
|
2
|
-
RED.nodes.registerType('modpackqt-write', {
|
|
2
|
+
RED.nodes.registerType('modpackqt-master-write', {
|
|
3
3
|
category: 'ModPackQT',
|
|
4
4
|
color: '#2563eb',
|
|
5
5
|
defaults: {
|
|
@@ -15,13 +15,13 @@
|
|
|
15
15
|
outputs: 1,
|
|
16
16
|
icon: 'font-awesome/fa-upload',
|
|
17
17
|
label: function() {
|
|
18
|
-
return this.name || `Write FC${this.functionCode} @${this.address}`;
|
|
18
|
+
return this.name || `Master Write FC${this.functionCode} @${this.address}`;
|
|
19
19
|
},
|
|
20
|
-
paletteLabel: 'modpackqt write'
|
|
20
|
+
paletteLabel: 'modpackqt master write'
|
|
21
21
|
});
|
|
22
22
|
</script>
|
|
23
23
|
|
|
24
|
-
<script type="text/html" data-template-name="modpackqt-write">
|
|
24
|
+
<script type="text/html" data-template-name="modpackqt-master-write">
|
|
25
25
|
<div class="form-row">
|
|
26
26
|
<label for="node-input-name"><i class="fa fa-tag"></i> Name</label>
|
|
27
27
|
<input type="text" id="node-input-name" placeholder="Name">
|
|
@@ -57,7 +57,7 @@
|
|
|
57
57
|
</div>
|
|
58
58
|
</script>
|
|
59
59
|
|
|
60
|
-
<script type="text/html" data-help-name="modpackqt-write">
|
|
60
|
+
<script type="text/html" data-help-name="modpackqt-master-write">
|
|
61
61
|
<p>Writes Modbus registers to a remote device via the ModPackQT Gateway app.</p>
|
|
62
62
|
<p>Calls <code>POST /api/modbus/tcp/write</code> on the gateway.</p>
|
|
63
63
|
<h3>Inputs</h3>
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
module.exports = function(RED) {
|
|
2
|
-
function
|
|
2
|
+
function ModPackQTMasterWriteNode(config) {
|
|
3
3
|
RED.nodes.createNode(this, config);
|
|
4
4
|
const node = this;
|
|
5
5
|
const server = RED.nodes.getNode(config.server);
|
|
@@ -37,5 +37,5 @@ module.exports = function(RED) {
|
|
|
37
37
|
}
|
|
38
38
|
});
|
|
39
39
|
}
|
|
40
|
-
RED.nodes.registerType('modpackqt-write',
|
|
40
|
+
RED.nodes.registerType('modpackqt-master-write', ModPackQTMasterWriteNode);
|
|
41
41
|
};
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "node-red-contrib-modbus-modpackqt",
|
|
3
|
-
"version": "1.1.
|
|
3
|
+
"version": "1.1.3",
|
|
4
4
|
"description": "Node-RED nodes for ModPackQT — read/write Modbus TCP registers (master & slave) via the ModPackQT Gateway app. Supports FC1/FC2/FC3/FC4 reads and FC5/FC6/FC15/FC16 writes.",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"node-red",
|
|
@@ -30,8 +30,8 @@
|
|
|
30
30
|
"version": ">=2.0.0",
|
|
31
31
|
"nodes": {
|
|
32
32
|
"modpackqt-config": "nodes/modpackqt-config.js",
|
|
33
|
-
"modpackqt-read":
|
|
34
|
-
"modpackqt-write":
|
|
33
|
+
"modpackqt-master-read": "nodes/modpackqt-master-read.js",
|
|
34
|
+
"modpackqt-master-write": "nodes/modpackqt-master-write.js",
|
|
35
35
|
"modpackqt-slave-read": "nodes/modpackqt-slave-read.js",
|
|
36
36
|
"modpackqt-slave-write": "nodes/modpackqt-slave-write.js"
|
|
37
37
|
}
|