@halsystems/red-bacnet 1.1.5 → 1.2.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
CHANGED
|
@@ -1,6 +1,10 @@
|
|
|
1
1
|
# Changelog
|
|
2
2
|
|
|
3
|
-
## [1.
|
|
3
|
+
## [1.2.0]
|
|
4
|
+
### Added
|
|
5
|
+
- DiscoverPoint and ReadPoint added concurrentTaskDelay config to control delay between concurrent tasks
|
|
6
|
+
|
|
7
|
+
## [1.1.5]
|
|
4
8
|
### Change
|
|
5
9
|
- ReadPoint to not add device to task queue if no points attached to device
|
|
6
10
|
|
package/common/bacnet.js
CHANGED
|
@@ -568,19 +568,26 @@ module.exports = {
|
|
|
568
568
|
}
|
|
569
569
|
|
|
570
570
|
return new Promise((resolve, reject) => {
|
|
571
|
+
// Build options only if priority is provided
|
|
572
|
+
const options = {};
|
|
573
|
+
if (priority !== null && priority !== undefined) {
|
|
574
|
+
options.priority = priority;
|
|
575
|
+
}
|
|
576
|
+
|
|
571
577
|
client.writeProperty(
|
|
572
578
|
addressSet,
|
|
573
579
|
objectId,
|
|
574
580
|
propertyId,
|
|
575
581
|
writeValue,
|
|
576
|
-
|
|
582
|
+
options, // may be empty if no priority
|
|
577
583
|
(err) => {
|
|
578
584
|
if (err) {
|
|
579
585
|
reject(err);
|
|
580
|
-
}
|
|
581
|
-
else
|
|
586
|
+
} else {
|
|
582
587
|
resolve(true);
|
|
583
|
-
|
|
588
|
+
}
|
|
589
|
+
}
|
|
590
|
+
);
|
|
584
591
|
});
|
|
585
592
|
},
|
|
586
593
|
}
|
package/package.json
CHANGED
|
@@ -10,6 +10,7 @@
|
|
|
10
10
|
groupExportDeviceCount: { value: 30000, required: true, validate: RED.validators.number() },
|
|
11
11
|
maxConcurrentDeviceRead: { value: 3, required: true, validate: RED.validators.number() },
|
|
12
12
|
maxConcurrentSinglePointRead: { value: 10, required: true, validate: RED.validators.number() },
|
|
13
|
+
concurrentTaskDelay: { value: 10, required: true, validate: RED.validators.number() },
|
|
13
14
|
},
|
|
14
15
|
inputs: 1,
|
|
15
16
|
outputs: 1,
|
|
@@ -57,6 +58,10 @@
|
|
|
57
58
|
<label for="node-input-maxConcurrentSinglePointRead"><i class="fa fa-tag"></i> Max Concurrent Single Point Read</label>
|
|
58
59
|
<input type="number" id="node-input-maxConcurrentSinglePointRead" placeholder="10" , min="1" , max="1000">
|
|
59
60
|
</div>
|
|
61
|
+
<div class="form-row">
|
|
62
|
+
<label for="node-input-concurrentTaskDelay"><i class="fa fa-tag"></i> Concurrent Task Delay (ms)</label>
|
|
63
|
+
<input type="number" id="node-input-concurrentTaskDelay" placeholder="10" min="0" max="10000">
|
|
64
|
+
</div>
|
|
60
65
|
</script>
|
|
61
66
|
|
|
62
67
|
<script type="text/html" data-help-name="discover point">
|
|
@@ -86,6 +91,9 @@
|
|
|
86
91
|
<dt>maxConcurrentSinglePointRead<span class="property-type">number</span></dt>
|
|
87
92
|
<dd> Number of points to read simultaneously when using <code>readProperty</code> mode</dd>
|
|
88
93
|
<dd> <b>USE WITH CAUTION!</b> Reduce to low value if field BACnet device is underpowered</dd>
|
|
94
|
+
|
|
95
|
+
<dt>concurrentTaskDelay<span class="property-type">number</span></dt>
|
|
96
|
+
<dd> Delay in milliseconds between device reading</dd>
|
|
89
97
|
</dl>
|
|
90
98
|
|
|
91
99
|
<h3>Inputs</h3>
|
|
@@ -105,4 +113,4 @@
|
|
|
105
113
|
<h3>Details</h3>
|
|
106
114
|
<p>If node is triggered while existing job is running, new job will be coalesced if <code>msg.id</code> are identical, else new job will be put in queue until current job is completed.</p>
|
|
107
115
|
|
|
108
|
-
</script>
|
|
116
|
+
</script>
|
|
@@ -25,6 +25,7 @@ module.exports = function (RED) {
|
|
|
25
25
|
this.groupExportDeviceCount = +config.groupExportDeviceCount
|
|
26
26
|
this.maxConcurrentDeviceRead = +config.maxConcurrentDeviceRead
|
|
27
27
|
this.maxConcurrentSinglePointRead = +config.maxConcurrentSinglePointRead
|
|
28
|
+
this.concurrentTaskDelay = +config.concurrentTaskDelay
|
|
28
29
|
|
|
29
30
|
// events
|
|
30
31
|
this.#subscribeListeners();
|
|
@@ -43,7 +44,7 @@ module.exports = function (RED) {
|
|
|
43
44
|
const task = new DiscoverPointJob(
|
|
44
45
|
this.client, this.#eventEmitter, msg?.devices, this.discoverMode, this.readMethod,
|
|
45
46
|
this.groupExportDeviceCount, this.maxConcurrentDeviceRead,
|
|
46
|
-
this.maxConcurrentSinglePointRead
|
|
47
|
+
this.maxConcurrentSinglePointRead, this.concurrentTaskDelay
|
|
47
48
|
);
|
|
48
49
|
|
|
49
50
|
this.job.addJob({
|
|
@@ -79,4 +80,3 @@ module.exports = function (RED) {
|
|
|
79
80
|
// ----- register node -----
|
|
80
81
|
RED.nodes.registerType('discover point', DiscoverPoint);
|
|
81
82
|
}
|
|
82
|
-
|
|
@@ -8,6 +8,7 @@
|
|
|
8
8
|
readMethod: { value: 1, required: true, validate: RED.validators.number() },
|
|
9
9
|
maxConcurrentDeviceRead: { value: 3, required: true, validate: RED.validators.number() },
|
|
10
10
|
maxConcurrentSinglePointRead: { value: 10, required: true, validate: RED.validators.number() },
|
|
11
|
+
concurrentTaskDelay: { value: 10, required: true, validate: RED.validators.number() },
|
|
11
12
|
},
|
|
12
13
|
inputs: 1,
|
|
13
14
|
outputs: 1,
|
|
@@ -45,6 +46,10 @@
|
|
|
45
46
|
Read</label>
|
|
46
47
|
<input type="number" id="node-input-maxConcurrentSinglePointRead" placeholder="10" , min="1" , max="1000">
|
|
47
48
|
</div>
|
|
49
|
+
<div class="form-row">
|
|
50
|
+
<label for="node-input-concurrentTaskDelay"><i class="fa fa-tag"></i> Concurrent Task Delay (ms)</label>
|
|
51
|
+
<input type="number" id="node-input-concurrentTaskDelay" placeholder="10" , min="0" , max="10000">
|
|
52
|
+
</div>
|
|
48
53
|
</script>
|
|
49
54
|
|
|
50
55
|
<script type="text/html" data-help-name="read point">
|
|
@@ -68,6 +73,11 @@
|
|
|
68
73
|
<dt>maxConcurrentSinglePointRead<span class="property-type">number</span></dt>
|
|
69
74
|
<dd> Number of points to read simultaneously when using <code>readProperty</code> mode</dd>
|
|
70
75
|
<dd> <b>USE WITH CAUTION!</b> Reduce to low value if field BACnet device is underpowered</dd>
|
|
76
|
+
</dd>
|
|
77
|
+
|
|
78
|
+
<dt>concurrentTaskDelay<span class="property-type">number</span></dt>
|
|
79
|
+
<dd> Delay in milliseconds between reading points from different devices</dd>
|
|
80
|
+
<dd> <b>USE WITH CAUTION!</b> Increase value on slow or congested networks</dd>
|
|
71
81
|
</dl>
|
|
72
82
|
</dl>
|
|
73
83
|
|
|
@@ -91,4 +101,4 @@
|
|
|
91
101
|
|
|
92
102
|
<h3>Details</h3>
|
|
93
103
|
<p>If node is triggered while existing job is running, new job will be coalesced if <code>msg.id</code> are identical, else new job will be put in queue until current job is completed.</p>
|
|
94
|
-
</script>
|
|
104
|
+
</script>
|
package/red-bacnet/read_point.js
CHANGED
|
@@ -24,6 +24,7 @@ module.exports = function (RED) {
|
|
|
24
24
|
this.readMethod = +config.readMethod
|
|
25
25
|
this.maxConcurrentDeviceRead = +config.maxConcurrentDeviceRead
|
|
26
26
|
this.maxConcurrentSinglePointRead = +config.maxConcurrentSinglePointRead
|
|
27
|
+
this.concurrentTaskDelay = +config.concurrentTaskDelay
|
|
27
28
|
|
|
28
29
|
// events
|
|
29
30
|
this.#subscribeListeners();
|
|
@@ -46,7 +47,8 @@ module.exports = function (RED) {
|
|
|
46
47
|
msg.points,
|
|
47
48
|
this.readMethod,
|
|
48
49
|
this.maxConcurrentDeviceRead,
|
|
49
|
-
this.maxConcurrentSinglePointRead
|
|
50
|
+
this.maxConcurrentSinglePointRead,
|
|
51
|
+
this.concurrentTaskDelay
|
|
50
52
|
);
|
|
51
53
|
|
|
52
54
|
this.job.addJob({
|
|
@@ -82,4 +84,3 @@ module.exports = function (RED) {
|
|
|
82
84
|
// ----- register node -----
|
|
83
85
|
RED.nodes.registerType('read point', ReadPoint);
|
|
84
86
|
}
|
|
85
|
-
|