-
Notifications
You must be signed in to change notification settings - Fork 11
/
bacnet.html
517 lines (479 loc) · 19.8 KB
/
bacnet.html
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
<script type="text/x-red" data-template-name="bacnet-server">
<div class="form-row">
<label for="node-config-input-interface"><i class="icon-bookmark"></i> Interface</label>
<input type="text" id="node-config-input-interface">
</div>
<div class="form-row">
<label for="node-config-input-port"><i class="icon-bookmark"></i> Port</label>
<input type="text" id="node-config-input-port">
</div>
<div class="form-row">
<label for="node-config-input-broadcastAddress"><i class="icon-bookmark"></i> Broadcast Address</label>
<input type="text" id="node-config-input-broadcastAddress">
</div>
<div class="form-row1">
<label for="node-config-input-adpuTimeout"><i class="fa fa-clock-o"></i> Connection Timeout (s)</label>
<input type="text" id="node-config-input-adpuTimeout">
</div>
</script>
<script type="text/x-red" data-help-name="bacnet-server">
<p>To be able to communicate to BACNET devices, you have to initialize a new client instance.</p>
<ul>
<li><code>interface</code> <em>[string]</em> - Specific BACNET communication interface if different from primary one. <em>Optional</em>.</li>
<li><code>port</code> <em>[number]</em> - BACNET communication port for listening and sending. Default is <code>47808</code>. <em>Optional</em>.</li>
<li><code>broadcastAddress</code> <em>[string]</em> - The address used for broadcast messages. Default is <code>255.255.255.255</code>. <em>Optional</em>.</li>
<li><code>adpuTimeout</code> <em>[number]</em> - The timeout in milliseconds until a transaction should be interpreted as error. Default is <code>3000</code>. <em>Optional</em>.</li>
</ul>
</script>
<script type="text/javascript">
RED.nodes.registerType('bacnet-server', {
category: 'config',
defaults: {
interface: {
value: '', required: false
},
port: {
value: 47808,
required: false,
validate: RED.validators.number()
},
broadcastAddress: {
value: '255.255.255.255',
required: false
},
timeout: {
value: 3000,
required: false,
validate: RED.validators.number()
}
},
label: function() {
return 'bacnet@' + this.interface + ':' + this.port;
}
});
</script>
<script type="text/x-red" data-template-name="bacnet-discovery">
<div class="form-row">
<label for="node-input-name"><i class="icon-tag"></i> Name</label>
<input type="text" id="node-input-name" placeholder="Name">
</div>
<div class="form-row">
<label for="node-input-lowLimit"><i class="icon-tag"></i> Low limit</label>
<input type="text" id="node-input-lowLimit" placeholder="Low limit">
</div>
<div class="form-row">
<label for="node-input-highLimit"><i class="icon-tag"></i> High limit</label>
<input type="text" id="node-input-highLimit" placeholder="High limit">
</div>
<div class="form-row">
<label for="node-input-address"><i class="icon-tag"></i> Address</label>
<input type="text" id="node-input-address" placeholder="Address">
</div>
<div class="form-row">
<label for="node-input-server"><i class="icon-globe"></i> Server</label>
<input type="text" id="node-input-server">
</div>
</script>
<script type="text/x-red" data-help-name="bacnet-discovery">
<p>The <code>whoIs</code> command discovers all BACNET devices in the network.</p>
<ul>
<li><code>lowLimit</code> <em>[number]</em> - Minimal device instance number to search for. <em>Optional</em>.</li>
<li><code>highLimit</code> <em>[number]</em> - Maximal device instance number to search for. <em>Optional</em>.</li>
<li><code>address</code> <em>[string]</em> - Unicast address if command should device directly. <em>Optional</em>.</li>
</ul>
<h3>Output <code>message.payload</code></h3>
<dl class="message-properties">
<dt>address <span class="property-type">string</span></dt>
<dd>IP address of the detected device.</dd>
<dt>deviceId <span class="property-type">number</span></dt>
<dd>Bacnet device id.</dd>
<dt>maxAdpu <span class="property-type">number</span></dt>
<dd>Max ADPU size the device is supporting.</dd>
<dt>segmentation <span class="property-type">number</span></dt>
<dd>Type of segmentation the device is supporting.</dd>
<dt>vendorId <span class="property-type">number</span></dt>
<dd>Bacnet vendor id.</dd>
</dl>
</script>
<script type="text/javascript">
RED.nodes.registerType('bacnet-discovery', {
category: 'bacnet',
color: '#E9967A',
defaults: {
name: {
value: ''
},
address: {
value: '',
required: false
},
lowLimit: {
value: '',
required: false,
validate: RED.validators.number()
},
highLimit: {
value: '',
required: false,
validate: RED.validators.number()
},
server: {
value: '',
type: 'bacnet-server'
}
},
inputs: 0,
outputs: 1,
icon: 'automation.gif',
paletteLabel: 'BACnet',
label: function() {
return (this.name || 'BACnet whoIs');
}
});
</script>
<script type="text/x-red" data-template-name="bacnet-read">
<div class="form-row">
<label for="node-input-name"><i class="icon-tag"></i> Name</label>
<input type="text" id="node-input-name" placeholder="Name">
</div>
<div class="form-row">
<label for="node-input-address"><i class="icon-bookmark"></i> Address</label>
<input type="text" id="node-input-address" placeholder="">
</div>
<div class="form-row">
<label for="node-input-objectType"><i class="icon-bookmark"></i> Object Type</label>
<input type="text" id="node-input-objectType" placeholder="">
</div>
<div class="form-row">
<label for="node-input-objectInstance"><i class="icon-bookmark"></i> Object Instance</label>
<input type="text" id="node-input-objectInstance" placeholder="">
</div>
<div class="form-row">
<label for="node-input-propertyId"><i class="icon-bookmark"></i> Property ID</label>
<input type="text" id="node-input-propertyId" placeholder="">
</div>
<div class="form-row">
<label for="node-input-arrayIndex"><i class="icon-bookmark"></i> Array Index</label>
<input type="text" id="node-input-arrayIndex" placeholder="">
</div>
<div class="form-row">
<label for="node-input-server"><i class="icon-globe"></i> Server</label>
<input type="text" id="node-input-server">
</div>
</script>
<script type="text/x-red" data-help-name="bacnet-read">
<p>The <code>readProperty</code> command reads a single property of an object from a device. It accepts an input whose device property will override the properties set here.</p>
<ul>
<li><code>address</code> <em>[string]</em> - IP address of the target device.</li>
<li><code>objectType</code> <em>[number]</em> - The BACNET object type to read.</li>
<li><code>objectInstance</code> <em>[number]</em> - The BACNET object instance to read.</li>
<li><code>propertyId</code> <em>[number]</em> - The BACNET property id in the specified object to read.</li>
<li><code>arrayIndex</code> <em>[number]</em> - The array index of the property to be read.</li>
</ul>
</script>
<script type="text/javascript">
RED.nodes.registerType('bacnet-read', {
category: 'bacnet',
color: '#E9967A',
defaults: {
name: {
value: ''
},
address: {
value: '',
required: false
},
objectType: {
value: '',
required: false,
validate: RED.validators.number()
},
objectInstance: {
value: '',
required: false,
validate: RED.validators.number()
},
propertyId: {
value: '',
required: false,
validate: RED.validators.number()
},
arrayIndex: {
value: undefined
},
server: {
value: '',
type: 'bacnet-server'
}
},
inputs: 1,
outputs: 1,
icon: 'automation.gif',
paletteLabel: 'BACnet read',
label: function() {
return (this.name || 'BACnet read');
}
});
</script>
<script type="text/x-red" data-template-name="bacnet-write">
<div class="form-row">
<label for="node-input-name"><i class="icon-tag"></i> Name</label>
<input type="text" id="node-input-name" placeholder="Name">
</div>
<div class="form-row">
<label for="node-input-address"><i class="icon-bookmark"></i> Address</label>
<input type="text" id="node-input-address" placeholder="Address">
</div>
<div class="form-row">
<label for="node-input-objectType"><i class="icon-bookmark"></i>Object Type</label>
<input type="text" id="node-input-objectType" placeholder="Object Type">
</div>
<div class="form-row">
<label for="node-input-objectInstance"><i class="icon-bookmark"></i>Object Instance</label>
<input type="text" id="node-input-objectInstance" placeholder="Object Instance">
</div>
<div class="form-row">
<label for="node-input-propertyId"><i class="icon-bookmark"></i> Property ID</label>
<input type="text" id="node-input-propertyId" placeholder="Property ID">
</div>
<div class="form-row">
<label for="node-input-priority"><i class="icon-bookmark"></i> Priority</label>
<input type="text" id="node-input-priority" placeholder="Priority">
</div>
<div class="form-row">
<label for="node-input-applicationTag"><i class="fa fa-empire"></i> Value Type</label>
<select id="node-input-applicationTag">
<option value="" disabled selected>Select your option</option>
<option value="0">Null</option>
<option value="1">Boolean</option>
<option value="2">Unsigned Int</option>
<option value="3">Signed Int</option>
<option value="4">Real</option>
<option value="5">Double</option>
<option value="6">Octect String</option>
<option value="7">Character String</option>
<option value="8">Bit String</option>
<option value="9">Enumerated</option>
<option value="10">Date</option>
<option value="11">Time</option>
<option value="12">Object Id</option>
<option value="13">Reserve 1</option>
<option value="14">Reserve 2</option>
<option value="15">Reserve 3</option>
</select>
</div>
<div class="form-row">
<label for="node-config-input-value"><i class="fa fa-empire"></i> Value</label>
<input type="text" id="node-input-value" placeholder="Value">
</div>
<div class="form-row">
<label for="node-input-server"><i class="icon-globe"></i> Server</label>
<input type="text" id="node-input-server">
</div>
</script>
<script type="text/x-red" data-help-name="bacnet-write">
<p>The <code>writeProperty</code> command writes a single property of an object to a device. It accepts an input whose payload will override the properties set here.</p>
<ul>
<li><code>address</code> <em>[string]</em> - IP address of the target device.</li>
<li><code>objectType</code> <em>[number]</em> - The BACNET object type to write.</li>
<li><code>objectInstance</code> <em>[number]</em> - IP address of the target device.</li>
<li><code>propertyId</code> <em>[number]</em> - The BACNET property id in the specified object to write.</li>
<li><code>priority</code> <em>[number]</em> - The priority to be used for writing to the property.</li>
<li><code>valueList</code> <em>[array]</em> - A list of values to be written to the speicifed property. The <code>Tag</code> value has to be a <code>BacnetApplicationTags</code> declaration as specified in <code>lib/bacnet-enum.js</code>.</li>
</ul>
</script>
<script type="text/javascript">
RED.nodes.registerType('bacnet-write', {
category: 'bacnet',
color: '#E9967A',
defaults: {
name: {
value: ''
},
address: {
value: '',
required: false
},
objectType: {
value: '',
required: false,
validate: RED.validators.number()
},
objectInstance: {
value: '',
required: false,
validate: RED.validators.number()
},
propertyId: {
value: '',
required: false,
validate: RED.validators.number()
},
priority: {
value: '',
validate: RED.validators.number()
},
applicationTag: {
value: ''
},
value: {
value: '',
required: false
},
server: {
value: '',
type: 'bacnet-server'
}
},
inputs: 1,
outputs: 1,
icon: 'automation.gif',
paletteLabel: 'BACnet write',
label: function() {
return (this.name || 'BACnet write');
}
});
</script>
<script type="text/x-red" data-template-name="bacnet-read-multiple">
<div class="form-row">
<label for="node-input-name"><i class="icon-tag"></i> Name</label>
<input type="text" id="node-input-name" placeholder="Name">
</div>
<div class="form-row">
<label for="node-input-address"><i class="icon-bookmark"></i> Address</label>
<input type="text" id="node-input-address" placeholder="">
</div>
<div class="form-row">
<label for="node-input-server"><i class="icon-globe"></i> Server</label>
<input type="text" id="node-input-server">
</div>
</script>
<script type="text/x-red" data-help-name="bacnet-read-multiple">
<p>The <code>readPropertyMultiple</code> command reads multiple properties from multiple device objects. It accepts address which can be override by input.</p>
<p>This node expects input to provide <code>requestyArray</code> property with the target read fields.</p>
<h3><code>requestArray</code></h3>
<dl class="message-properties">
<dt>objectIdentifier <span class="property-type">object</span></dt>
<dd>
<span>Specific object to read.</span>
<dl class="message-properties">
<dt>type <span class="property-type">number</span></dt>
<dd>Bacnet object type to read</dd>
<dt>instance <span class="property-type">number</span></dt>
<dd>Bacnet object instance to read.</dd>
</dl>
</dd>
<dt>propertyReferences <span class="property-type">Array<object></span></dt>
<dd>
<span>List of properties to read.</span>
<dl class="message-properties">
<dt>propertyIdentifier <span class="property-type">number</span></dt>
<dd>Bacnet property id to read. Supports 8 for all properties.</dd>
</dl>
</dd>
</dl>
</script>
<script type="text/javascript">
RED.nodes.registerType('bacnet-read-multiple', {
category: 'bacnet',
color: '#E9967A',
defaults: {
address: {
value: '',
required: false
},
server: {
value: '',
type: 'bacnet-server'
}
},
inputs: 1,
outputs: 1,
icon: 'automation.gif',
paletteLabel: 'BACnet read multiple',
label: function() {
return (this.name || 'BACnet read multiple');
}
});
</script>
<script type="text/x-red" data-template-name="bacnet-write-multiple">
<div class="form-row">
<label for="node-input-name"><i class="icon-tag"></i> Name</label>
<input type="text" id="node-input-name" placeholder="Name">
</div>
<div class="form-row">
<label for="node-input-address"><i class="icon-bookmark"></i> Address</label>
<input type="text" id="node-input-address" placeholder="">
</div>
<div class="form-row">
<label for="node-input-server"><i class="icon-globe"></i> Server</label>
<input type="text" id="node-input-server">
</div>
</script>
<script type="text/x-red" data-help-name="bacnet-write-multiple">
<p>The <code>writePropertyMultiple</code> command writes multiple properties to multiple device objects. It accepts address which can be override by input.</p>
<p>This node expects input to provide <code>valueList</code> property with the target write fields.</p>
<h3><code>valueList</code></h3>
<dl class="message-properties">
<dt>objectIdentifier <span class="property-type">object</span></dt>
<dd>
<span>Specific object to read.</span>
<dl class="message-properties">
<dt>type <span class="property-type">number</span></dt>
<dd>Bacnet object type to read</dd>
<dt>instance <span class="property-type">number</span></dt>
<dd>Bacnet object instance to read.</dd>
</dl>
</dd>
<dt>values <span class="property-type">Array<object></span></dt>
<dd>
<span>List of properties to be written.</span>
<dl class="message-properties">
<dt>property <span class="property-type">object</span></dt>
<dd>
<dl class="message-properties">
<dt>propertyIdentifier <span class="property-type">number</span></dt>
<dd>Bacnet property id to write.</dd>
<dt>propertyArrayIndex <span class="property-type">number</span></dt>
<dd>Array index of property to write.</dd>
</dl>
</dd>
<dt>value <span class="property-type">Array<object></span></dt>
<dd>
<span>List of values to be written to the specified property.</span>
<dl class="message-properties">
<dt>type <span class="property-type">number</span></dt>
<dd>Data type of value to write.</dd>
<dt>value <span class="property-type">any</span></dt>
<dd>Actual value to write.</dd>
</dl>
</dd>
<dt>priority <span class="property-type">number</span></dt>
<dd>Priority used for writing to property.</dd>
</dl>
</dd>
</dl>
</script>
<script type="text/javascript">
RED.nodes.registerType('bacnet-write-multiple', {
category: 'bacnet',
color: '#E9967A',
defaults: {
address: {
value: '',
required: false
},
server: {
value: '',
type: 'bacnet-server'
}
},
inputs: 1,
outputs: 1,
icon: 'automation.gif',
paletteLabel: 'BACnet write multiple',
label: function() {
return (this.name || 'BACnet write multiple');
}
});
</script>