node-red-contrib-my-tools 1.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.
Files changed (67) hide show
  1. package/README.txt +69 -0
  2. package/node-red-contrib-mysql-extended-test/mysql-extended.html +443 -0
  3. package/node-red-contrib-mysql-extended-test/mysql-extended.js +355 -0
  4. package/node-red-contrib-rfid-helper/rfid-lazy.html +153 -0
  5. package/node-red-contrib-rfid-helper/rfid-lazy.js +361 -0
  6. package/node-red-contrib-s7-plus/LICENSE +235 -0
  7. package/node-red-contrib-s7-plus/README.md +141 -0
  8. package/node-red-contrib-s7-plus/examples/read-multiple-values-flow.json +346 -0
  9. package/node-red-contrib-s7-plus/examples/read-write-test-flow.json +172 -0
  10. package/node-red-contrib-s7-plus/examples/write-single-values-flow.json +5583 -0
  11. package/node-red-contrib-s7-plus/lib/s7plus/browse/README.md +72 -0
  12. package/node-red-contrib-s7-plus/lib/s7plus/browse/areas.js +36 -0
  13. package/node-red-contrib-s7-plus/lib/s7plus/browse/datatypes.js +91 -0
  14. package/node-red-contrib-s7-plus/lib/s7plus/browse/flat-browser.js +433 -0
  15. package/node-red-contrib-s7-plus/lib/s7plus/browse/index.js +22 -0
  16. package/node-red-contrib-s7-plus/lib/s7plus/browse/lazy.js +397 -0
  17. package/node-red-contrib-s7-plus/lib/s7plus/browse/node-id.js +22 -0
  18. package/node-red-contrib-s7-plus/lib/s7plus/browse/resolve-symbolic.js +181 -0
  19. package/node-red-contrib-s7-plus/lib/s7plus/browse/vte-helpers.js +49 -0
  20. package/node-red-contrib-s7-plus/lib/s7plus/buffer-stream.js +96 -0
  21. package/node-red-contrib-s7-plus/lib/s7plus/client.js +1238 -0
  22. package/node-red-contrib-s7-plus/lib/s7plus/constants.js +155 -0
  23. package/node-red-contrib-s7-plus/lib/s7plus/crc/index.js +3 -0
  24. package/node-red-contrib-s7-plus/lib/s7plus/crc/s7-crc32.js +70 -0
  25. package/node-red-contrib-s7-plus/lib/s7plus/crc/symbol-crc.js +271 -0
  26. package/node-red-contrib-s7-plus/lib/s7plus/debug.js +88 -0
  27. package/node-red-contrib-s7-plus/lib/s7plus/explore-result.js +41 -0
  28. package/node-red-contrib-s7-plus/lib/s7plus/item-address.js +55 -0
  29. package/node-red-contrib-s7-plus/lib/s7plus/pdu-explore.js +77 -0
  30. package/node-red-contrib-s7-plus/lib/s7plus/pdu-messages.js +359 -0
  31. package/node-red-contrib-s7-plus/lib/s7plus/pobject.js +197 -0
  32. package/node-red-contrib-s7-plus/lib/s7plus/pvalue-codec.js +435 -0
  33. package/node-red-contrib-s7-plus/lib/s7plus/pvalue.js +653 -0
  34. package/node-red-contrib-s7-plus/lib/s7plus/pvar-lists.js +336 -0
  35. package/node-red-contrib-s7-plus/lib/s7plus/read-result.js +91 -0
  36. package/node-red-contrib-s7-plus/lib/s7plus/s7p.js +266 -0
  37. package/node-red-contrib-s7-plus/lib/s7plus/tag-routing.js +30 -0
  38. package/node-red-contrib-s7-plus/lib/s7plus/transport/cotp-stream.js +335 -0
  39. package/node-red-contrib-s7-plus/lib/s7plus/transport/s7-transport.js +335 -0
  40. package/node-red-contrib-s7-plus/nodes/icons/s7complus.png +0 -0
  41. package/node-red-contrib-s7-plus/nodes/icons/s7complus.svg +17 -0
  42. package/node-red-contrib-s7-plus/nodes/s7complus-endpoint.js +825 -0
  43. package/node-red-contrib-s7-plus/nodes/s7complus-explore.js +91 -0
  44. package/node-red-contrib-s7-plus/nodes/s7complus-in.js +255 -0
  45. package/node-red-contrib-s7-plus/nodes/s7complus-out.js +182 -0
  46. package/node-red-contrib-s7-plus/nodes/s7complus.html +1541 -0
  47. package/node-red-contrib-s7-plus/nodes/s7complus.js +10 -0
  48. package/node-red-contrib-s7-plus/package.json +50 -0
  49. package/node-red-contrib-s7-plus/plc/s7-1500/DB_Arrays.db +17 -0
  50. package/node-red-contrib-s7-plus/plc/s7-1500/DB_Binary.db +16 -0
  51. package/node-red-contrib-s7-plus/plc/s7-1500/DB_BitStrings.db +36 -0
  52. package/node-red-contrib-s7-plus/plc/s7-1500/DB_CharacterStrings.db +42 -0
  53. package/node-red-contrib-s7-plus/plc/s7-1500/DB_DateAndTime.db +70 -0
  54. package/node-red-contrib-s7-plus/plc/s7-1500/DB_FloatingPoint.db +42 -0
  55. package/node-red-contrib-s7-plus/plc/s7-1500/DB_Integers.db +72 -0
  56. package/node-red-contrib-s7-plus/plc/s7-1500/DB_Timers.db +40 -0
  57. package/node-red-contrib-s7-plus/scripts/example-flow-shared.js +39 -0
  58. package/node-red-contrib-s7-plus/scripts/generate-read-multiple-flow.js +331 -0
  59. package/node-red-contrib-s7-plus/scripts/generate-rw-test-flow.js +690 -0
  60. package/node-red-contrib-s7-plus/scripts/generate-write-flow.js +476 -0
  61. package/node-red-contrib-s7-plus/scripts/layout-write-flow.js +156 -0
  62. package/node-red-contrib-s7-plus/scripts/run-tests.js +16 -0
  63. package/node-red-flowgobal-change/variable-change.html +425 -0
  64. package/node-red-flowgobal-change/variable-change.js +92 -0
  65. package/node-red-ui_media_viewer/ui_media_viewer.html +87 -0
  66. package/node-red-ui_media_viewer/ui_media_viewer.js +136 -0
  67. package/package.json +12 -0
@@ -0,0 +1,361 @@
1
+ module.exports = function(RED) {
2
+ function RFIDLazyNode(config) {
3
+ RED.nodes.createNode(this, config);
4
+ var node = this;
5
+
6
+ // 讀取 UI 設定值
7
+ node.mode = config.mode;
8
+ node.writeStrategy = config.writeStrategy || "manual";
9
+ node.offset = parseInt(config.offset) || 0;
10
+ node.length = parseInt(config.length) || 4;
11
+ node.writeDataConfig = config.writeData || "";
12
+ node.writeDataType = config.writeDataType || "str";
13
+ node.readTriggerMode = config.readTriggerMode || "manual";
14
+ node.autoReadInterval = parseInt(config.autoReadInterval) || 1000;
15
+
16
+ node.enableDeparture = (config.enableDeparture === "true" || config.enableDeparture === true);
17
+ node.departureTimeout = (parseFloat(config.departureTimeout) || 3) * 1000;
18
+
19
+ // 內部狀態變數
20
+ node.rfidState = "IDLE";
21
+ node.readTime = 0;
22
+ node.targetTag = [];
23
+ node.writeRawdata = [];
24
+ node.currentWriteText = "";
25
+ node.autoTimer = null;
26
+
27
+ // WRITE/CLEAR 專用分批處理變數
28
+ node.currentProcessOffset = 0;
29
+ node.processEndOffset = 0;
30
+ node.currentChunkLength = 0;
31
+
32
+ node.lastSeenTag = false;
33
+ node.departureTimer = null;
34
+ node.watchdogTimer = null;
35
+ node.hardwareDelayTimer = null;
36
+ node.manualRetryTimer = null; // 【新增】:手動排隊計時器
37
+
38
+ // ==========================================
39
+ // 【核心 1】全域互斥鎖 (Global Mutex Lock)
40
+ // 確保整個 Node-RED 同一時間只有一個節點能存取硬體
41
+ // ==========================================
42
+ function acquireLock() {
43
+ let lock = node.context().global.get("rfid_hardware_lock");
44
+ if (!lock) {
45
+ node.context().global.set("rfid_hardware_lock", node.id);
46
+ return true;
47
+ }
48
+ return lock === node.id;
49
+ }
50
+
51
+ function releaseLock() {
52
+ let lock = node.context().global.get("rfid_hardware_lock");
53
+ if (lock === node.id) {
54
+ node.context().global.set("rfid_hardware_lock", null);
55
+ }
56
+ }
57
+
58
+ function clearAllTimers() {
59
+ if (node.watchdogTimer) clearTimeout(node.watchdogTimer);
60
+ if (node.hardwareDelayTimer) clearTimeout(node.hardwareDelayTimer);
61
+ node.watchdogTimer = null;
62
+ node.hardwareDelayTimer = null;
63
+ }
64
+
65
+ function resetWatchdog() {
66
+ clearAllTimers();
67
+ node.watchdogTimer = setTimeout(() => {
68
+ if (node.rfidState !== "IDLE") {
69
+ if (node.rfidState !== "CHECK_TAG") {
70
+ node.warn("看門狗警報:Modbus 掉線或無回應,強制解除忙碌並釋放總線鎖!");
71
+ if (!(node.mode === "READ" && node.readTriggerMode === "auto")) {
72
+ node.send([null, null, { payload: "錯誤: 底層通訊掉線,已自動重置", timeout: true }]);
73
+ }
74
+ }
75
+ node.rfidState = "IDLE";
76
+ releaseLock(); // 確保逾時也能解鎖
77
+ }
78
+ }, 6000);
79
+ }
80
+
81
+ function startCheckTag() {
82
+ if (node.rfidState !== "IDLE") return;
83
+ node.rfidState = "CHECK_TAG";
84
+ node.readTime = Date.now();
85
+ node.send([{ payload: { fc: 3, unitid: 1, address: 0x00ff, quantity: 13 } }, null, null]);
86
+ resetWatchdog();
87
+ }
88
+
89
+ // ==========================================
90
+ // 【核心 2】自動讀取靜音迴避機制
91
+ // ==========================================
92
+ if (node.mode === "READ" && node.readTriggerMode === "auto") {
93
+ node.autoTimer = setInterval(() => {
94
+ if (node.rfidState === "IDLE") {
95
+ if (acquireLock()) { // 拿不到鎖就默默放棄,絕不干擾寫入!
96
+ prepareAndStartProcess(null);
97
+ }
98
+ }
99
+ }, node.autoReadInterval);
100
+ }
101
+
102
+ node.on('close', function() {
103
+ if (node.autoTimer) clearInterval(node.autoTimer);
104
+ if (node.departureTimer) clearTimeout(node.departureTimer);
105
+ if (node.manualRetryTimer) clearTimeout(node.manualRetryTimer);
106
+ clearAllTimers();
107
+ releaseLock();
108
+ });
109
+
110
+ // 整理前置準備邏輯
111
+ function prepareAndStartProcess(msg) {
112
+ if (node.mode === "WRITE") {
113
+ let val = "";
114
+ if (msg && node.writeDataType === "msg") val = RED.util.getMessageProperty(msg, node.writeDataConfig);
115
+ else if (node.writeDataType === "flow") val = node.context().flow.get(node.writeDataConfig);
116
+ else if (node.writeDataType === "global") val = node.context().global.get(node.writeDataConfig);
117
+ else val = node.writeDataConfig;
118
+
119
+ // 【終極字串淨化器】:杜絕 undefined 幽靈字串
120
+ if (val === undefined || val === null) val = "";
121
+ else if (typeof val === "object") { try { val = JSON.stringify(val); } catch(e) { val = String(val); } }
122
+ else val = String(val);
123
+ val = val.replace(/undefined/g, ""); // 清除上一站傳來的空變數殘留
124
+
125
+ node.currentWriteText = val;
126
+
127
+ if (node.writeStrategy === "auto") {
128
+ let requiredWords = Math.ceil(node.currentWriteText.length / 2);
129
+ node.length = requiredWords === 0 ? 1 : requiredWords;
130
+ }
131
+
132
+ if (node.length > 64) node.length = 64;
133
+
134
+ if (node.currentWriteText.length > node.length * 2) {
135
+ node.currentWriteText = node.currentWriteText.substring(0, node.length * 2);
136
+ node.warn("輸入字串過長,已自動截斷");
137
+ }
138
+
139
+ let value = [];
140
+ let chars = node.currentWriteText.split("");
141
+ for (let i = 0; i < node.length * 2; i += 2) {
142
+ let high = (chars[i] || ' ').charCodeAt(0);
143
+ let low = (chars[i+1] || ' ').charCodeAt(0);
144
+ value.push((high << 8) | low);
145
+ }
146
+ node.writeRawdata = value;
147
+ node.currentProcessOffset = node.offset;
148
+ node.processEndOffset = node.offset + node.length;
149
+ node.currentChunkLength = Math.min(8, node.processEndOffset - node.currentProcessOffset);
150
+
151
+ } else if (node.mode === "READ") {
152
+ if (node.length > 16) {
153
+ node.length = 16;
154
+ }
155
+ } else if (node.mode === "CLEAR") {
156
+ if (node.length > 64) node.length = 64;
157
+ node.currentProcessOffset = node.offset;
158
+ node.processEndOffset = node.offset + node.length;
159
+ node.currentChunkLength = Math.min(8, node.processEndOffset - node.currentProcessOffset);
160
+ }
161
+ startCheckTag();
162
+ }
163
+
164
+ node.on('input', function(msg, send, done) {
165
+ send = send || function() { node.send.apply(node, arguments) };
166
+
167
+ if (msg.payload === "reset") {
168
+ node.rfidState = "IDLE";
169
+ node.lastSeenTag = false;
170
+ if (node.departureTimer) { clearTimeout(node.departureTimer); node.departureTimer = null; }
171
+ if (node.manualRetryTimer) { clearTimeout(node.manualRetryTimer); node.manualRetryTimer = null; }
172
+ clearAllTimers();
173
+ if (node.context().global.get("rfid_hardware_lock") === node.id) releaseLock();
174
+ send([null, null, { payload: "系統已強制重置並釋放總線鎖" }]);
175
+ if (done) done(); return;
176
+ }
177
+
178
+ // ==========================================
179
+ // 【核心 3】嚴格路由:區分 Modbus 回傳 vs 手動 Inject
180
+ // ==========================================
181
+ let isModbusMsg = Array.isArray(msg.payload) ||
182
+ (msg.payload !== null && typeof msg.payload === 'object' &&
183
+ !Array.isArray(msg.payload) &&
184
+ ('fc' in msg.payload || 'unitid' in msg.payload || 'value' in msg.payload || 'data' in msg.payload));
185
+
186
+ if (isModbusMsg) {
187
+ // 如果是 Modbus 廣播,但我沒拿鎖,或者是多餘的雜訊,直接無情丟棄!
188
+ let lock = node.context().global.get("rfid_hardware_lock");
189
+ if (lock !== node.id || node.rfidState === "IDLE") {
190
+ if (done) done(); return;
191
+ }
192
+
193
+ // --- 以下為拿著鎖的節點,專心處理狀態機 ---
194
+ clearAllTimers();
195
+ let data = msg.payload;
196
+
197
+ if (node.rfidState === "CHECK_TAG") {
198
+ if (data[0] > 0) {
199
+ node.lastSeenTag = true;
200
+ if (node.departureTimer) {
201
+ clearTimeout(node.departureTimer);
202
+ node.departureTimer = null;
203
+ }
204
+ node.targetTag = data.slice(1, 13);
205
+ node.rfidState = "SET_INDEX";
206
+
207
+ if (node.mode === "WRITE" || node.mode === "CLEAR") {
208
+ send([null, { payload: { value: [node.currentProcessOffset, node.currentChunkLength], fc: 16, unitid: 1, address: 0x0212, quantity: 2 } }, null]);
209
+ } else {
210
+ send([null, { payload: { value: [node.offset, node.length], fc: 16, unitid: 1, address: 0x0212, quantity: 2 } }, null]);
211
+ }
212
+ resetWatchdog();
213
+
214
+ } else {
215
+ node.rfidState = "IDLE";
216
+ releaseLock(); // 沒掃到 Tag,提早釋放總線讓別人用
217
+
218
+ if (node.enableDeparture && node.lastSeenTag && !node.departureTimer) {
219
+ node.departureTimer = setTimeout(() => {
220
+ let warnMsg = { payload: "提醒: Tag 已移開", event: "tag_departed", timeout_seconds: (node.departureTimeout / 1000) };
221
+ node.send([null, null, warnMsg]);
222
+ node.lastSeenTag = false;
223
+ node.departureTimer = null;
224
+ }, node.departureTimeout);
225
+ }
226
+ if (!(node.mode === "READ" && node.readTriggerMode === "auto")) {
227
+ send([null, null, { payload: "錯誤: 範圍內無 Tag", error: true }]);
228
+ }
229
+ }
230
+ }
231
+ else if (node.rfidState === "SET_INDEX") {
232
+ node.rfidState = "START_CMD";
233
+ node.hardwareDelayTimer = setTimeout(() => {
234
+ if (node.mode === "WRITE") {
235
+ let chunkStart = node.currentProcessOffset - node.offset;
236
+ let chunkData = node.writeRawdata.slice(chunkStart, chunkStart + node.currentChunkLength);
237
+ let writePayload = [1].concat(chunkData);
238
+ send([null, { payload: { value: writePayload, fc: 16, unitid: 1, address: 0x0400, quantity: writePayload.length } }, null]);
239
+ } else if (node.mode === "CLEAR") {
240
+ let writePayload = [1];
241
+ for (let i = 0; i < node.currentChunkLength; i++) writePayload.push(0);
242
+ send([null, { payload: { value: writePayload, fc: 16, unitid: 1, address: 0x0400, quantity: writePayload.length } }, null]);
243
+ } else {
244
+ send([null, { payload: { value: [1], fc: 16, unitid: 1, address: 0x0300, quantity: 1 } }, null]);
245
+ }
246
+ resetWatchdog();
247
+ }, 100);
248
+ }
249
+ else if (node.rfidState === "START_CMD") {
250
+ node.rfidState = "POLLING";
251
+ node.readTime = Date.now();
252
+ node.hardwareDelayTimer = setTimeout(() => {
253
+ let addr = (node.mode === "READ") ? 0x0300 : 0x0400;
254
+ let qty = (node.mode === "READ") ? (node.length + 1) : 1;
255
+ send([{ payload: { fc: 3, unitid: 1, address: addr, quantity: qty } }, null, null]);
256
+ resetWatchdog();
257
+ }, 150);
258
+ }
259
+ else if (node.rfidState === "POLLING") {
260
+ if (data[0] === 1) {
261
+ if (Date.now() - node.readTime < 5000) {
262
+ node.hardwareDelayTimer = setTimeout(() => {
263
+ let addr = (node.mode === "READ") ? 0x0300 : 0x0400;
264
+ let qty = (node.mode === "READ") ? (node.length + 1) : 1;
265
+ send([{ payload: { fc: 3, unitid: 1, address: addr, quantity: qty } }, null, null]);
266
+ resetWatchdog();
267
+ }, 150);
268
+ } else {
269
+ node.rfidState = "IDLE";
270
+ releaseLock();
271
+ let addr = (node.mode === "READ") ? 0x0300 : 0x0400;
272
+ let resetMsg = { payload: { value: [0], fc: 16, unitid: 1, address: addr, quantity: 1 } };
273
+ if (node.mode === "READ" && node.readTriggerMode === "auto") {
274
+ send([null, resetMsg, null]);
275
+ } else {
276
+ send([null, resetMsg, { payload: "錯誤: 執行逾時", timeout: true }]);
277
+ }
278
+ }
279
+ } else if (data[0] === 0) {
280
+
281
+ if (node.mode === "WRITE" || node.mode === "CLEAR") {
282
+ node.currentProcessOffset += node.currentChunkLength;
283
+ if (node.currentProcessOffset < node.processEndOffset) {
284
+ node.rfidState = "SET_INDEX";
285
+ node.currentChunkLength = Math.min(8, node.processEndOffset - node.currentProcessOffset);
286
+
287
+ node.hardwareDelayTimer = setTimeout(() => {
288
+ send([null, { payload: { value: [node.currentProcessOffset, node.currentChunkLength], fc: 16, unitid: 1, address: 0x0212, quantity: 2 } }, null]);
289
+ resetWatchdog();
290
+ }, 100);
291
+ if (done) done();
292
+ return;
293
+ }
294
+ }
295
+
296
+ // ==== 全部處理完成,打包最終輸出 ====
297
+ node.rfidState = "IDLE";
298
+ releaseLock(); // 完美收工,釋放總線鎖!
299
+
300
+ let hexString = node.targetTag.map(b => ("0" + b.toString(16)).slice(-2).toUpperCase()).join("");
301
+ let outbuf = { tagID: hexString, mode: node.mode, offset: node.offset, length: node.length, userData: "" };
302
+
303
+ if (node.mode === "READ") {
304
+ let asciiString = "";
305
+ for (let i = 0; i < node.length; i++) {
306
+ let val = data[i+1];
307
+ if (val !== undefined) {
308
+ let hiByte = (val >> 8) & 0xFF;
309
+ let loByte = val & 0xFF;
310
+ if (hiByte !== 0) asciiString += String.fromCharCode(hiByte);
311
+ if (loByte !== 0) asciiString += String.fromCharCode(loByte);
312
+ }
313
+ }
314
+ outbuf.userData = asciiString;
315
+ outbuf.rawData = data.slice(1, node.length + 1);
316
+ } else if (node.mode === "WRITE") {
317
+ outbuf.userData = node.currentWriteText;
318
+ outbuf.rawData = node.writeRawdata;
319
+ if(node.writeStrategy === "auto" && node.length > 8) outbuf.autoBatched = true;
320
+ } else if (node.mode === "CLEAR") {
321
+ outbuf.userData = "成功批次清空 " + node.length + " 個 Word";
322
+ outbuf.rawData = [];
323
+ if (node.length > 8) outbuf.autoBatched = true;
324
+ }
325
+ send([null, null, { payload: outbuf }]);
326
+ }
327
+ }
328
+ } else {
329
+ // ==========================================
330
+ // 【核心 4】外部手動觸發 (Inject) 的智能排隊系統
331
+ // ==========================================
332
+ if (node.rfidState !== "IDLE" || node.context().global.get("rfid_hardware_lock") === node.id) {
333
+ node.warn("忽略重複觸發:系統正在處理您上一次的指令。");
334
+ if (done) done(); return;
335
+ }
336
+
337
+ // 嘗試拿鎖,若被自動讀取佔用,就等它 0.2 秒,最多重試 5 次 (1秒)
338
+ function tryManualTrigger(retryCount) {
339
+ let lock = node.context().global.get("rfid_hardware_lock");
340
+ if (lock && lock !== node.id) {
341
+ if (retryCount < 5) {
342
+ node.manualRetryTimer = setTimeout(() => tryManualTrigger(retryCount + 1), 200);
343
+ } else {
344
+ if (!(node.mode === "READ" && node.readTriggerMode === "auto")) {
345
+ send([null, null, { payload: "錯誤: 總線持續忙碌中,請稍後再試", error: true }]);
346
+ }
347
+ }
348
+ return;
349
+ }
350
+ if (acquireLock()) {
351
+ prepareAndStartProcess(msg);
352
+ }
353
+ }
354
+
355
+ tryManualTrigger(0);
356
+ }
357
+ if (done) done();
358
+ });
359
+ }
360
+ RED.nodes.registerType("rfid-lazy", RFIDLazyNode);
361
+ }
@@ -0,0 +1,235 @@
1
+ GNU LESSER GENERAL PUBLIC LICENSE
2
+ Version 3, 29 June 2007
3
+
4
+ Copyright (C) 2007 Free Software Foundation, Inc. <http://fsf.org/>
5
+ Everyone is permitted to copy and distribute verbatim copies
6
+ of this license document, but changing it is not allowed.
7
+
8
+
9
+ This version of the GNU Lesser General Public License incorporates
10
+ the terms and conditions of version 3 of the GNU General Public
11
+ License, supplemented by the additional permissions listed below.
12
+
13
+ 0. Additional Definitions.
14
+
15
+ As used herein, "this License" refers to version 3 of the GNU Lesser
16
+ General Public License, and the "GNU GPL" refers to version 3 of the GNU
17
+ General Public License.
18
+
19
+ "The Library" refers to a covered work governed by this License,
20
+ other than an Application or a Combined Work as defined below.
21
+
22
+ An "Application" is any work that makes use of an interface provided
23
+ by the Library, but which is not otherwise based on the Library.
24
+ Defining a subclass of a class defined by the Library is deemed a mode
25
+ of using an interface provided by the Library.
26
+
27
+ A "Combined Work" is a work produced by combining or linking an
28
+ Application with the Library. The particular version of the Library
29
+ with which the Combined Work was made is also called the "Linked
30
+ Version".
31
+
32
+ The "Minimal Corresponding Source" for a Combined Work means the
33
+ Corresponding Source for the Combined Work, excluding any source code
34
+ for portions of the Combined Work that, considered in isolation, are
35
+ based on the Application, and not on the Linked Version.
36
+
37
+ The "Corresponding Application Code" for a Combined Work means the
38
+ object code and/or source code for the Application, including any data
39
+ and utility programs needed for reproducing the Combined Work from the
40
+ Application, but excluding the System Libraries of the Combined Work.
41
+
42
+ 1. Exception to Section 3 of the GNU GPL.
43
+
44
+ You may convey a covered work under sections 3 and 4 of this License
45
+ without being bound by section 3 of the GNU GPL.
46
+
47
+ 2. Conveying Modified Versions.
48
+
49
+ If you modify a copy of the Library, and, in your modifications, a
50
+ facility refers to a function or data to be supplied by an Application
51
+ that uses the facility (other than as an argument passed when the
52
+ facility is invoked), then you may convey a copy of the modified
53
+ version:
54
+
55
+ a) under this License, provided that you make a good faith effort to
56
+ ensure that, in the event an Application does not supply the
57
+ function or data, the facility still operates, and performs
58
+ whatever part of its purpose remains meaningful, or
59
+
60
+ b) under the GNU GPL, with none of the additional permissions of
61
+ this License applicable to that copy.
62
+
63
+ 3. Object Code Incorporating Material from Library Header Files.
64
+
65
+ The object code form of an Application may incorporate material from
66
+ a header file that is part of the Library. You may convey such object
67
+ code under terms of your choice, provided that, if the incorporated
68
+ material is not limited to numerical parameters, data structure
69
+ layouts and accessors, or small macros, inline functions and templates
70
+ (ten or fewer lines in length), you do both of the following:
71
+
72
+ a) Give prominent notice with each copy of the object code that the
73
+ Library is used in it and that the Library and its use are
74
+ covered by this License.
75
+
76
+ b) Accompany the object code with a copy of the GNU GPL and this license
77
+ document.
78
+
79
+ 4. Combined Works.
80
+
81
+ You may convey a Combined Work under terms of your choice that,
82
+ taken together, effectively do not restrict modification of the
83
+ portions of the Library contained in the Combined Work and reverse
84
+ engineering for debugging such modifications, if you also do each of
85
+ the following:
86
+
87
+ a) Give prominent notice with each copy of the Combined Work that
88
+ the Library is used in it and that the Library and its use are
89
+ covered by this License.
90
+
91
+ b) Accompany the Combined Work with a copy of the GNU GPL and this license
92
+ document.
93
+
94
+ c) For a Combined Work that displays copyright notices during
95
+ execution, include the copyright notice for the Library among
96
+ these notices, as well as a reference directing the user to the
97
+ copies of the GNU GPL and this license document.
98
+
99
+ d) Do one of the following:
100
+
101
+ 0) Convey the Minimal Corresponding Source under the terms of this
102
+ License, and the Corresponding Application Code in a form
103
+ suitable for, and under terms that permit, the user to
104
+ recombine or relink the Application with a modified version of
105
+ the Linked Version to produce a modified Combined Work, in the
106
+ manner specified by section 6 of the GNU GPL for conveying
107
+ Corresponding Source.
108
+
109
+ 1) Use a suitable shared library mechanism for linking with the
110
+ Library. A suitable mechanism is one that (a) uses at run time
111
+ a copy of the Library already present on the user's computer
112
+ system, and (b) will operate properly with a modified version
113
+ of the Library that is interface-compatible with the Linked
114
+ Version.
115
+
116
+ e) Provide Installation Information, but only if you would otherwise
117
+ be required to provide such information under section 6 of the
118
+ GNU GPL, and only to the extent that such information is
119
+ necessary to install and execute a modified version of the
120
+ Combined Work produced by recombining or relinking the
121
+ Application with a modified version of the Linked Version. (If
122
+ you use option 4d0, the Installation Information must accompany
123
+ the Minimal Corresponding Source and Corresponding Application
124
+ Code. If you use option 4d1, you must provide the Installation
125
+ Information in the manner specified by section 6 of the GNU GPL
126
+ for conveying Corresponding Source.)
127
+
128
+ 5. Combined Libraries.
129
+
130
+ You may place library facilities that are a work based on the
131
+ Library side by side in a single library together with other library
132
+ facilities that are not Applications and are not covered by this
133
+ License, and convey such a combined library under terms of your
134
+ choice, if you do both of the following:
135
+
136
+ a) Accompany the combined library with a copy of the same work based
137
+ on the Library, uncombined with any other library facilities,
138
+ conveyed under the terms of this License.
139
+
140
+ b) Give prominent notice with the combined library that part of it
141
+ is a work based on the Library, and explaining where to find the
142
+ accompanying uncombined form of the same work.
143
+
144
+ 6. Revised Versions of the GNU Lesser General Public License.
145
+
146
+ The Free Software Foundation may publish revised and/or new versions
147
+ of the GNU Lesser General Public License from time to time. Such new
148
+ versions will be similar in spirit to the present version, but may
149
+ differ in detail to address new problems or concerns.
150
+
151
+ Each version is given a distinguishing version number. If the
152
+ Library as you received it specifies that a certain numbered version
153
+ of the GNU Lesser General Public License "or any later version"
154
+ applies to it, you have the option of following the terms and
155
+ conditions either of that published version or of any later version
156
+ published by the Free Software Foundation. If the Library as you
157
+ received it does not specify a version number of the GNU Lesser
158
+ General Public License, you may choose any version of the GNU Lesser
159
+ General Public License ever published by the Free Software Foundation.
160
+
161
+ If the Library as you received it specifies that a proxy can decide
162
+ whether future versions of the GNU Lesser General Public License shall
163
+ apply, that proxy's public statement of acceptance of any version is
164
+ permanent authorization for you to choose that version for the
165
+ Library.
166
+
167
+
168
+ ================================================================================
169
+ Copyright and attribution for node-red-contrib-s7-plus
170
+ ================================================================================
171
+
172
+ node-red-contrib-s7-plus
173
+ Copyright (C) 2026 Robert Mederer - DataLogXE
174
+
175
+ This program is free software: you can redistribute it and/or modify it under
176
+ the terms of the GNU Lesser General Public License as published by the Free
177
+ Software Foundation, either version 3 of the License, or (at your option) any
178
+ later version.
179
+
180
+ This program is distributed in the hope that it will be useful, but WITHOUT
181
+ ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
182
+ FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more
183
+ details.
184
+
185
+ You should have received a copy of the GNU Lesser General Public License along
186
+ with this program. If not, see <https://www.gnu.org/licenses/>.
187
+
188
+
189
+ Upstream works
190
+ --------------
191
+
192
+ S7CommPlus protocol implementation (derived from):
193
+
194
+ S7CommPlusDriver
195
+ Copyright (C) Thomas Wiens
196
+ https://github.com/thomas-v2/S7CommPlusDriver
197
+ Licensed under the GNU Lesser General Public License, version 3 or later.
198
+
199
+ ISO-on-TCP/COTP transport (informed by):
200
+
201
+ Snap7
202
+ Copyright (C) Davide Nardella
203
+ https://github.com/davenardella/snap7
204
+ Licensed under the GNU Lesser General Public License, version 3.
205
+
206
+ S7CommPlus SymbolCRC (informed by):
207
+
208
+ HarpoS7
209
+ Copyright (c) 2024 bonk
210
+ https://github.com/bonk-dev/HarpoS7
211
+ Licensed under the MIT License (reproduced below).
212
+
213
+
214
+ MIT License (HarpoS7)
215
+ ---------------------
216
+
217
+ Copyright (c) 2024 bonk
218
+
219
+ Permission is hereby granted, free of charge, to any person obtaining a copy
220
+ of this software and associated documentation files (the "Software"), to deal
221
+ in the Software without restriction, including without limitation the rights
222
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
223
+ copies of the Software, and to permit persons to whom the Software is
224
+ furnished to do so, subject to the following conditions:
225
+
226
+ The above copyright notice and this permission notice shall be included in all
227
+ copies or substantial portions of the Software.
228
+
229
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
230
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
231
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
232
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
233
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
234
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
235
+ SOFTWARE.