@zaber/motion 6.3.0 → 6.4.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/dist/binding/wasm/zaber-motion-lib.wasm +0 -0
- package/dist/lib/ascii/device_io.d.ts +72 -72
- package/dist/lib/ascii/device_io.d.ts.map +1 -1
- package/dist/lib/ascii/device_io.js +176 -176
- package/dist/lib/ascii/device_io.js.map +1 -1
- package/dist/lib/ascii/index.d.ts +2 -0
- package/dist/lib/ascii/index.d.ts.map +1 -1
- package/dist/lib/ascii/index.js +2 -0
- package/dist/lib/ascii/index.js.map +1 -1
- package/dist/lib/ascii/pvt_io.d.ts +100 -0
- package/dist/lib/ascii/pvt_io.d.ts.map +1 -0
- package/dist/lib/ascii/pvt_io.js +318 -0
- package/dist/lib/ascii/pvt_io.js.map +1 -0
- package/dist/lib/ascii/pvt_sequence.d.ts +36 -24
- package/dist/lib/ascii/pvt_sequence.d.ts.map +1 -1
- package/dist/lib/ascii/pvt_sequence.js +92 -78
- package/dist/lib/ascii/pvt_sequence.js.map +1 -1
- package/dist/lib/ascii/stream.d.ts +55 -39
- package/dist/lib/ascii/stream.d.ts.map +1 -1
- package/dist/lib/ascii/stream.js +134 -116
- package/dist/lib/ascii/stream.js.map +1 -1
- package/dist/lib/ascii/stream_io.d.ts +115 -0
- package/dist/lib/ascii/stream_io.d.ts.map +1 -0
- package/dist/lib/ascii/stream_io.js +348 -0
- package/dist/lib/ascii/stream_io.js.map +1 -0
- package/dist/lib/library.js +1 -1
- package/dist/lib/library.js.map +1 -1
- package/dist/lib/requests/index.d.ts +6 -0
- package/dist/lib/requests/index.d.ts.map +1 -1
- package/dist/lib/requests/index.js +6 -0
- package/dist/lib/requests/index.js.map +1 -1
- package/dist/lib/requests/stream_cancel_all_outputs_schedule_request.d.ts +15 -0
- package/dist/lib/requests/stream_cancel_all_outputs_schedule_request.d.ts.map +1 -0
- package/dist/lib/requests/stream_cancel_all_outputs_schedule_request.js +36 -0
- package/dist/lib/requests/stream_cancel_all_outputs_schedule_request.js.map +1 -0
- package/dist/lib/requests/stream_cancel_output_schedule_request.d.ts +15 -0
- package/dist/lib/requests/stream_cancel_output_schedule_request.d.ts.map +1 -0
- package/dist/lib/requests/stream_cancel_output_schedule_request.js +35 -0
- package/dist/lib/requests/stream_cancel_output_schedule_request.js.map +1 -0
- package/dist/lib/requests/stream_set_all_analog_outputs_schedule_request.d.ts +18 -0
- package/dist/lib/requests/stream_set_all_analog_outputs_schedule_request.d.ts.map +1 -0
- package/dist/lib/requests/stream_set_all_analog_outputs_schedule_request.js +41 -0
- package/dist/lib/requests/stream_set_all_analog_outputs_schedule_request.js.map +1 -0
- package/dist/lib/requests/stream_set_all_digital_outputs_schedule_request.d.ts +19 -0
- package/dist/lib/requests/stream_set_all_digital_outputs_schedule_request.d.ts.map +1 -0
- package/dist/lib/requests/stream_set_all_digital_outputs_schedule_request.js +42 -0
- package/dist/lib/requests/stream_set_all_digital_outputs_schedule_request.js.map +1 -0
- package/dist/lib/requests/stream_set_analog_output_schedule_request.d.ts +19 -0
- package/dist/lib/requests/stream_set_analog_output_schedule_request.d.ts.map +1 -0
- package/dist/lib/requests/stream_set_analog_output_schedule_request.js +42 -0
- package/dist/lib/requests/stream_set_analog_output_schedule_request.js.map +1 -0
- package/dist/lib/requests/stream_set_digital_output_schedule_request.d.ts +20 -0
- package/dist/lib/requests/stream_set_digital_output_schedule_request.d.ts.map +1 -0
- package/dist/lib/requests/stream_set_digital_output_schedule_request.js +43 -0
- package/dist/lib/requests/stream_set_digital_output_schedule_request.js.map +1 -0
- package/package.json +1 -1
|
@@ -38,72 +38,77 @@ class DeviceIO {
|
|
|
38
38
|
this._device = device;
|
|
39
39
|
}
|
|
40
40
|
/**
|
|
41
|
-
* Returns the
|
|
42
|
-
* @returns
|
|
41
|
+
* Returns the number of I/O channels the device has.
|
|
42
|
+
* @returns An object containing the number of I/O channels the device has.
|
|
43
43
|
*/
|
|
44
|
-
async
|
|
44
|
+
async getChannelsInfo() {
|
|
45
45
|
const request = {
|
|
46
|
-
...requests.
|
|
46
|
+
...requests.DeviceEmptyRequest.DEFAULT,
|
|
47
47
|
interfaceId: this._device.connection.interfaceId,
|
|
48
48
|
device: this._device.deviceAddress,
|
|
49
|
-
channelType: 'di',
|
|
50
49
|
toBinary() {
|
|
51
|
-
return requests.
|
|
50
|
+
return requests.DeviceEmptyRequest.toBinary(this);
|
|
52
51
|
},
|
|
53
52
|
};
|
|
54
|
-
const response = await gateway.callAsync('device/
|
|
55
|
-
return response
|
|
53
|
+
const response = await gateway.callAsync('device/get_io_info', request, device_io_info_1.DeviceIOInfo.fromBinary);
|
|
54
|
+
return response;
|
|
56
55
|
}
|
|
57
56
|
/**
|
|
58
|
-
*
|
|
59
|
-
* @
|
|
57
|
+
* Sets the label of the specified channel.
|
|
58
|
+
* @param portType The type of channel to set the label of.
|
|
59
|
+
* @param channelNumber Channel number starting at 1.
|
|
60
|
+
* @param label The label to set for the specified channel.
|
|
61
|
+
* If no value or an empty string is provided, this label is deleted.
|
|
60
62
|
*/
|
|
61
|
-
async
|
|
63
|
+
async setLabel(portType, channelNumber, label) {
|
|
62
64
|
const request = {
|
|
63
|
-
...requests.
|
|
65
|
+
...requests.SetIoPortLabelRequest.DEFAULT,
|
|
64
66
|
interfaceId: this._device.connection.interfaceId,
|
|
65
67
|
device: this._device.deviceAddress,
|
|
66
|
-
|
|
68
|
+
portType: portType,
|
|
69
|
+
channelNumber: channelNumber,
|
|
70
|
+
label: label,
|
|
67
71
|
toBinary() {
|
|
68
|
-
return requests.
|
|
72
|
+
return requests.SetIoPortLabelRequest.toBinary(this);
|
|
69
73
|
},
|
|
70
74
|
};
|
|
71
|
-
|
|
72
|
-
return response.values;
|
|
75
|
+
await gateway.callAsync('device/set_io_label', request);
|
|
73
76
|
}
|
|
74
77
|
/**
|
|
75
|
-
* Returns the
|
|
76
|
-
* @
|
|
78
|
+
* Returns the label of the specified channel.
|
|
79
|
+
* @param portType The type of channel to get the label of.
|
|
80
|
+
* @param channelNumber Channel number starting at 1.
|
|
81
|
+
* @returns The label of the specified channel.
|
|
77
82
|
*/
|
|
78
|
-
async
|
|
83
|
+
async getLabel(portType, channelNumber) {
|
|
79
84
|
const request = {
|
|
80
|
-
...requests.
|
|
85
|
+
...requests.GetIoPortLabelRequest.DEFAULT,
|
|
81
86
|
interfaceId: this._device.connection.interfaceId,
|
|
82
87
|
device: this._device.deviceAddress,
|
|
83
|
-
|
|
88
|
+
portType: portType,
|
|
89
|
+
channelNumber: channelNumber,
|
|
84
90
|
toBinary() {
|
|
85
|
-
return requests.
|
|
91
|
+
return requests.GetIoPortLabelRequest.toBinary(this);
|
|
86
92
|
},
|
|
87
93
|
};
|
|
88
|
-
const response = await gateway.callAsync('device/
|
|
89
|
-
return response.
|
|
94
|
+
const response = await gateway.callAsync('device/get_io_label', request, requests.StringResponse.fromBinary);
|
|
95
|
+
return response.value;
|
|
90
96
|
}
|
|
91
97
|
/**
|
|
92
|
-
* Returns
|
|
93
|
-
* @returns
|
|
98
|
+
* Returns every label assigned to an IO port on this device.
|
|
99
|
+
* @returns The labels set for this device's IO.
|
|
94
100
|
*/
|
|
95
|
-
async
|
|
101
|
+
async getAllLabels() {
|
|
96
102
|
const request = {
|
|
97
|
-
...requests.
|
|
103
|
+
...requests.DeviceEmptyRequest.DEFAULT,
|
|
98
104
|
interfaceId: this._device.connection.interfaceId,
|
|
99
105
|
device: this._device.deviceAddress,
|
|
100
|
-
channelType: 'ao',
|
|
101
106
|
toBinary() {
|
|
102
|
-
return requests.
|
|
107
|
+
return requests.DeviceEmptyRequest.toBinary(this);
|
|
103
108
|
},
|
|
104
109
|
};
|
|
105
|
-
const response = await gateway.callAsync('device/
|
|
106
|
-
return response.
|
|
110
|
+
const response = await gateway.callAsync('device/get_all_io_labels', request, requests.GetAllIoPortLabelsResponse.fromBinary);
|
|
111
|
+
return response.labels;
|
|
107
112
|
}
|
|
108
113
|
/**
|
|
109
114
|
* Returns the current value of the specified digital input channel.
|
|
@@ -182,146 +187,106 @@ class DeviceIO {
|
|
|
182
187
|
return response.value;
|
|
183
188
|
}
|
|
184
189
|
/**
|
|
185
|
-
*
|
|
186
|
-
* @
|
|
190
|
+
* Returns the current values of all digital input channels.
|
|
191
|
+
* @returns True if voltage is present on the input channel and false otherwise.
|
|
187
192
|
*/
|
|
188
|
-
async
|
|
193
|
+
async getAllDigitalInputs() {
|
|
189
194
|
const request = {
|
|
190
|
-
...requests.
|
|
195
|
+
...requests.DeviceGetAllDigitalIORequest.DEFAULT,
|
|
191
196
|
interfaceId: this._device.connection.interfaceId,
|
|
192
197
|
device: this._device.deviceAddress,
|
|
193
|
-
|
|
198
|
+
channelType: 'di',
|
|
194
199
|
toBinary() {
|
|
195
|
-
return requests.
|
|
200
|
+
return requests.DeviceGetAllDigitalIORequest.toBinary(this);
|
|
196
201
|
},
|
|
197
202
|
};
|
|
198
|
-
await gateway.callAsync('device/
|
|
203
|
+
const response = await gateway.callAsync('device/get_all_digital_io', request, requests.DeviceGetAllDigitalIOResponse.fromBinary);
|
|
204
|
+
return response.values;
|
|
199
205
|
}
|
|
200
206
|
/**
|
|
201
|
-
*
|
|
202
|
-
*
|
|
203
|
-
* @param values The type of actions to perform immediately on output channels.
|
|
204
|
-
* @param futureValues The type of actions to perform in the future on output channels.
|
|
205
|
-
* @param delay Delay between setting current values and setting future values.
|
|
206
|
-
* @param [unit=Units.NATIVE] Units of time.
|
|
207
|
+
* Returns the current values of all digital output channels.
|
|
208
|
+
* @returns True if the output channel is conducting and false otherwise.
|
|
207
209
|
*/
|
|
208
|
-
async
|
|
209
|
-
if (delay <= 0) {
|
|
210
|
-
throw new TypeError('Delay must be a positive value.');
|
|
211
|
-
}
|
|
210
|
+
async getAllDigitalOutputs() {
|
|
212
211
|
const request = {
|
|
213
|
-
...requests.
|
|
212
|
+
...requests.DeviceGetAllDigitalIORequest.DEFAULT,
|
|
214
213
|
interfaceId: this._device.connection.interfaceId,
|
|
215
214
|
device: this._device.deviceAddress,
|
|
216
|
-
|
|
217
|
-
futureValues: futureValues,
|
|
218
|
-
delay: delay,
|
|
219
|
-
unit: unit,
|
|
215
|
+
channelType: 'do',
|
|
220
216
|
toBinary() {
|
|
221
|
-
return requests.
|
|
217
|
+
return requests.DeviceGetAllDigitalIORequest.toBinary(this);
|
|
222
218
|
},
|
|
223
219
|
};
|
|
224
|
-
await gateway.callAsync('device/
|
|
220
|
+
const response = await gateway.callAsync('device/get_all_digital_io', request, requests.DeviceGetAllDigitalIOResponse.fromBinary);
|
|
221
|
+
return response.values;
|
|
225
222
|
}
|
|
226
223
|
/**
|
|
227
|
-
*
|
|
228
|
-
*
|
|
229
|
-
* @param [channels=[]] Optionally specify which channels to cancel.
|
|
230
|
-
* Array length must be empty or equal to the number of channels on device.
|
|
231
|
-
* Specifying "True" for a channel will cancel the scheduled digital output action for that channel.
|
|
224
|
+
* Returns the current values of all analog input channels.
|
|
225
|
+
* @returns Measurements of the voltage present on the input channels.
|
|
232
226
|
*/
|
|
233
|
-
async
|
|
227
|
+
async getAllAnalogInputs() {
|
|
234
228
|
const request = {
|
|
235
|
-
...requests.
|
|
229
|
+
...requests.DeviceGetAllAnalogIORequest.DEFAULT,
|
|
236
230
|
interfaceId: this._device.connection.interfaceId,
|
|
237
231
|
device: this._device.deviceAddress,
|
|
238
|
-
|
|
239
|
-
channels: channels,
|
|
232
|
+
channelType: 'ai',
|
|
240
233
|
toBinary() {
|
|
241
|
-
return requests.
|
|
234
|
+
return requests.DeviceGetAllAnalogIORequest.toBinary(this);
|
|
242
235
|
},
|
|
243
236
|
};
|
|
244
|
-
await gateway.callAsync('device/
|
|
237
|
+
const response = await gateway.callAsync('device/get_all_analog_io', request, requests.DeviceGetAllAnalogIOResponse.fromBinary);
|
|
238
|
+
return response.values;
|
|
245
239
|
}
|
|
246
240
|
/**
|
|
247
|
-
*
|
|
248
|
-
*
|
|
249
|
-
* @param [channels=[]] Optionally specify which channels to cancel.
|
|
250
|
-
* Array length must be empty or equal to the number of channels on device.
|
|
251
|
-
* Specifying "True" for a channel will cancel the scheduled analog output value for that channel.
|
|
241
|
+
* Returns the current values of all analog output channels.
|
|
242
|
+
* @returns Measurements of voltage that the output channels are conducting.
|
|
252
243
|
*/
|
|
253
|
-
async
|
|
244
|
+
async getAllAnalogOutputs() {
|
|
254
245
|
const request = {
|
|
255
|
-
...requests.
|
|
246
|
+
...requests.DeviceGetAllAnalogIORequest.DEFAULT,
|
|
256
247
|
interfaceId: this._device.connection.interfaceId,
|
|
257
248
|
device: this._device.deviceAddress,
|
|
258
|
-
|
|
259
|
-
channels: channels,
|
|
249
|
+
channelType: 'ao',
|
|
260
250
|
toBinary() {
|
|
261
|
-
return requests.
|
|
251
|
+
return requests.DeviceGetAllAnalogIORequest.toBinary(this);
|
|
262
252
|
},
|
|
263
253
|
};
|
|
264
|
-
await gateway.callAsync('device/
|
|
254
|
+
const response = await gateway.callAsync('device/get_all_analog_io', request, requests.DeviceGetAllAnalogIOResponse.fromBinary);
|
|
255
|
+
return response.values;
|
|
265
256
|
}
|
|
266
257
|
/**
|
|
267
|
-
* Sets
|
|
268
|
-
* @param
|
|
258
|
+
* Sets value for the specified digital output channel.
|
|
259
|
+
* @param channelNumber Channel number starting at 1.
|
|
260
|
+
* @param value The type of action to perform on the channel.
|
|
269
261
|
*/
|
|
270
|
-
async
|
|
262
|
+
async setDigitalOutput(channelNumber, value) {
|
|
271
263
|
const request = {
|
|
272
|
-
...requests.
|
|
264
|
+
...requests.DeviceSetDigitalOutputRequest.DEFAULT,
|
|
273
265
|
interfaceId: this._device.connection.interfaceId,
|
|
274
266
|
device: this._device.deviceAddress,
|
|
275
|
-
|
|
267
|
+
channelNumber: channelNumber,
|
|
268
|
+
value: value,
|
|
276
269
|
toBinary() {
|
|
277
|
-
return requests.
|
|
270
|
+
return requests.DeviceSetDigitalOutputRequest.toBinary(this);
|
|
278
271
|
},
|
|
279
272
|
};
|
|
280
|
-
await gateway.callAsync('device/
|
|
273
|
+
await gateway.callAsync('device/set_digital_output', request);
|
|
281
274
|
}
|
|
282
275
|
/**
|
|
283
|
-
* Sets
|
|
284
|
-
*
|
|
285
|
-
* @param values Voltage values to set the output channels to immediately.
|
|
286
|
-
* @param futureValues Voltage values to set the output channels to in the future.
|
|
287
|
-
* @param delay Delay between setting current values and setting future values.
|
|
288
|
-
* @param [unit=Units.NATIVE] Units of time.
|
|
276
|
+
* Sets values for all digital output channels.
|
|
277
|
+
* @param values The type of action to perform on the channel.
|
|
289
278
|
*/
|
|
290
|
-
async
|
|
291
|
-
if (delay <= 0) {
|
|
292
|
-
throw new TypeError('Delay must be a positive value.');
|
|
293
|
-
}
|
|
279
|
+
async setAllDigitalOutputs(values) {
|
|
294
280
|
const request = {
|
|
295
|
-
...requests.
|
|
281
|
+
...requests.DeviceSetAllDigitalOutputsRequest.DEFAULT,
|
|
296
282
|
interfaceId: this._device.connection.interfaceId,
|
|
297
283
|
device: this._device.deviceAddress,
|
|
298
284
|
values: values,
|
|
299
|
-
futureValues: futureValues,
|
|
300
|
-
delay: delay,
|
|
301
|
-
unit: unit,
|
|
302
|
-
toBinary() {
|
|
303
|
-
return requests.DeviceSetAllAnalogOutputsScheduleRequest.toBinary(this);
|
|
304
|
-
},
|
|
305
|
-
};
|
|
306
|
-
await gateway.callAsync('device/set_all_analog_outputs_schedule', request);
|
|
307
|
-
}
|
|
308
|
-
/**
|
|
309
|
-
* Sets value for the specified digital output channel.
|
|
310
|
-
* @param channelNumber Channel number starting at 1.
|
|
311
|
-
* @param value The type of action to perform on the channel.
|
|
312
|
-
*/
|
|
313
|
-
async setDigitalOutput(channelNumber, value) {
|
|
314
|
-
const request = {
|
|
315
|
-
...requests.DeviceSetDigitalOutputRequest.DEFAULT,
|
|
316
|
-
interfaceId: this._device.connection.interfaceId,
|
|
317
|
-
device: this._device.deviceAddress,
|
|
318
|
-
channelNumber: channelNumber,
|
|
319
|
-
value: value,
|
|
320
285
|
toBinary() {
|
|
321
|
-
return requests.
|
|
286
|
+
return requests.DeviceSetAllDigitalOutputsRequest.toBinary(this);
|
|
322
287
|
},
|
|
323
288
|
};
|
|
324
|
-
await gateway.callAsync('device/
|
|
289
|
+
await gateway.callAsync('device/set_all_digital_outputs', request);
|
|
325
290
|
}
|
|
326
291
|
/**
|
|
327
292
|
* Sets current and future value for the specified digital output channel.
|
|
@@ -352,58 +317,64 @@ class DeviceIO {
|
|
|
352
317
|
await gateway.callAsync('device/set_digital_output_schedule', request);
|
|
353
318
|
}
|
|
354
319
|
/**
|
|
355
|
-
*
|
|
320
|
+
* Sets current and future values for all digital output channels.
|
|
356
321
|
* Requires at least Firmware 7.37.
|
|
357
|
-
* @param
|
|
322
|
+
* @param values The type of actions to perform immediately on output channels.
|
|
323
|
+
* @param futureValues The type of actions to perform in the future on output channels.
|
|
324
|
+
* @param delay Delay between setting current values and setting future values.
|
|
325
|
+
* @param [unit=Units.NATIVE] Units of time.
|
|
358
326
|
*/
|
|
359
|
-
async
|
|
327
|
+
async setAllDigitalOutputsSchedule(values, futureValues, delay, unit = units_1.Units.NATIVE) {
|
|
328
|
+
if (delay <= 0) {
|
|
329
|
+
throw new TypeError('Delay must be a positive value.');
|
|
330
|
+
}
|
|
360
331
|
const request = {
|
|
361
|
-
...requests.
|
|
332
|
+
...requests.DeviceSetAllDigitalOutputsScheduleRequest.DEFAULT,
|
|
362
333
|
interfaceId: this._device.connection.interfaceId,
|
|
363
334
|
device: this._device.deviceAddress,
|
|
364
|
-
|
|
365
|
-
|
|
335
|
+
values: values,
|
|
336
|
+
futureValues: futureValues,
|
|
337
|
+
delay: delay,
|
|
338
|
+
unit: unit,
|
|
366
339
|
toBinary() {
|
|
367
|
-
return requests.
|
|
340
|
+
return requests.DeviceSetAllDigitalOutputsScheduleRequest.toBinary(this);
|
|
368
341
|
},
|
|
369
342
|
};
|
|
370
|
-
await gateway.callAsync('device/
|
|
343
|
+
await gateway.callAsync('device/set_all_digital_outputs_schedule', request);
|
|
371
344
|
}
|
|
372
345
|
/**
|
|
373
|
-
*
|
|
374
|
-
* Requires at least Firmware 7.38.
|
|
346
|
+
* Sets value for the specified analog output channel.
|
|
375
347
|
* @param channelNumber Channel number starting at 1.
|
|
348
|
+
* @param value Value to set the output channel voltage to.
|
|
376
349
|
*/
|
|
377
|
-
async
|
|
350
|
+
async setAnalogOutput(channelNumber, value) {
|
|
378
351
|
const request = {
|
|
379
|
-
...requests.
|
|
352
|
+
...requests.DeviceSetAnalogOutputRequest.DEFAULT,
|
|
380
353
|
interfaceId: this._device.connection.interfaceId,
|
|
381
354
|
device: this._device.deviceAddress,
|
|
382
|
-
analog: true,
|
|
383
355
|
channelNumber: channelNumber,
|
|
356
|
+
value: value,
|
|
384
357
|
toBinary() {
|
|
385
|
-
return requests.
|
|
358
|
+
return requests.DeviceSetAnalogOutputRequest.toBinary(this);
|
|
386
359
|
},
|
|
387
360
|
};
|
|
388
|
-
await gateway.callAsync('device/
|
|
361
|
+
await gateway.callAsync('device/set_analog_output', request);
|
|
389
362
|
}
|
|
390
363
|
/**
|
|
391
|
-
* Sets
|
|
392
|
-
* @param
|
|
393
|
-
* @param value Value to set the output channel voltage to.
|
|
364
|
+
* Sets values for all analog output channels.
|
|
365
|
+
* @param values Voltage values to set the output channels to.
|
|
394
366
|
*/
|
|
395
|
-
async
|
|
367
|
+
async setAllAnalogOutputs(values) {
|
|
396
368
|
const request = {
|
|
397
|
-
...requests.
|
|
369
|
+
...requests.DeviceSetAllAnalogOutputsRequest.DEFAULT,
|
|
398
370
|
interfaceId: this._device.connection.interfaceId,
|
|
399
371
|
device: this._device.deviceAddress,
|
|
400
|
-
|
|
401
|
-
value: value,
|
|
372
|
+
values: values,
|
|
402
373
|
toBinary() {
|
|
403
|
-
return requests.
|
|
374
|
+
return requests.DeviceSetAllAnalogOutputsRequest.toBinary(this);
|
|
404
375
|
},
|
|
405
376
|
};
|
|
406
|
-
await gateway.callAsync('device/
|
|
377
|
+
await gateway.callAsync('device/set_all_analog_outputs', request);
|
|
407
378
|
}
|
|
408
379
|
/**
|
|
409
380
|
* Sets current and future value for the specified analog output channel.
|
|
@@ -434,77 +405,106 @@ class DeviceIO {
|
|
|
434
405
|
await gateway.callAsync('device/set_analog_output_schedule', request);
|
|
435
406
|
}
|
|
436
407
|
/**
|
|
437
|
-
*
|
|
438
|
-
*
|
|
408
|
+
* Sets current and future values for all analog output channels.
|
|
409
|
+
* Requires at least Firmware 7.38.
|
|
410
|
+
* @param values Voltage values to set the output channels to immediately.
|
|
411
|
+
* @param futureValues Voltage values to set the output channels to in the future.
|
|
412
|
+
* @param delay Delay between setting current values and setting future values.
|
|
413
|
+
* @param [unit=Units.NATIVE] Units of time.
|
|
439
414
|
*/
|
|
440
|
-
async
|
|
415
|
+
async setAllAnalogOutputsSchedule(values, futureValues, delay, unit = units_1.Units.NATIVE) {
|
|
416
|
+
if (delay <= 0) {
|
|
417
|
+
throw new TypeError('Delay must be a positive value.');
|
|
418
|
+
}
|
|
441
419
|
const request = {
|
|
442
|
-
...requests.
|
|
420
|
+
...requests.DeviceSetAllAnalogOutputsScheduleRequest.DEFAULT,
|
|
443
421
|
interfaceId: this._device.connection.interfaceId,
|
|
444
422
|
device: this._device.deviceAddress,
|
|
423
|
+
values: values,
|
|
424
|
+
futureValues: futureValues,
|
|
425
|
+
delay: delay,
|
|
426
|
+
unit: unit,
|
|
445
427
|
toBinary() {
|
|
446
|
-
return requests.
|
|
428
|
+
return requests.DeviceSetAllAnalogOutputsScheduleRequest.toBinary(this);
|
|
447
429
|
},
|
|
448
430
|
};
|
|
449
|
-
|
|
450
|
-
return response;
|
|
431
|
+
await gateway.callAsync('device/set_all_analog_outputs_schedule', request);
|
|
451
432
|
}
|
|
452
433
|
/**
|
|
453
|
-
*
|
|
454
|
-
*
|
|
434
|
+
* Cancels a scheduled digital output action.
|
|
435
|
+
* Requires at least Firmware 7.37.
|
|
455
436
|
* @param channelNumber Channel number starting at 1.
|
|
456
|
-
* @param label The label to set for the specified channel.
|
|
457
|
-
* If no value or an empty string is provided, this label is deleted.
|
|
458
437
|
*/
|
|
459
|
-
async
|
|
438
|
+
async cancelDigitalOutputSchedule(channelNumber) {
|
|
460
439
|
const request = {
|
|
461
|
-
...requests.
|
|
440
|
+
...requests.DeviceCancelOutputScheduleRequest.DEFAULT,
|
|
462
441
|
interfaceId: this._device.connection.interfaceId,
|
|
463
442
|
device: this._device.deviceAddress,
|
|
464
|
-
|
|
443
|
+
analog: false,
|
|
465
444
|
channelNumber: channelNumber,
|
|
466
|
-
label: label,
|
|
467
445
|
toBinary() {
|
|
468
|
-
return requests.
|
|
446
|
+
return requests.DeviceCancelOutputScheduleRequest.toBinary(this);
|
|
469
447
|
},
|
|
470
448
|
};
|
|
471
|
-
await gateway.callAsync('device/
|
|
449
|
+
await gateway.callAsync('device/cancel_output_schedule', request);
|
|
472
450
|
}
|
|
473
451
|
/**
|
|
474
|
-
*
|
|
475
|
-
*
|
|
452
|
+
* Cancel all scheduled digital output actions.
|
|
453
|
+
* Requires at least Firmware 7.37.
|
|
454
|
+
* @param [channels=[]] Optionally specify which channels to cancel.
|
|
455
|
+
* Array length must be empty or equal to the number of channels on device.
|
|
456
|
+
* Specifying "True" for a channel will cancel the scheduled digital output action for that channel.
|
|
457
|
+
*/
|
|
458
|
+
async cancelAllDigitalOutputsSchedule(channels = []) {
|
|
459
|
+
const request = {
|
|
460
|
+
...requests.DeviceCancelAllOutputsScheduleRequest.DEFAULT,
|
|
461
|
+
interfaceId: this._device.connection.interfaceId,
|
|
462
|
+
device: this._device.deviceAddress,
|
|
463
|
+
analog: false,
|
|
464
|
+
channels: channels,
|
|
465
|
+
toBinary() {
|
|
466
|
+
return requests.DeviceCancelAllOutputsScheduleRequest.toBinary(this);
|
|
467
|
+
},
|
|
468
|
+
};
|
|
469
|
+
await gateway.callAsync('device/cancel_all_outputs_schedule', request);
|
|
470
|
+
}
|
|
471
|
+
/**
|
|
472
|
+
* Cancels a scheduled analog output value.
|
|
473
|
+
* Requires at least Firmware 7.38.
|
|
476
474
|
* @param channelNumber Channel number starting at 1.
|
|
477
|
-
* @returns The label of the specified channel.
|
|
478
475
|
*/
|
|
479
|
-
async
|
|
476
|
+
async cancelAnalogOutputSchedule(channelNumber) {
|
|
480
477
|
const request = {
|
|
481
|
-
...requests.
|
|
478
|
+
...requests.DeviceCancelOutputScheduleRequest.DEFAULT,
|
|
482
479
|
interfaceId: this._device.connection.interfaceId,
|
|
483
480
|
device: this._device.deviceAddress,
|
|
484
|
-
|
|
481
|
+
analog: true,
|
|
485
482
|
channelNumber: channelNumber,
|
|
486
483
|
toBinary() {
|
|
487
|
-
return requests.
|
|
484
|
+
return requests.DeviceCancelOutputScheduleRequest.toBinary(this);
|
|
488
485
|
},
|
|
489
486
|
};
|
|
490
|
-
|
|
491
|
-
return response.value;
|
|
487
|
+
await gateway.callAsync('device/cancel_output_schedule', request);
|
|
492
488
|
}
|
|
493
489
|
/**
|
|
494
|
-
*
|
|
495
|
-
*
|
|
490
|
+
* Cancel all scheduled analog output actions.
|
|
491
|
+
* Requires at least Firmware 7.38.
|
|
492
|
+
* @param [channels=[]] Optionally specify which channels to cancel.
|
|
493
|
+
* Array length must be empty or equal to the number of channels on device.
|
|
494
|
+
* Specifying "True" for a channel will cancel the scheduled analog output value for that channel.
|
|
496
495
|
*/
|
|
497
|
-
async
|
|
496
|
+
async cancelAllAnalogOutputsSchedule(channels = []) {
|
|
498
497
|
const request = {
|
|
499
|
-
...requests.
|
|
498
|
+
...requests.DeviceCancelAllOutputsScheduleRequest.DEFAULT,
|
|
500
499
|
interfaceId: this._device.connection.interfaceId,
|
|
501
500
|
device: this._device.deviceAddress,
|
|
501
|
+
analog: true,
|
|
502
|
+
channels: channels,
|
|
502
503
|
toBinary() {
|
|
503
|
-
return requests.
|
|
504
|
+
return requests.DeviceCancelAllOutputsScheduleRequest.toBinary(this);
|
|
504
505
|
},
|
|
505
506
|
};
|
|
506
|
-
|
|
507
|
-
return response.labels;
|
|
507
|
+
await gateway.callAsync('device/cancel_all_outputs_schedule', request);
|
|
508
508
|
}
|
|
509
509
|
}
|
|
510
510
|
exports.DeviceIO = DeviceIO;
|