motion-master-client 0.0.427 → 0.0.429
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/package.json +1 -1
- package/src/api.js +26 -9
- package/src/api.js.map +1 -1
- package/src/lib/circulo.d.ts +2 -1
- package/src/lib/circulo.js +57 -1
- package/src/lib/circulo.js.map +1 -1
- package/src/lib/config-file.js +26 -10
- package/src/lib/config-file.js.map +1 -1
- package/src/lib/firmware.js +13 -6
- package/src/lib/firmware.js.map +1 -1
- package/src/lib/homing.d.ts +18 -0
- package/src/lib/homing.js +19 -1
- package/src/lib/homing.js.map +1 -1
- package/src/lib/integro-encoder-calibration.js +5 -6
- package/src/lib/integro-encoder-calibration.js.map +1 -1
- package/src/lib/limited-range-system-identification.d.ts +28 -0
- package/src/lib/limited-range-system-identification.js +87 -41
- package/src/lib/limited-range-system-identification.js.map +1 -1
- package/src/lib/motion-master-client.d.ts +50 -6
- package/src/lib/motion-master-client.js +136 -64
- package/src/lib/motion-master-client.js.map +1 -1
- package/src/lib/motion-master-req-res-client.d.ts +109 -12
- package/src/lib/motion-master-req-res-client.js +218 -28
- package/src/lib/motion-master-req-res-client.js.map +1 -1
- package/src/lib/types.d.ts +57 -6
- package/src/lib/types.js +26 -1
- package/src/lib/types.js.map +1 -1
package/src/lib/types.d.ts
CHANGED
|
@@ -37,6 +37,54 @@ export type ParameterValueType = string | number | Uint8Array | Array<number>;
|
|
|
37
37
|
export type ParameterAddressValue = [number, number, ParameterValueType, ParameterTypeValueKey?];
|
|
38
38
|
export type DeviceParameterAddressValue = [DeviceRef, number, number, ParameterValueType, ParameterTypeValueKey?];
|
|
39
39
|
export type DeviceParameterIds = string[] | [DeviceRef, number, number][];
|
|
40
|
+
/**
|
|
41
|
+
* Options for writing several parameter values in one request.
|
|
42
|
+
*/
|
|
43
|
+
export interface SetParameterValuesOptions {
|
|
44
|
+
/**
|
|
45
|
+
* Fail when Motion Master reports that any of the values was not applied.
|
|
46
|
+
*
|
|
47
|
+
* Without it, the write succeeds as long as Motion Master replies for every device, even when the reply
|
|
48
|
+
* marks some values with an error, such as `NOT_CHANGED` for a value the drive refused. With it, the write
|
|
49
|
+
* fails with {@link ParameterValuesRefusedError}. The values that were applied stay applied; nothing is
|
|
50
|
+
* rolled back.
|
|
51
|
+
*
|
|
52
|
+
* @defaultValue false
|
|
53
|
+
*/
|
|
54
|
+
failOnRefused?: boolean;
|
|
55
|
+
}
|
|
56
|
+
/**
|
|
57
|
+
* A value from a multi-parameter write, with the status Motion Master reported for it.
|
|
58
|
+
*/
|
|
59
|
+
export interface WrittenParameterValue {
|
|
60
|
+
/** The device reference as the caller passed it: position, address or serial number. */
|
|
61
|
+
deviceRef: DeviceRef;
|
|
62
|
+
/** The device address that Motion Master uses for the device. */
|
|
63
|
+
deviceAddress: number;
|
|
64
|
+
index: number;
|
|
65
|
+
subindex: number;
|
|
66
|
+
value: ParameterValueType;
|
|
67
|
+
}
|
|
68
|
+
/**
|
|
69
|
+
* A value from a multi-parameter write that was not applied.
|
|
70
|
+
*/
|
|
71
|
+
export interface RefusedParameterValue extends WrittenParameterValue {
|
|
72
|
+
/**
|
|
73
|
+
* The error code name from the reply, such as `NOT_CHANGED` or `NOT_FOUND`. `NO_STATUS` when the reply had
|
|
74
|
+
* no success or error for this value.
|
|
75
|
+
*/
|
|
76
|
+
errorCode: string;
|
|
77
|
+
/** The error message from the reply. Empty when Motion Master does not send one. */
|
|
78
|
+
errorMessage: string;
|
|
79
|
+
}
|
|
80
|
+
/**
|
|
81
|
+
* Thrown by a multi-parameter write with `failOnRefused` when one or more values were not applied.
|
|
82
|
+
*/
|
|
83
|
+
export declare class ParameterValuesRefusedError extends Error {
|
|
84
|
+
readonly refused: RefusedParameterValue[];
|
|
85
|
+
readonly applied: WrittenParameterValue[];
|
|
86
|
+
constructor(refused: RefusedParameterValue[], applied: WrittenParameterValue[]);
|
|
87
|
+
}
|
|
40
88
|
export interface DeviceParameterInfo extends MotionMasterMessage.Status.DeviceParameterInfo.IParameter {
|
|
41
89
|
id: string;
|
|
42
90
|
index: number;
|
|
@@ -193,8 +241,9 @@ export interface TorqueProfileConfig {
|
|
|
193
241
|
*
|
|
194
242
|
* - false (default): issues a quick stop after the target is reached and holdingDuration elapses,
|
|
195
243
|
* then waits for the CiA402 state determined by the quick stop option code (0x605A): Quick Stop
|
|
196
|
-
* Active if the code is 6, Switch On Disabled otherwise
|
|
197
|
-
*
|
|
244
|
+
* Active if the code is 5, 6, 7 or 8, Switch On Disabled otherwise or when 0x605A cannot be read.
|
|
245
|
+
* The quick stop is also issued when the target is not reached in time. Requires targetReachTimeout
|
|
246
|
+
* to be a positive number, otherwise an error is thrown.
|
|
198
247
|
* - true: the device remains in the Operation Enabled state; no quick stop is issued.
|
|
199
248
|
* If targetReachTimeout is also set, the function still waits for the target reached bit
|
|
200
249
|
* before returning, but does not stop the drive.
|
|
@@ -249,8 +298,9 @@ export interface VelocityProfileConfig {
|
|
|
249
298
|
*
|
|
250
299
|
* - false (default): issues a quick stop after the target is reached and holdingDuration elapses,
|
|
251
300
|
* then waits for the CiA402 state determined by the quick stop option code (0x605A): Quick Stop
|
|
252
|
-
* Active if the code is 6, Switch On Disabled otherwise
|
|
253
|
-
*
|
|
301
|
+
* Active if the code is 5, 6, 7 or 8, Switch On Disabled otherwise or when 0x605A cannot be read.
|
|
302
|
+
* The quick stop is also issued when the target is not reached in time. Requires targetReachTimeout
|
|
303
|
+
* to be a positive number, otherwise an error is thrown.
|
|
254
304
|
* - true: the device remains in the Operation Enabled state; no quick stop is issued.
|
|
255
305
|
* If targetReachTimeout is also set, the function still waits for the target reached bit
|
|
256
306
|
* before returning, but does not stop the drive.
|
|
@@ -322,8 +372,9 @@ export interface PositionProfileConfig {
|
|
|
322
372
|
*
|
|
323
373
|
* - false (default): issues a quick stop after the target is reached and holdingDuration elapses,
|
|
324
374
|
* then waits for the CiA402 state determined by the quick stop option code (0x605A): Quick Stop
|
|
325
|
-
* Active if the code is 6, Switch On Disabled otherwise
|
|
326
|
-
*
|
|
375
|
+
* Active if the code is 5, 6, 7 or 8, Switch On Disabled otherwise or when 0x605A cannot be read.
|
|
376
|
+
* The quick stop is also issued when the target is not reached in time. Requires targetReachTimeout
|
|
377
|
+
* to be a positive number, otherwise an error is thrown.
|
|
327
378
|
* - true: the device remains in the Operation Enabled state; no quick stop is issued.
|
|
328
379
|
* If targetReachTimeout is also set, the function still waits for the target reached bit
|
|
329
380
|
* before returning, but does not stop the drive.
|
package/src/lib/types.js
CHANGED
|
@@ -1,11 +1,36 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.RestoreDefaultParametersType = exports.isObjectOfDeviceSerialNumberToValues = exports.isArrayOfDeviceSerialNumbers = exports.ValueType = exports.ControllerType = exports.EthercatNetworkState = exports.RequestError = exports.MotionMasterMessage = void 0;
|
|
3
|
+
exports.RestoreDefaultParametersType = exports.isObjectOfDeviceSerialNumberToValues = exports.isArrayOfDeviceSerialNumbers = exports.ValueType = exports.ControllerType = exports.EthercatNetworkState = exports.ParameterValuesRefusedError = exports.RequestError = exports.MotionMasterMessage = void 0;
|
|
4
4
|
const motion_master_proto_1 = require("./motion-master.proto");
|
|
5
5
|
exports.MotionMasterMessage = motion_master_proto_1.motionmaster.MotionMasterMessage;
|
|
6
6
|
class RequestError extends Error {
|
|
7
7
|
}
|
|
8
8
|
exports.RequestError = RequestError;
|
|
9
|
+
/**
|
|
10
|
+
* Thrown by a multi-parameter write with `failOnRefused` when one or more values were not applied.
|
|
11
|
+
*/
|
|
12
|
+
class ParameterValuesRefusedError extends Error {
|
|
13
|
+
constructor(refused, applied) {
|
|
14
|
+
super(`${refused.length} of ${refused.length + applied.length} parameter values were not applied: ${refused
|
|
15
|
+
.map(formatRefusedParameterValue)
|
|
16
|
+
.join('; ')}. Applied: ${applied.length ? applied.map(formatWrittenParameterValue).join(', ') : 'none'}.`);
|
|
17
|
+
this.refused = refused;
|
|
18
|
+
this.applied = applied;
|
|
19
|
+
this.name = 'ParameterValuesRefusedError';
|
|
20
|
+
}
|
|
21
|
+
}
|
|
22
|
+
exports.ParameterValuesRefusedError = ParameterValuesRefusedError;
|
|
23
|
+
function formatParameterAddress({ deviceRef, index, subindex }) {
|
|
24
|
+
const hex = (n, width) => n.toString(16).toUpperCase().padStart(width, '0');
|
|
25
|
+
return `device ${deviceRef} 0x${hex(index, 4)}:${hex(subindex, 2)}`;
|
|
26
|
+
}
|
|
27
|
+
function formatWrittenParameterValue(entry) {
|
|
28
|
+
return `${formatParameterAddress(entry)} = ${String(entry.value)}`;
|
|
29
|
+
}
|
|
30
|
+
function formatRefusedParameterValue(entry) {
|
|
31
|
+
const message = entry.errorMessage ? `: ${entry.errorMessage}` : '';
|
|
32
|
+
return `${formatWrittenParameterValue(entry)} (${entry.errorCode}${message})`;
|
|
33
|
+
}
|
|
9
34
|
// eslint-disable-next-line @typescript-eslint/no-unused-vars
|
|
10
35
|
exports.EthercatNetworkState = exports.MotionMasterMessage.Request.SetEthercatNetworkState.State;
|
|
11
36
|
// eslint-disable-next-line @typescript-eslint/no-unused-vars
|
package/src/lib/types.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"types.js","sourceRoot":"","sources":["../../../../../libs/motion-master-client/src/lib/types.ts"],"names":[],"mappings":";;;AAAA,+DAAqD;AAEvC,QAAA,mBAAmB,GAAG,kCAAY,CAAC,mBAAmB,CAAC;AA8BrE,MAAa,YAAa,SAAQ,KAAK;CAAG;AAA1C,oCAA0C;
|
|
1
|
+
{"version":3,"file":"types.js","sourceRoot":"","sources":["../../../../../libs/motion-master-client/src/lib/types.ts"],"names":[],"mappings":";;;AAAA,+DAAqD;AAEvC,QAAA,mBAAmB,GAAG,kCAAY,CAAC,mBAAmB,CAAC;AA8BrE,MAAa,YAAa,SAAQ,KAAK;CAAG;AAA1C,oCAA0C;AAwD1C;;GAEG;AACH,MAAa,2BAA4B,SAAQ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