forked from goliatone/node-red-contrib-bacnet
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathbacnet.html
360 lines (330 loc) · 13.3 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
<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>
<p>
<ul>
<li><code>option</code> <em>[object]</em> - The options object used for parameterising the bacstack.
<ul>
<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>interface</code> <em>[string]</em> - Specific BACNET communication interface if different from primary one. <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>
</li>
</ul>
</p>
</script>
<script type="text/javascript">
RED.nodes.registerType('bacnet-server', {
category: 'config',
defaults: {
interface: {
value: '', required: true
},
port: {
value: 47808,
required: true,
validate: RED.validators.number()
},
broadcastAddress: {
value: '255.255.255.255',
required: true
},
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>
</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.</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: true
},
objectType: {
value: '',
required: true,
validate: RED.validators.number()
},
objectInstance: {
value: '',
required: true,
validate: RED.validators.number()
},
propertyId: {
value: '',
required: true,
validate: RED.validators.number()
},
arrayIndex: {
value: undefined
},
server: {
value: '',
type: 'bacnet-server'
}
},
inputs: 0,
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> 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> 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.</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: true
},
objectType: {
value: '',
required: true,
validate: RED.validators.number()
},
objectInstance: {
value: '',
required: true,
validate: RED.validators.number()
},
propertyId: {
value: '',
required: true,
validate: RED.validators.number()
},
priority: {
value: '',
validate: RED.validators.number()
},
applicationTag: {
value: ''
},
value: {
value: '',
required: true
},
server: {
value: '',
type: 'bacnet-server'
}
},
inputs: 0,
outputs: 1,
align: 'right',
// icon: 'automation.gif',
paletteLabel: 'BACnet write',
label: function() {
return (this.name || 'BACnet write');
}
});
</script>