node-red-contrib-modbus-modpackqt 1.1.84 → 2.0.0
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/CHANGELOG.md +58 -0
- package/CONTRIBUTING.md +70 -0
- package/DISCLAIMER.md +92 -0
- package/LICENSE +21 -0
- package/README.md +155 -166
- package/SECURITY.md +50 -0
- package/examples/basic-flow.json +130 -185
- package/nodes/modpackqt-config.html +106 -89
- package/nodes/modpackqt-config.js +345 -18
- package/nodes/modpackqt-master-read.html +16 -19
- package/nodes/modpackqt-master-read.js +27 -18
- package/nodes/modpackqt-master-write.html +12 -16
- package/nodes/modpackqt-master-write.js +49 -26
- package/nodes/modpackqt-slave-read.html +12 -85
- package/nodes/modpackqt-slave-read.js +27 -40
- package/nodes/modpackqt-slave-write.html +13 -94
- package/nodes/modpackqt-slave-write.js +24 -32
- package/nodes/modpackqt-traffic.html +118 -0
- package/nodes/modpackqt-traffic.js +68 -0
- package/package.json +24 -6
package/examples/basic-flow.json
CHANGED
|
@@ -2,193 +2,138 @@
|
|
|
2
2
|
{
|
|
3
3
|
"id": "tab-modpackqt-demo",
|
|
4
4
|
"type": "tab",
|
|
5
|
-
"label": "ModPackQT Demo",
|
|
6
|
-
"
|
|
7
|
-
"info": "Demonstrates ModPackQT Node-RED nodes against the ModPackQT Gateway app (default port 8502).\n\nBefore deploying:\n1. Download and start the ModPackQT Gateway app from modpackqt.com/download\n2. Update the config node if the gateway runs on a different host/port\n3. For slave-read/slave-write: update slaveId to match a slave ID from your ModPackQT app"
|
|
5
|
+
"label": "ModPackQT — Modbus + Bytes Demo",
|
|
6
|
+
"info": "End-to-end demo combining node-red-contrib-modbus-modpackqt with node-red-contrib-bytes-modpackqt.\n\nMake sure BOTH palettes are installed:\n npm install node-red-contrib-modbus-modpackqt node-red-contrib-bytes-modpackqt\n\nUpdate Target Host on the master nodes to your real PLC, OR just deploy as-is — the bottom slave-loop section works without any external device.\n\nFlows included:\n 1) Read float32 temperature from a PLC, decode, debug\n 2) Inject a setpoint, encode float32, write to PLC\n 3) Read a 16-bit status register, expand to 8 booleans\n 4) Read an 8-register UTF-8 serial number string\n 5) Embedded slave loop — encode int32 → write to local slave → read back → decode\n 6) Passive Modbus traffic monitor (free, no PLC needed)"
|
|
8
7
|
},
|
|
9
8
|
{
|
|
10
|
-
"id": "config-modpackqt-
|
|
9
|
+
"id": "config-modpackqt-runtime",
|
|
11
10
|
"type": "modpackqt-config",
|
|
12
|
-
"name": "ModPackQT
|
|
13
|
-
"
|
|
14
|
-
"
|
|
15
|
-
"
|
|
11
|
+
"name": "ModPackQT runtime",
|
|
12
|
+
"masterMode": "tcp",
|
|
13
|
+
"serialPort": "",
|
|
14
|
+
"baudRate": 9600,
|
|
15
|
+
"parity": "none",
|
|
16
|
+
"dataBits": 8,
|
|
17
|
+
"stopBits": 1,
|
|
18
|
+
"timeoutMs": 3000,
|
|
19
|
+
"slaveEnabled": true,
|
|
20
|
+
"slaveHost": "0.0.0.0",
|
|
21
|
+
"slavePort": 1502
|
|
16
22
|
},
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
"
|
|
20
|
-
"
|
|
21
|
-
"
|
|
22
|
-
|
|
23
|
-
"
|
|
24
|
-
"once": true,
|
|
25
|
-
"
|
|
26
|
-
|
|
27
|
-
"
|
|
28
|
-
"
|
|
29
|
-
"
|
|
30
|
-
"x":
|
|
31
|
-
|
|
32
|
-
"
|
|
33
|
-
|
|
34
|
-
{
|
|
35
|
-
"
|
|
36
|
-
"
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
"
|
|
40
|
-
"
|
|
41
|
-
"
|
|
42
|
-
|
|
43
|
-
"
|
|
44
|
-
"
|
|
45
|
-
|
|
46
|
-
"
|
|
47
|
-
"x":
|
|
48
|
-
|
|
49
|
-
"
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
"
|
|
53
|
-
|
|
54
|
-
"name": "
|
|
55
|
-
"
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
"
|
|
59
|
-
"
|
|
60
|
-
"
|
|
61
|
-
|
|
62
|
-
"
|
|
63
|
-
"wires": []
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
"
|
|
67
|
-
"
|
|
68
|
-
"
|
|
69
|
-
|
|
70
|
-
"
|
|
71
|
-
"
|
|
72
|
-
|
|
73
|
-
"
|
|
74
|
-
"
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
"
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
"
|
|
82
|
-
"
|
|
83
|
-
|
|
84
|
-
"
|
|
85
|
-
"targetPort": 502,
|
|
86
|
-
"
|
|
87
|
-
"
|
|
88
|
-
|
|
89
|
-
"
|
|
90
|
-
"
|
|
91
|
-
"y":
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
"name": "
|
|
98
|
-
"
|
|
99
|
-
"
|
|
100
|
-
|
|
101
|
-
"
|
|
102
|
-
"
|
|
103
|
-
|
|
104
|
-
"
|
|
105
|
-
"y":
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
"
|
|
110
|
-
|
|
111
|
-
"name": "
|
|
112
|
-
"
|
|
113
|
-
"
|
|
114
|
-
|
|
115
|
-
"
|
|
116
|
-
"
|
|
117
|
-
|
|
118
|
-
"
|
|
119
|
-
"
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
"
|
|
123
|
-
"
|
|
124
|
-
|
|
125
|
-
{
|
|
126
|
-
"
|
|
127
|
-
"
|
|
128
|
-
"
|
|
129
|
-
"
|
|
130
|
-
|
|
131
|
-
"
|
|
132
|
-
"
|
|
133
|
-
"quantity": 5,
|
|
134
|
-
"pollInterval": 0,
|
|
135
|
-
"z": "tab-modpackqt-demo",
|
|
136
|
-
"x": 400,
|
|
137
|
-
"y": 280,
|
|
138
|
-
"wires": [["debug-slave-read"]]
|
|
139
|
-
},
|
|
140
|
-
{
|
|
141
|
-
"id": "debug-slave-read",
|
|
142
|
-
"type": "debug",
|
|
143
|
-
"name": "Slave register values",
|
|
144
|
-
"active": true,
|
|
145
|
-
"tosidebar": true,
|
|
146
|
-
"console": false,
|
|
147
|
-
"complete": "payload",
|
|
148
|
-
"targetType": "msg",
|
|
149
|
-
"z": "tab-modpackqt-demo",
|
|
150
|
-
"x": 650,
|
|
151
|
-
"y": 280,
|
|
152
|
-
"wires": []
|
|
153
|
-
},
|
|
154
|
-
{
|
|
155
|
-
"id": "inject-slave-write",
|
|
156
|
-
"type": "inject",
|
|
157
|
-
"name": "Set slave regs [10,20,30]",
|
|
158
|
-
"props": [{ "p": "payload", "v": "[10,20,30]", "vt": "json" }],
|
|
159
|
-
"repeat": "",
|
|
160
|
-
"crontab": "",
|
|
161
|
-
"once": false,
|
|
162
|
-
"z": "tab-modpackqt-demo",
|
|
163
|
-
"x": 160,
|
|
164
|
-
"y": 380,
|
|
165
|
-
"wires": [["slave-write-node"]]
|
|
166
|
-
},
|
|
167
|
-
{
|
|
168
|
-
"id": "slave-write-node",
|
|
169
|
-
"type": "modpackqt-slave-write",
|
|
170
|
-
"name": "Slave Write Holding @0",
|
|
171
|
-
"server": "config-modpackqt-local",
|
|
172
|
-
"slaveId": "YOUR_SLAVE_ID",
|
|
173
|
-
"registerType": "holding",
|
|
174
|
-
"address": 0,
|
|
175
|
-
"z": "tab-modpackqt-demo",
|
|
176
|
-
"x": 420,
|
|
177
|
-
"y": 380,
|
|
178
|
-
"wires": [["debug-slave-write"]]
|
|
179
|
-
},
|
|
180
|
-
{
|
|
181
|
-
"id": "debug-slave-write",
|
|
182
|
-
"type": "debug",
|
|
183
|
-
"name": "Write success",
|
|
184
|
-
"active": true,
|
|
185
|
-
"tosidebar": true,
|
|
186
|
-
"console": false,
|
|
187
|
-
"complete": "success",
|
|
188
|
-
"targetType": "msg",
|
|
189
|
-
"z": "tab-modpackqt-demo",
|
|
190
|
-
"x": 650,
|
|
191
|
-
"y": 380,
|
|
192
|
-
"wires": []
|
|
193
|
-
}
|
|
23
|
+
|
|
24
|
+
{ "id": "c1-comment", "type": "comment", "z": "tab-modpackqt-demo",
|
|
25
|
+
"name": "1) Temperature: PLC float32 @100 → decode → debug",
|
|
26
|
+
"info": "Most common Modbus pattern. If the float looks wrong, try LE_SWAP on the decoder.",
|
|
27
|
+
"x": 220, "y": 40, "wires": [] },
|
|
28
|
+
{ "id": "i-temp", "type": "inject", "z": "tab-modpackqt-demo",
|
|
29
|
+
"name": "Poll every 5s", "props": [{ "p": "payload" }], "repeat": "5",
|
|
30
|
+
"once": true, "payloadType": "date", "x": 130, "y": 80,
|
|
31
|
+
"wires": [["mr-temp"]] },
|
|
32
|
+
{ "id": "mr-temp", "type": "modpackqt-master-read", "z": "tab-modpackqt-demo",
|
|
33
|
+
"name": "Read FC3 @100 qty=2", "server": "config-modpackqt-runtime",
|
|
34
|
+
"targetHost": "192.168.1.10", "targetPort": 502, "unitId": 1,
|
|
35
|
+
"functionCode": "3", "address": 100, "quantity": 2, "pollInterval": 0,
|
|
36
|
+
"x": 360, "y": 80, "wires": [["dec-temp"]] },
|
|
37
|
+
{ "id": "dec-temp", "type": "decode-float32", "z": "tab-modpackqt-demo",
|
|
38
|
+
"name": "decode float32 BE", "endian": "BE", "sourceType": "registers",
|
|
39
|
+
"x": 600, "y": 80, "wires": [["d-temp"]] },
|
|
40
|
+
{ "id": "d-temp", "type": "debug", "z": "tab-modpackqt-demo",
|
|
41
|
+
"name": "Temperature (°C)", "active": true, "complete": "payload",
|
|
42
|
+
"x": 820, "y": 80, "wires": [] },
|
|
43
|
+
|
|
44
|
+
{ "id": "c2-comment", "type": "comment", "z": "tab-modpackqt-demo",
|
|
45
|
+
"name": "2) Setpoint: number → encode float32 → PLC write",
|
|
46
|
+
"info": "Click inject — sends 23.5 to PLC holding @200 (2 registers).",
|
|
47
|
+
"x": 230, "y": 160, "wires": [] },
|
|
48
|
+
{ "id": "i-sp", "type": "inject", "z": "tab-modpackqt-demo",
|
|
49
|
+
"name": "Inject 23.5", "props": [{ "p": "payload", "v": "23.5", "vt": "num" }],
|
|
50
|
+
"x": 130, "y": 200, "wires": [["enc-sp"]] },
|
|
51
|
+
{ "id": "enc-sp", "type": "encode-float32", "z": "tab-modpackqt-demo",
|
|
52
|
+
"name": "encode float32 BE", "endian": "BE",
|
|
53
|
+
"x": 360, "y": 200, "wires": [["mw-sp"]] },
|
|
54
|
+
{ "id": "mw-sp", "type": "modpackqt-master-write", "z": "tab-modpackqt-demo",
|
|
55
|
+
"name": "Write FC16 @200", "server": "config-modpackqt-runtime",
|
|
56
|
+
"targetHost": "192.168.1.10", "targetPort": 502, "unitId": 1,
|
|
57
|
+
"functionCode": "16", "address": 200,
|
|
58
|
+
"x": 600, "y": 200, "wires": [["d-sp"]] },
|
|
59
|
+
{ "id": "d-sp", "type": "debug", "z": "tab-modpackqt-demo",
|
|
60
|
+
"name": "Setpoint result", "active": true, "complete": "true",
|
|
61
|
+
"x": 820, "y": 200, "wires": [] },
|
|
62
|
+
|
|
63
|
+
{ "id": "c3-comment", "type": "comment", "z": "tab-modpackqt-demo",
|
|
64
|
+
"name": "3) Status bits: 1 register → 8 booleans",
|
|
65
|
+
"info": "Wire to a switch node next to act on individual bits.",
|
|
66
|
+
"x": 200, "y": 280, "wires": [] },
|
|
67
|
+
{ "id": "i-status", "type": "inject", "z": "tab-modpackqt-demo",
|
|
68
|
+
"name": "Read status", "props": [{ "p": "payload" }],
|
|
69
|
+
"x": 130, "y": 320, "wires": [["mr-status"]] },
|
|
70
|
+
{ "id": "mr-status", "type": "modpackqt-master-read", "z": "tab-modpackqt-demo",
|
|
71
|
+
"name": "Read FC3 @50 qty=1", "server": "config-modpackqt-runtime",
|
|
72
|
+
"targetHost": "192.168.1.10", "targetPort": 502, "unitId": 1,
|
|
73
|
+
"functionCode": "3", "address": 50, "quantity": 1, "pollInterval": 0,
|
|
74
|
+
"x": 360, "y": 320, "wires": [["dec-status"]] },
|
|
75
|
+
{ "id": "dec-status", "type": "decode-bitmask", "z": "tab-modpackqt-demo",
|
|
76
|
+
"name": "decode bitmask 8 bits", "sourceType": "registers", "bits": 8,
|
|
77
|
+
"x": 600, "y": 320, "wires": [["d-status"]] },
|
|
78
|
+
{ "id": "d-status", "type": "debug", "z": "tab-modpackqt-demo",
|
|
79
|
+
"name": "Status bits", "active": true, "complete": "payload",
|
|
80
|
+
"x": 820, "y": 320, "wires": [] },
|
|
81
|
+
|
|
82
|
+
{ "id": "c4-comment", "type": "comment", "z": "tab-modpackqt-demo",
|
|
83
|
+
"name": "4) Serial number: 8 registers → UTF-8 string",
|
|
84
|
+
"info": "Many devices store nameplate text starting at register 10.",
|
|
85
|
+
"x": 230, "y": 400, "wires": [] },
|
|
86
|
+
{ "id": "i-sn", "type": "inject", "z": "tab-modpackqt-demo",
|
|
87
|
+
"name": "Read serial", "props": [{ "p": "payload" }],
|
|
88
|
+
"x": 130, "y": 440, "wires": [["mr-sn"]] },
|
|
89
|
+
{ "id": "mr-sn", "type": "modpackqt-master-read", "z": "tab-modpackqt-demo",
|
|
90
|
+
"name": "Read FC3 @10 qty=8", "server": "config-modpackqt-runtime",
|
|
91
|
+
"targetHost": "192.168.1.10", "targetPort": 502, "unitId": 1,
|
|
92
|
+
"functionCode": "3", "address": 10, "quantity": 8, "pollInterval": 0,
|
|
93
|
+
"x": 360, "y": 440, "wires": [["dec-sn"]] },
|
|
94
|
+
{ "id": "dec-sn", "type": "decode-string", "z": "tab-modpackqt-demo",
|
|
95
|
+
"name": "decode string utf8", "endian": "BE", "sourceType": "registers",
|
|
96
|
+
"encoding": "utf8", "trim": true,
|
|
97
|
+
"x": 600, "y": 440, "wires": [["d-sn"]] },
|
|
98
|
+
{ "id": "d-sn", "type": "debug", "z": "tab-modpackqt-demo",
|
|
99
|
+
"name": "Serial number", "active": true, "complete": "payload",
|
|
100
|
+
"x": 820, "y": 440, "wires": [] },
|
|
101
|
+
|
|
102
|
+
{ "id": "c5-comment", "type": "comment", "z": "tab-modpackqt-demo",
|
|
103
|
+
"name": "5) Local slave loop (no PLC needed): encode int32 → slave write → slave read → decode",
|
|
104
|
+
"info": "Demonstrates the embedded slave server. Connect any external Modbus master to <host>:1502, unit 1, FC3, address 0, qty 2 — you'll read the same value.",
|
|
105
|
+
"x": 360, "y": 520, "wires": [] },
|
|
106
|
+
{ "id": "i-slave", "type": "inject", "z": "tab-modpackqt-demo",
|
|
107
|
+
"name": "Inject 1234567", "props": [{ "p": "payload", "v": "1234567", "vt": "num" }],
|
|
108
|
+
"x": 130, "y": 560, "wires": [["enc-slave"]] },
|
|
109
|
+
{ "id": "enc-slave", "type": "encode-int32", "z": "tab-modpackqt-demo",
|
|
110
|
+
"name": "encode int32 BE", "endian": "BE",
|
|
111
|
+
"x": 340, "y": 560, "wires": [["sw-slave"]] },
|
|
112
|
+
{ "id": "sw-slave", "type": "modpackqt-slave-write", "z": "tab-modpackqt-demo",
|
|
113
|
+
"name": "slave write @0", "server": "config-modpackqt-runtime",
|
|
114
|
+
"registerType": "holding", "address": 0,
|
|
115
|
+
"x": 540, "y": 560, "wires": [["sr-slave"]] },
|
|
116
|
+
{ "id": "sr-slave", "type": "modpackqt-slave-read", "z": "tab-modpackqt-demo",
|
|
117
|
+
"name": "slave read @0 qty=2", "server": "config-modpackqt-runtime",
|
|
118
|
+
"registerType": "holding", "address": 0, "quantity": 2, "pollInterval": 0,
|
|
119
|
+
"x": 760, "y": 560, "wires": [["dec-slave"]] },
|
|
120
|
+
{ "id": "dec-slave", "type": "decode-int32", "z": "tab-modpackqt-demo",
|
|
121
|
+
"name": "decode int32 BE", "endian": "BE", "sourceType": "registers",
|
|
122
|
+
"x": 980, "y": 560, "wires": [["d-slave"]] },
|
|
123
|
+
{ "id": "d-slave", "type": "debug", "z": "tab-modpackqt-demo",
|
|
124
|
+
"name": "Round-trip value", "active": true, "complete": "payload",
|
|
125
|
+
"x": 1180, "y": 560, "wires": [] },
|
|
126
|
+
|
|
127
|
+
{ "id": "c6-comment", "type": "comment", "z": "tab-modpackqt-demo",
|
|
128
|
+
"name": "6) Traffic monitor — sees ALL Modbus ops above (free, no input wire)",
|
|
129
|
+
"info": "Wire to the Debug pane to watch every read/write happen in real time. Filter by direction, function code, or target.",
|
|
130
|
+
"x": 320, "y": 640, "wires": [] },
|
|
131
|
+
{ "id": "traffic-mon", "type": "modpackqt-traffic", "z": "tab-modpackqt-demo",
|
|
132
|
+
"name": "All ops", "server": "config-modpackqt-runtime",
|
|
133
|
+
"filterDirection": "any", "filterKind": "any", "filterFc": "any",
|
|
134
|
+
"filterTarget": "", "format": "object", "alsoLog": false,
|
|
135
|
+
"x": 130, "y": 680, "wires": [["d-traffic"]] },
|
|
136
|
+
{ "id": "d-traffic", "type": "debug", "z": "tab-modpackqt-demo",
|
|
137
|
+
"name": "Modbus traffic", "active": true, "complete": "payload",
|
|
138
|
+
"x": 360, "y": 680, "wires": [] }
|
|
194
139
|
]
|
|
@@ -2,15 +2,39 @@
|
|
|
2
2
|
RED.nodes.registerType('modpackqt-config', {
|
|
3
3
|
category: 'config',
|
|
4
4
|
defaults: {
|
|
5
|
-
name:
|
|
6
|
-
|
|
7
|
-
|
|
5
|
+
name: { value: 'ModPackQT Gateway' },
|
|
6
|
+
masterMode: { value: 'tcp', required: true },
|
|
7
|
+
serialPort: { value: '' },
|
|
8
|
+
baudRate: { value: 9600 },
|
|
9
|
+
parity: { value: 'none' },
|
|
10
|
+
dataBits: { value: 8 },
|
|
11
|
+
stopBits: { value: 1 },
|
|
12
|
+
timeoutMs: { value: 3000, validate: RED.validators.number() },
|
|
13
|
+
slaveEnabled: { value: false },
|
|
14
|
+
slaveHost: { value: '0.0.0.0' },
|
|
15
|
+
slavePort: { value: 1502, validate: RED.validators.number() }
|
|
8
16
|
},
|
|
9
17
|
credentials: {
|
|
10
18
|
apiKey: { type: 'password' }
|
|
11
19
|
},
|
|
12
|
-
label: function() {
|
|
13
|
-
|
|
20
|
+
label: function () {
|
|
21
|
+
const m = this.masterMode === 'rtu' ? `RTU ${this.serialPort || '?'}` : 'TCP master';
|
|
22
|
+
const s = this.slaveEnabled ? ` + slave :${this.slavePort}` : '';
|
|
23
|
+
return this.name || `${m}${s}`;
|
|
24
|
+
},
|
|
25
|
+
oneditprepare: function () {
|
|
26
|
+
const toggleRtu = () => {
|
|
27
|
+
const isRtu = $('#node-config-input-masterMode').val() === 'rtu';
|
|
28
|
+
$('.modpackqt-rtu-only').toggle(isRtu);
|
|
29
|
+
};
|
|
30
|
+
const toggleSlave = () => {
|
|
31
|
+
const on = $('#node-config-input-slaveEnabled').is(':checked');
|
|
32
|
+
$('.modpackqt-slave-only').toggle(on);
|
|
33
|
+
};
|
|
34
|
+
$('#node-config-input-masterMode').on('change', toggleRtu);
|
|
35
|
+
$('#node-config-input-slaveEnabled').on('change', toggleSlave);
|
|
36
|
+
toggleRtu();
|
|
37
|
+
toggleSlave();
|
|
14
38
|
}
|
|
15
39
|
});
|
|
16
40
|
</script>
|
|
@@ -20,109 +44,102 @@
|
|
|
20
44
|
<label for="node-config-input-name"><i class="fa fa-tag"></i> Name</label>
|
|
21
45
|
<input type="text" id="node-config-input-name" placeholder="ModPackQT Gateway">
|
|
22
46
|
</div>
|
|
47
|
+
|
|
48
|
+
<h4 style="margin-top:18px">Master (outbound to remote devices)</h4>
|
|
23
49
|
<div class="form-row">
|
|
24
|
-
<label for="node-config-input-
|
|
25
|
-
<
|
|
50
|
+
<label for="node-config-input-masterMode"><i class="fa fa-cogs"></i> Mode</label>
|
|
51
|
+
<select id="node-config-input-masterMode">
|
|
52
|
+
<option value="tcp">Modbus TCP</option>
|
|
53
|
+
<option value="rtu">Modbus RTU (Serial)</option>
|
|
54
|
+
</select>
|
|
55
|
+
</div>
|
|
56
|
+
<div class="form-row modpackqt-rtu-only">
|
|
57
|
+
<label for="node-config-input-serialPort"><i class="fa fa-plug"></i> Serial Port</label>
|
|
58
|
+
<input type="text" id="node-config-input-serialPort" placeholder="/dev/ttyUSB0 or COM3">
|
|
59
|
+
</div>
|
|
60
|
+
<div class="form-row modpackqt-rtu-only">
|
|
61
|
+
<label for="node-config-input-baudRate"><i class="fa fa-tachometer"></i> Baud</label>
|
|
62
|
+
<input type="number" id="node-config-input-baudRate" placeholder="9600">
|
|
63
|
+
</div>
|
|
64
|
+
<div class="form-row modpackqt-rtu-only">
|
|
65
|
+
<label for="node-config-input-parity"><i class="fa fa-list"></i> Parity</label>
|
|
66
|
+
<select id="node-config-input-parity">
|
|
67
|
+
<option value="none">None</option>
|
|
68
|
+
<option value="even">Even</option>
|
|
69
|
+
<option value="odd">Odd</option>
|
|
70
|
+
</select>
|
|
71
|
+
</div>
|
|
72
|
+
<div class="form-row modpackqt-rtu-only">
|
|
73
|
+
<label for="node-config-input-dataBits"><i class="fa fa-hashtag"></i> Data Bits</label>
|
|
74
|
+
<select id="node-config-input-dataBits">
|
|
75
|
+
<option value="8">8</option><option value="7">7</option>
|
|
76
|
+
</select>
|
|
77
|
+
</div>
|
|
78
|
+
<div class="form-row modpackqt-rtu-only">
|
|
79
|
+
<label for="node-config-input-stopBits"><i class="fa fa-hashtag"></i> Stop Bits</label>
|
|
80
|
+
<select id="node-config-input-stopBits">
|
|
81
|
+
<option value="1">1</option><option value="2">2</option>
|
|
82
|
+
</select>
|
|
26
83
|
</div>
|
|
27
84
|
<div class="form-row">
|
|
28
|
-
<label for="node-config-input-
|
|
29
|
-
<input type="number" id="node-config-input-
|
|
85
|
+
<label for="node-config-input-timeoutMs"><i class="fa fa-clock-o"></i> Timeout (ms)</label>
|
|
86
|
+
<input type="number" id="node-config-input-timeoutMs" placeholder="3000">
|
|
30
87
|
</div>
|
|
88
|
+
|
|
89
|
+
<h4 style="margin-top:18px">Slave Server (inbound — let other masters read from you)</h4>
|
|
90
|
+
<div class="form-row">
|
|
91
|
+
<label for="node-config-input-slaveEnabled" style="width:auto">
|
|
92
|
+
<input type="checkbox" id="node-config-input-slaveEnabled" style="width:auto;vertical-align:middle">
|
|
93
|
+
Enable embedded Modbus TCP slave server
|
|
94
|
+
</label>
|
|
95
|
+
</div>
|
|
96
|
+
<div class="form-row modpackqt-slave-only">
|
|
97
|
+
<label for="node-config-input-slaveHost"><i class="fa fa-globe"></i> Bind Host</label>
|
|
98
|
+
<input type="text" id="node-config-input-slaveHost" placeholder="0.0.0.0 (all interfaces)">
|
|
99
|
+
</div>
|
|
100
|
+
<div class="form-row modpackqt-slave-only">
|
|
101
|
+
<label for="node-config-input-slavePort"><i class="fa fa-hashtag"></i> Slave Port</label>
|
|
102
|
+
<input type="number" id="node-config-input-slavePort" placeholder="1502">
|
|
103
|
+
</div>
|
|
104
|
+
|
|
105
|
+
<h4 style="margin-top:18px">API Key (optional — for unlimited usage)</h4>
|
|
31
106
|
<div class="form-row">
|
|
32
107
|
<label for="node-config-input-apiKey"><i class="fa fa-key"></i> API Key</label>
|
|
33
|
-
<input type="password" id="node-config-input-apiKey" placeholder="
|
|
108
|
+
<input type="password" id="node-config-input-apiKey" placeholder="Free trial — get one at modpackqt.com/nodered">
|
|
34
109
|
</div>
|
|
110
|
+
|
|
35
111
|
<div class="form-tips">
|
|
36
|
-
<b>
|
|
37
|
-
|
|
112
|
+
<b>No extra app needed.</b> Modbus runs inside Node-RED.<br>
|
|
113
|
+
<b>Free tier:</b> 1,000 ops/day. <a href="https://modpackqt.com/nodered" target="_blank">Get unlimited →</a>
|
|
38
114
|
</div>
|
|
39
115
|
</script>
|
|
40
116
|
|
|
41
117
|
<script type="text/html" data-help-name="modpackqt-config">
|
|
42
118
|
<p>
|
|
43
|
-
Shared
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
<h3>What is the ModPackQT Gateway?</h3>
|
|
48
|
-
<p>
|
|
49
|
-
The Gateway is a small app that runs on your local machine (or a server on your network).
|
|
50
|
-
It acts as a bridge between Node-RED and your Modbus devices, and also hosts the
|
|
51
|
-
Slave Simulator. All ModPackQT nodes talk to this Gateway's REST API.
|
|
119
|
+
Shared runtime for all <b>ModPackQT</b> nodes. The Modbus master client and the
|
|
120
|
+
optional slave server both run inside this Node-RED process — <b>no separate gateway
|
|
121
|
+
app required</b>.
|
|
52
122
|
</p>
|
|
53
123
|
|
|
54
|
-
<h3>
|
|
55
|
-
<
|
|
56
|
-
<li>
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
Slave and advanced features require a paid plan.
|
|
60
|
-
</li>
|
|
61
|
-
<li>
|
|
62
|
-
<b>Download the Gateway app</b> — log in to ModPackQT, open
|
|
63
|
-
<em>Settings → Gateway</em> and download the installer for your OS (Windows/Mac/Linux).
|
|
64
|
-
</li>
|
|
65
|
-
<li>
|
|
66
|
-
<b>Run the Gateway</b> — it starts a local REST API on port <code>8502</code> by default.
|
|
67
|
-
You will see a <em>Running</em> status in the app when it is ready.
|
|
68
|
-
</li>
|
|
69
|
-
<li>
|
|
70
|
-
<b>Create an API Key</b> — in the ModPackQT web app, go to
|
|
71
|
-
<em>Settings → API Keys → New Key</em>. Copy the key and paste it into the
|
|
72
|
-
<em>API Key</em> field in this config node.
|
|
73
|
-
</li>
|
|
74
|
-
<li>
|
|
75
|
-
<b>Set Host and Port</b>:
|
|
76
|
-
<ul>
|
|
77
|
-
<li>If Node-RED runs on the same machine as the Gateway: <code>localhost</code> / <code>8502</code></li>
|
|
78
|
-
<li>If the Gateway is on another machine: use that machine's IP address</li>
|
|
79
|
-
</ul>
|
|
80
|
-
</li>
|
|
81
|
-
</ol>
|
|
82
|
-
|
|
83
|
-
<h3>Properties</h3>
|
|
84
|
-
<dl class="message-properties">
|
|
85
|
-
<dt>Host <span class="property-type">string</span></dt>
|
|
86
|
-
<dd>
|
|
87
|
-
Hostname or IP address of the machine running the ModPackQT Gateway.
|
|
88
|
-
Default: <code>localhost</code>.
|
|
89
|
-
</dd>
|
|
90
|
-
<dt>Port <span class="property-type">number</span></dt>
|
|
91
|
-
<dd>
|
|
92
|
-
TCP port the Gateway REST API listens on. Default: <code>8502</code>.
|
|
93
|
-
Change this only if you configured a custom port in the Gateway settings.
|
|
94
|
-
</dd>
|
|
95
|
-
<dt>API Key <span class="property-type">password</span></dt>
|
|
96
|
-
<dd>
|
|
97
|
-
Your ModPackQT API key. Required for authenticated operations.
|
|
98
|
-
Get it from <em>ModPackQT → Settings → API Keys</em>.
|
|
99
|
-
</dd>
|
|
100
|
-
</dl>
|
|
124
|
+
<h3>Master mode</h3>
|
|
125
|
+
<ul>
|
|
126
|
+
<li><b>Modbus TCP</b> — connects to remote devices via TCP. Each master node specifies its target host/port.</li>
|
|
127
|
+
<li><b>Modbus RTU</b> — opens the configured serial port and talks to RTU slaves on the bus. All RTU master nodes share this serial port.</li>
|
|
128
|
+
</ul>
|
|
101
129
|
|
|
102
|
-
<h3>
|
|
103
|
-
<table>
|
|
104
|
-
<thead><tr><th>Feature</th><th>Free</th><th>Paid</th></tr></thead>
|
|
105
|
-
<tbody>
|
|
106
|
-
<tr><td>Master Read (modpackqt-master-read)</td><td>✓</td><td>✓</td></tr>
|
|
107
|
-
<tr><td>Master Write (modpackqt-master-write)</td><td>✓</td><td>✓</td></tr>
|
|
108
|
-
<tr><td>Slave Write (modpackqt-slave-write)</td><td>✗</td><td>✓</td></tr>
|
|
109
|
-
<tr><td>Slave Read (modpackqt-slave-read)</td><td>✗</td><td>✓</td></tr>
|
|
110
|
-
<tr><td>Number of Slaves</td><td>0</td><td>Plan dependent</td></tr>
|
|
111
|
-
</tbody>
|
|
112
|
-
</table>
|
|
130
|
+
<h3>Embedded slave server</h3>
|
|
113
131
|
<p>
|
|
114
|
-
|
|
132
|
+
When enabled, this config opens a Modbus TCP server on the configured port (default
|
|
133
|
+
<code>1502</code>). Use the <code>modpackqt-slave-write</code> node to push values into
|
|
134
|
+
its register store; external Modbus masters connecting to that port read whatever you
|
|
135
|
+
last wrote.
|
|
115
136
|
</p>
|
|
116
137
|
|
|
117
|
-
<h3>
|
|
118
|
-
<ul>
|
|
119
|
-
<li><b>ECONNREFUSED</b> — the Gateway app is not running. Start it from the ModPackQT app.</li>
|
|
120
|
-
<li><b>401 Unauthorized</b> — missing or invalid API key.</li>
|
|
121
|
-
<li><b>403 Forbidden</b> — your plan does not include this feature, or you have reached a limit.</li>
|
|
122
|
-
<li><b>404 Not Found</b> — the Slave ID or Connection Profile ID does not exist in your account.</li>
|
|
123
|
-
</ul>
|
|
124
|
-
|
|
138
|
+
<h3>API key (optional)</h3>
|
|
125
139
|
<p>
|
|
126
|
-
|
|
140
|
+
Leave blank for the free anonymous tier (1,000 ops/day per Node-RED instance,
|
|
141
|
+
branding visible in node status).
|
|
142
|
+
Add a key for unlimited use and clean status text — <a href="https://modpackqt.com/nodered" target="_blank">get a free 30-day trial key →</a>.
|
|
143
|
+
No credit card required.
|
|
127
144
|
</p>
|
|
128
145
|
</script>
|