motion-master-client 0.0.65 → 0.0.67
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 +4 -2
- package/src/cli.d.ts +1 -0
- package/src/cli.js +161 -0
- package/src/cli.js.map +1 -0
- package/src/index.d.ts +1 -0
- package/src/index.js +1 -0
- package/src/index.js.map +1 -1
- package/src/lib/encoder-register.d.ts +16 -0
- package/src/lib/encoder-register.js +117 -0
- package/src/lib/encoder-register.js.map +1 -0
- package/src/lib/motion-master-pub-sub-web-socket.d.ts +19 -0
- package/src/lib/motion-master-pub-sub-web-socket.js +19 -0
- package/src/lib/motion-master-pub-sub-web-socket.js.map +1 -1
- package/src/lib/motion-master-req-res-client.d.ts +274 -183
- package/src/lib/motion-master-req-res-client.js +375 -183
- package/src/lib/motion-master-req-res-client.js.map +1 -1
- package/src/lib/os-command.d.ts +173 -0
- package/src/lib/os-command.js +270 -0
- package/src/lib/os-command.js.map +1 -0
- package/src/lib/types.d.ts +57 -125
- package/src/lib/types.js.map +1 -1
|
@@ -0,0 +1,270 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.createPhaseInductanceMeasurementOsCommand = exports.createPhaseResistanceMeasurementOsCommand = exports.createPolePairDetectionOsCommand = exports.openPhaseDetectionErrors = exports.createOpenPhaseDetectionOsCommand = exports.createCommutationOffsetMeasurementOsCommand = exports.createMotorPhaseOrderDetectionOsCommand = exports.createEncoderRegisterCommunicationOsCommand = exports.createOsCommandTypedArray = exports.osCommandErrorCode = exports.OsCommandId = exports.OsCommandMode = exports.parseOsCommandResponse = void 0;
|
|
4
|
+
;
|
|
5
|
+
function parseOsCommandResponse(response) {
|
|
6
|
+
const status = response.at(0);
|
|
7
|
+
if (status === undefined) {
|
|
8
|
+
throw new Error(`No status is available in the typed array response ${JSON.stringify(response)}`);
|
|
9
|
+
}
|
|
10
|
+
let data;
|
|
11
|
+
let errorCode;
|
|
12
|
+
let errorName;
|
|
13
|
+
let errorDescription;
|
|
14
|
+
let progress;
|
|
15
|
+
let request = 'started';
|
|
16
|
+
// Determine the status of the OS command.
|
|
17
|
+
if (status === 0 || status === 1) {
|
|
18
|
+
request = 'succeeded';
|
|
19
|
+
}
|
|
20
|
+
else if (status === 2 || status === 3) {
|
|
21
|
+
request = 'failed';
|
|
22
|
+
}
|
|
23
|
+
else if ((status >= 100 && status <= 200) || status === 255) {
|
|
24
|
+
request = 'running';
|
|
25
|
+
}
|
|
26
|
+
else {
|
|
27
|
+
throw new Error(`Unknown OS command response status: ${status}`);
|
|
28
|
+
}
|
|
29
|
+
// Command in progress with percentage.
|
|
30
|
+
if (status >= 100 && status <= 200) {
|
|
31
|
+
progress = status - 100;
|
|
32
|
+
}
|
|
33
|
+
// Command completed with error and with response.
|
|
34
|
+
if (status === 3) {
|
|
35
|
+
errorCode = response.at(2);
|
|
36
|
+
if (errorCode !== undefined) {
|
|
37
|
+
errorName = exports.osCommandErrorCode[errorCode];
|
|
38
|
+
}
|
|
39
|
+
}
|
|
40
|
+
if (status === 1) {
|
|
41
|
+
// 6 bytes for data when last command completed, no errors, response data available
|
|
42
|
+
data = Array.from(response.slice(2));
|
|
43
|
+
}
|
|
44
|
+
else if (status === 3) {
|
|
45
|
+
// 5 bytes for data when last command completed, error, response data available
|
|
46
|
+
data = Array.from(response.slice(3));
|
|
47
|
+
}
|
|
48
|
+
return { data, errorCode, errorName, errorDescription, progress, request, response };
|
|
49
|
+
}
|
|
50
|
+
exports.parseOsCommandResponse = parseOsCommandResponse;
|
|
51
|
+
var OsCommandMode;
|
|
52
|
+
(function (OsCommandMode) {
|
|
53
|
+
OsCommandMode[OsCommandMode["EXECUTE_THE_NEXT_COMMAND_IMMEDIATELY"] = 0] = "EXECUTE_THE_NEXT_COMMAND_IMMEDIATELY";
|
|
54
|
+
OsCommandMode[OsCommandMode["ABORT_THE_CURRENT_COMMAND_AND_ALL_COMMANDS_IN_THE_BUFFER"] = 3] = "ABORT_THE_CURRENT_COMMAND_AND_ALL_COMMANDS_IN_THE_BUFFER";
|
|
55
|
+
})(OsCommandMode = exports.OsCommandMode || (exports.OsCommandMode = {}));
|
|
56
|
+
;
|
|
57
|
+
var OsCommandId;
|
|
58
|
+
(function (OsCommandId) {
|
|
59
|
+
OsCommandId[OsCommandId["ENCODER_REGISTER_COMMUNICATION"] = 0] = "ENCODER_REGISTER_COMMUNICATION";
|
|
60
|
+
OsCommandId[OsCommandId["ICMU_CALIBRATION_MODE"] = 1] = "ICMU_CALIBRATION_MODE";
|
|
61
|
+
OsCommandId[OsCommandId["OPEN_LOOP_FIELD_MODE"] = 2] = "OPEN_LOOP_FIELD_MODE";
|
|
62
|
+
OsCommandId[OsCommandId["HRD_STREAMING"] = 3] = "HRD_STREAMING";
|
|
63
|
+
OsCommandId[OsCommandId["MOTOR_PHASE_ORDER_DETECTION"] = 4] = "MOTOR_PHASE_ORDER_DETECTION";
|
|
64
|
+
OsCommandId[OsCommandId["COMMUTATION_OFFSET_MEASUREMENT"] = 5] = "COMMUTATION_OFFSET_MEASUREMENT";
|
|
65
|
+
OsCommandId[OsCommandId["OPEN_PHASE_DETECTION"] = 6] = "OPEN_PHASE_DETECTION";
|
|
66
|
+
OsCommandId[OsCommandId["POLE_PAIR_DETECTION"] = 7] = "POLE_PAIR_DETECTION";
|
|
67
|
+
OsCommandId[OsCommandId["PHASE_RESISTANCE_MEASUREMENT"] = 8] = "PHASE_RESISTANCE_MEASUREMENT";
|
|
68
|
+
OsCommandId[OsCommandId["PHASE_INDUCTANCE_MEASUREMENT"] = 9] = "PHASE_INDUCTANCE_MEASUREMENT";
|
|
69
|
+
OsCommandId[OsCommandId["TORQUE_CONSTANT_MEASUREMENT"] = 10] = "TORQUE_CONSTANT_MEASUREMENT";
|
|
70
|
+
OsCommandId[OsCommandId["SMM"] = 11] = "SMM";
|
|
71
|
+
})(OsCommandId = exports.OsCommandId || (exports.OsCommandId = {}));
|
|
72
|
+
;
|
|
73
|
+
exports.osCommandErrorCode = {
|
|
74
|
+
251: 'Command not allowed',
|
|
75
|
+
252: 'Command aborted',
|
|
76
|
+
253: 'Command timeout',
|
|
77
|
+
254: 'Command unsupported',
|
|
78
|
+
};
|
|
79
|
+
function createOsCommandTypedArray(elements) {
|
|
80
|
+
return new Uint8Array(elements.concat(new Array(8 - elements.length).fill(0)));
|
|
81
|
+
}
|
|
82
|
+
exports.createOsCommandTypedArray = createOsCommandTypedArray;
|
|
83
|
+
/**
|
|
84
|
+
* OS command 0: Encoder register communication
|
|
85
|
+
*
|
|
86
|
+
* This OS command is utilized for reading or writing registers from an encoder service.
|
|
87
|
+
* Presently, the only service supporting this functionality is BiSS, but it can be easily extended to other encoder services.
|
|
88
|
+
* For more information on how BiSS register communication operates, please consult the official BiSS C Interface Protocol Description.
|
|
89
|
+
*
|
|
90
|
+
* | | Bit 7 | Bit 6 | Bit 5 | Bit 4 | Bit 3 | Bit 2 | Bit 1 | Bit 0 |
|
|
91
|
+
* |--------|:-----:|:-----:|:-----:|:-----:|:-----:|:-----:|:-----:|:-----:|
|
|
92
|
+
* | Byte 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 |
|
|
93
|
+
* | Byte 1 | - | - | - | - | - | A | A | A |
|
|
94
|
+
* | Byte 2 | B | B | B | B | B | B | B | C |
|
|
95
|
+
* | Byte 3 | D | D | D | D | D | D | D | D |
|
|
96
|
+
* | Byte 4 | E | E | E | E | E | E | E | E |
|
|
97
|
+
* | Byte 5 | - | - | - | - | - | - | - | - |
|
|
98
|
+
* | Byte 6 | - | - | - | - | - | - | - | - |
|
|
99
|
+
* | Byte 7 | - | - | - | - | - | - | - | - |
|
|
100
|
+
*
|
|
101
|
+
* @param encoderOrdinal (A) 2^3=8 encoder ordinals. Counting starts from 1, so '1' refers to Encoder 1 configured in 0x2110.
|
|
102
|
+
* @param slaveAddress (B) 2^7=128 slave addresses. Select the address of the slave to read (BiSS protocol level). Since our BiSS service doesn't support multiple slaves in the same device, this value should always be 0.
|
|
103
|
+
* @param rw (C) Read or write the encoder register. Select the direction of the command: 0 for reading a register, and 1 for writing it.
|
|
104
|
+
* @param registerAddress (D) Register to be read/written.
|
|
105
|
+
* @param registerWriteValue (E) The value to write to the register. This value is ignored when reading a register (when rw is set to 0).
|
|
106
|
+
*/
|
|
107
|
+
function createEncoderRegisterCommunicationOsCommand(encoderOrdinal = 1, slaveAddress = 0, rw = 0, registerAddress = 0, registerWriteValue = 0) {
|
|
108
|
+
const byte2 = (slaveAddress << 1) | rw;
|
|
109
|
+
const elements = [OsCommandId.ENCODER_REGISTER_COMMUNICATION, encoderOrdinal, byte2, registerAddress, registerWriteValue];
|
|
110
|
+
return createOsCommandTypedArray(elements);
|
|
111
|
+
}
|
|
112
|
+
exports.createEncoderRegisterCommunicationOsCommand = createEncoderRegisterCommunicationOsCommand;
|
|
113
|
+
;
|
|
114
|
+
/**
|
|
115
|
+
* Command 4: Motor phase order detection
|
|
116
|
+
*
|
|
117
|
+
* This command is used to detect the order of the motor phases.
|
|
118
|
+
* When this command finishes successfully, the found value is automatically written to the object 0x2003:5 Motor phases inverted.
|
|
119
|
+
* This command rotates the motor.
|
|
120
|
+
*
|
|
121
|
+
* This OS command has no arguments.
|
|
122
|
+
*
|
|
123
|
+
* When the command finishes successfully, it will return a value of 0 for normal and 1 for inverted motor phases.
|
|
124
|
+
*
|
|
125
|
+
* This command doesn't have any command-specific OS error code, so this status will only happen when a general OS error code occurs.
|
|
126
|
+
*
|
|
127
|
+
* This command will report its progress without indicating a percentage.
|
|
128
|
+
*
|
|
129
|
+
* This command can only be run when the opmode is -2 (OPMODE_DIAGNOSTICS), the CIA402 state is Operation enabled, there is no active limit switch,
|
|
130
|
+
* and the brake status is disengaged (in case there is a configured brake). If any of these conditions is not true during the execution of the command,
|
|
131
|
+
* the execution will stop, and it will return the OS error code 251 (command not allowed).
|
|
132
|
+
*/
|
|
133
|
+
function createMotorPhaseOrderDetectionOsCommand() {
|
|
134
|
+
const elements = [OsCommandId.MOTOR_PHASE_ORDER_DETECTION];
|
|
135
|
+
return createOsCommandTypedArray(elements);
|
|
136
|
+
}
|
|
137
|
+
exports.createMotorPhaseOrderDetectionOsCommand = createMotorPhaseOrderDetectionOsCommand;
|
|
138
|
+
;
|
|
139
|
+
/**
|
|
140
|
+
* Command 5: Commutation offset measurement
|
|
141
|
+
*
|
|
142
|
+
* This command is used to measure the commutation angle offset.
|
|
143
|
+
* The configuration of the procedure is derived from the pre-existing and previously used commutation offset objects in the object dictionary.
|
|
144
|
+
* Upon successful completion of this command, the determined value is automatically written to:
|
|
145
|
+
* - 0x2001:00 Commutation angle offset
|
|
146
|
+
* - 0x2009:01 State is set to OFFSET_VALID
|
|
147
|
+
*
|
|
148
|
+
* In version 5.0, three different methods can be selected for command 5. These methods are named:
|
|
149
|
+
* - Commutation offset measurement - method 0
|
|
150
|
+
* - Commutation offset measurement - method 1
|
|
151
|
+
* - Commutation offset measurement - method 2
|
|
152
|
+
* Among these three methods, "method 0" and "method 1" involve rotating the rotor.
|
|
153
|
+
*
|
|
154
|
+
* This command can only be run when the opmode is -2 (OPMODE_DIAGNOSTICS) and the CIA402 state is Operation enabled.
|
|
155
|
+
* Additionally, if the commutation offset measurement method (0x2009:3) is set to 0 or 1,
|
|
156
|
+
* the command is permissible only when there are no active limit switches, and the brake status is disengaged (in case a brake is configured).
|
|
157
|
+
* If any of these conditions is not met during the execution of the command, the execution will be halted,
|
|
158
|
+
* and it will return the OS error code 251 (Command not allowed).
|
|
159
|
+
*/
|
|
160
|
+
function createCommutationOffsetMeasurementOsCommand() {
|
|
161
|
+
const elements = [OsCommandId.COMMUTATION_OFFSET_MEASUREMENT];
|
|
162
|
+
return createOsCommandTypedArray(elements);
|
|
163
|
+
}
|
|
164
|
+
exports.createCommutationOffsetMeasurementOsCommand = createCommutationOffsetMeasurementOsCommand;
|
|
165
|
+
;
|
|
166
|
+
/**
|
|
167
|
+
* Command 6: Open phase detection
|
|
168
|
+
*
|
|
169
|
+
* This command is used to detect whether one of the phases is open.
|
|
170
|
+
* It might rotate the motor if there is no brake or if it is disengaged.
|
|
171
|
+
*
|
|
172
|
+
* If this command finishes successfully, it indicates that all motor phases seem to be fine.
|
|
173
|
+
*
|
|
174
|
+
* This command can only be run when the opmode is -2 (OPMODE_DIAGNOSTICS), the CIA402 state is Operation enabled,
|
|
175
|
+
* and there is no limit switch active. If any of these conditions is not true during the execution of the command,
|
|
176
|
+
* the execution will stop, and it will return the OS error code 251 (Command not allowed).
|
|
177
|
+
*/
|
|
178
|
+
function createOpenPhaseDetectionOsCommand() {
|
|
179
|
+
const elements = [OsCommandId.OPEN_PHASE_DETECTION];
|
|
180
|
+
return createOsCommandTypedArray(elements);
|
|
181
|
+
}
|
|
182
|
+
exports.createOpenPhaseDetectionOsCommand = createOpenPhaseDetectionOsCommand;
|
|
183
|
+
;
|
|
184
|
+
exports.openPhaseDetectionErrors = {
|
|
185
|
+
0: {
|
|
186
|
+
errorName: 'Open terminal A',
|
|
187
|
+
errorDescription: 'Terminal A of the Drive is not connected',
|
|
188
|
+
},
|
|
189
|
+
1: {
|
|
190
|
+
errorName: 'Open terminal B',
|
|
191
|
+
errorDescription: 'Terminal B of the Drive is not connected',
|
|
192
|
+
},
|
|
193
|
+
2: {
|
|
194
|
+
errorName: 'Open terminal C',
|
|
195
|
+
errorDescription: 'Terminal C of the Drive is not connected',
|
|
196
|
+
},
|
|
197
|
+
3: {
|
|
198
|
+
errorName: 'Open FET A high',
|
|
199
|
+
errorDescription: 'Upper FET in leg A of the Drive is not conducting (open circuit fault)',
|
|
200
|
+
},
|
|
201
|
+
4: {
|
|
202
|
+
errorName: 'Open FET A low',
|
|
203
|
+
errorDescription: 'Lower FET in leg A of the Drive is not conducting (open circuit fault)',
|
|
204
|
+
},
|
|
205
|
+
5: {
|
|
206
|
+
errorName: 'Open FET B high',
|
|
207
|
+
errorDescription: 'Upper FET in leg B of the Drive is not conducting (open circuit fault)',
|
|
208
|
+
},
|
|
209
|
+
6: {
|
|
210
|
+
errorName: 'Open FET B low',
|
|
211
|
+
errorDescription: 'Lower FET in leg B of the Drive is not conducting (open circuit fault)',
|
|
212
|
+
},
|
|
213
|
+
7: {
|
|
214
|
+
errorName: 'Open FET C high',
|
|
215
|
+
errorDescription: 'Upper FET in leg C of the Drive is not conducting (open circuit fault)',
|
|
216
|
+
},
|
|
217
|
+
8: {
|
|
218
|
+
errorName: 'Open FET C low',
|
|
219
|
+
errorDescription: 'Lower FET in leg C of the Drive is not conducting (open circuit fault)',
|
|
220
|
+
},
|
|
221
|
+
};
|
|
222
|
+
/**
|
|
223
|
+
* Command 7: Pole pair detection
|
|
224
|
+
*
|
|
225
|
+
* This command is used to detect the number of pole pairs that the connected motor has.
|
|
226
|
+
* It requires the rotation of the rotor.
|
|
227
|
+
*
|
|
228
|
+
* This command can only be run when the opmode is -2 (OPMODE_DIAGNOSTICS), the CIA402 state is Operation enabled,
|
|
229
|
+
* and there is no limit switch active. If any of these conditions is not true during the execution of the command,
|
|
230
|
+
* the execution will stop, and it will return the OS error code 251 (Command not allowed).
|
|
231
|
+
*/
|
|
232
|
+
function createPolePairDetectionOsCommand() {
|
|
233
|
+
const elements = [OsCommandId.POLE_PAIR_DETECTION];
|
|
234
|
+
return createOsCommandTypedArray(elements);
|
|
235
|
+
}
|
|
236
|
+
exports.createPolePairDetectionOsCommand = createPolePairDetectionOsCommand;
|
|
237
|
+
;
|
|
238
|
+
/**
|
|
239
|
+
* Command 8: Phase resistance measurement
|
|
240
|
+
*
|
|
241
|
+
* This command is used to measure the phase resistance of the motor in milliohms (mΩ).
|
|
242
|
+
* It might rotate the motor if there is no brake or if it is disengaged.
|
|
243
|
+
*
|
|
244
|
+
* This command can only be run when the opmode is -2 (OPMODE_DIAGNOSTICS), the CIA402 state is Operation enabled,
|
|
245
|
+
* and there is no limit switch active. If any of these conditions is not true during the execution of the command,
|
|
246
|
+
* the execution will stop, and it will return the OS error code 251 (Command not allowed).
|
|
247
|
+
*/
|
|
248
|
+
function createPhaseResistanceMeasurementOsCommand() {
|
|
249
|
+
const elements = [OsCommandId.PHASE_RESISTANCE_MEASUREMENT];
|
|
250
|
+
return createOsCommandTypedArray(elements);
|
|
251
|
+
}
|
|
252
|
+
exports.createPhaseResistanceMeasurementOsCommand = createPhaseResistanceMeasurementOsCommand;
|
|
253
|
+
;
|
|
254
|
+
/**
|
|
255
|
+
* Command 9: Phase inductance measurement
|
|
256
|
+
*
|
|
257
|
+
* This command is used to measure the phase inductance of the motor in microhenries (μH).
|
|
258
|
+
* It might rotate the motor if there is no brake or if it is disengaged.
|
|
259
|
+
*
|
|
260
|
+
* This command can only be run when the opmode is -2 (OPMODE_DIAGNOSTICS), the CIA402 state is Operation enabled,
|
|
261
|
+
* and there is no limit switch active. If any of these conditions is not true during the execution of the command,
|
|
262
|
+
* the execution will stop, and it will return the OS error code 251 (Command not allowed).
|
|
263
|
+
*/
|
|
264
|
+
function createPhaseInductanceMeasurementOsCommand() {
|
|
265
|
+
const elements = [OsCommandId.PHASE_INDUCTANCE_MEASUREMENT];
|
|
266
|
+
return createOsCommandTypedArray(elements);
|
|
267
|
+
}
|
|
268
|
+
exports.createPhaseInductanceMeasurementOsCommand = createPhaseInductanceMeasurementOsCommand;
|
|
269
|
+
;
|
|
270
|
+
//# sourceMappingURL=os-command.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"os-command.js","sourceRoot":"","sources":["../../../../../libs/motion-master-client/src/lib/os-command.ts"],"names":[],"mappings":";;;AAUC,CAAC;AAEF,SAAgB,sBAAsB,CAAC,QAAoB;IACzD,MAAM,MAAM,GAAG,QAAQ,CAAC,EAAE,CAAC,CAAC,CAAC,CAAC;IAE9B,IAAI,MAAM,KAAK,SAAS,EAAE;QACxB,MAAM,IAAI,KAAK,CAAC,sDAAsD,IAAI,CAAC,SAAS,CAAC,QAAQ,CAAC,EAAE,CAAC,CAAC;KACnG;IAED,IAAI,IAA0B,CAAC;IAC/B,IAAI,S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EAAE,wEAAwE;KAC3F;IACD,CAAC,EAAE;QACD,SAAS,EAAE,gBAAgB;QAC3B,gBAAgB,EAAE,yEAAyE;KAC5F;IACD,CAAC,EAAE;QACD,SAAS,EAAE,iBAAiB;QAC5B,gBAAgB,EAAE,wEAAwE;KAC3F;IACD,CAAC,EAAE;QACD,SAAS,EAAE,gBAAgB;QAC3B,gBAAgB,EAAE,yEAAyE;KAC5F;CACF,CAAC;AAEF;;;;;;;;;GASG;AACH,SAAgB,gCAAgC;IAC9C,MAAM,QAAQ,GAAa,CAAC,WAAW,CAAC,mBAAmB,CAAC,CAAC;IAC7D,OAAO,yBAAyB,CAAC,QAAQ,CAAC,CAAC;AAC7C,CAAC;AAHD,4EAGC;AAIA,CAAC;AAEF;;;;;;;;;GASG;AACH,SAAgB,yCAAyC;IACvD,MAAM,QAAQ,GAAa,CAAC,WAAW,CAAC,4BAA4B,CAAC,CAAC;IACtE,OAAO,yBAAyB,CAAC,QAAQ,CAAC,CAAC;AAC7C,CAAC;AAHD,8FAGC;AAIA,CAAC;AAEF;;;;;;;;;GASG;AACH,SAAgB,yCAAyC;IACvD,MAAM,QAAQ,GAAa,CAAC,WAAW,CAAC,4BAA4B,CAAC,CAAC;IACtE,OAAO,yBAAyB,CAAC,QAAQ,CAAC,CAAC;AAC7C,CAAC;AAHD,8FAGC;AAIA,CAAC"}
|
package/src/lib/types.d.ts
CHANGED
|
@@ -2,7 +2,32 @@ import { motionmaster } from "./motion-master.proto";
|
|
|
2
2
|
export import MotionMasterMessage = motionmaster.MotionMasterMessage;
|
|
3
3
|
export import IMotionMasterMessage = motionmaster.IMotionMasterMessage;
|
|
4
4
|
export type StatusKey = keyof MotionMasterMessage.IStatus;
|
|
5
|
-
|
|
5
|
+
/**
|
|
6
|
+
* Request can be:
|
|
7
|
+
* - started on the client side,
|
|
8
|
+
* - running where Motion Master reports that the procedure is in progress,
|
|
9
|
+
* - succeeded if the request was completed successfully or the progress has reached 100%,
|
|
10
|
+
* - failed if anything goes wrong.
|
|
11
|
+
*/
|
|
12
|
+
export type RequestStatus = 'started' | 'running' | 'succeeded' | 'failed';
|
|
13
|
+
export type StatusMessageExtension = {
|
|
14
|
+
request: RequestStatus;
|
|
15
|
+
messageId?: string;
|
|
16
|
+
/**
|
|
17
|
+
* @deprecated used in OBLAC Drives with the old client library to signify that a request has started
|
|
18
|
+
*/
|
|
19
|
+
begin?: {
|
|
20
|
+
code?: (number | null);
|
|
21
|
+
message?: (string | null);
|
|
22
|
+
};
|
|
23
|
+
/**
|
|
24
|
+
* @deprecated used in OBLAC Drives with the old client library to signify that a request has timed out
|
|
25
|
+
*/
|
|
26
|
+
timeout?: {
|
|
27
|
+
code?: (number | null);
|
|
28
|
+
message?: (string | null);
|
|
29
|
+
};
|
|
30
|
+
};
|
|
6
31
|
export declare class RequestError extends Error {
|
|
7
32
|
}
|
|
8
33
|
export type ParameterAddress = [number, number];
|
|
@@ -71,130 +96,37 @@ export type StopFullAutoTuningRequest = MotionMasterMessage.Request.IStopFullAut
|
|
|
71
96
|
export type StartCirculoEncoderConfigurationRequest = MotionMasterMessage.Request.IStartCirculoEncoderConfiguration & DeviceRefObj;
|
|
72
97
|
export type StopCirculoEncoderNarrowAngleCalibrationProcedureRequest = MotionMasterMessage.Request.IStopCirculoEncoderNarrowAngleCalibrationProcedure & DeviceRefObj;
|
|
73
98
|
export type StartOsCommandRequest = MotionMasterMessage.Request.IStartOsCommand & DeviceRefObj;
|
|
74
|
-
export type SystemVersionStatus = MotionMasterMessage.Status.ISystemVersion &
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
export type
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
export type
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
export type
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
export type
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
export type
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
export type
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
export type
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
};
|
|
106
|
-
export type DeviceStopStatus = MotionMasterMessage.Status.IDeviceStop & {
|
|
107
|
-
request: RequestStatus;
|
|
108
|
-
messageId?: string;
|
|
109
|
-
};
|
|
110
|
-
export type DeviceFirmwareInstallationStatus = MotionMasterMessage.Status.IDeviceFirmwareInstallation & {
|
|
111
|
-
request: RequestStatus;
|
|
112
|
-
messageId?: string;
|
|
113
|
-
};
|
|
114
|
-
export type DeviceLogStatus = MotionMasterMessage.Status.IDeviceLog & {
|
|
115
|
-
request: RequestStatus;
|
|
116
|
-
messageId?: string;
|
|
117
|
-
};
|
|
118
|
-
export type CoggingTorqueRecordingStatus = MotionMasterMessage.Status.ICoggingTorqueRecording & {
|
|
119
|
-
request: RequestStatus;
|
|
120
|
-
messageId?: string;
|
|
121
|
-
};
|
|
122
|
-
export type CoggingTorqueDataStatus = MotionMasterMessage.Status.ICoggingTorqueData & {
|
|
123
|
-
request: RequestStatus;
|
|
124
|
-
messageId?: string;
|
|
125
|
-
};
|
|
126
|
-
export type OffsetDetectionStatus = MotionMasterMessage.Status.IOffsetDetection & {
|
|
127
|
-
request: RequestStatus;
|
|
128
|
-
messageId?: string;
|
|
129
|
-
};
|
|
130
|
-
export type PlantIdentificationStatus = MotionMasterMessage.Status.IPlantIdentification & {
|
|
131
|
-
request: RequestStatus;
|
|
132
|
-
messageId?: string;
|
|
133
|
-
};
|
|
134
|
-
export type AutoTuningStatus = MotionMasterMessage.Status.IAutoTuning & {
|
|
135
|
-
request: RequestStatus;
|
|
136
|
-
messageId?: string;
|
|
137
|
-
};
|
|
138
|
-
export type MotionControllerStatus = MotionMasterMessage.Status.IMotionController & {
|
|
139
|
-
request: RequestStatus;
|
|
140
|
-
messageId?: string;
|
|
141
|
-
};
|
|
142
|
-
export type SignalGeneratorStatus = MotionMasterMessage.Status.ISignalGenerator & {
|
|
143
|
-
request: RequestStatus;
|
|
144
|
-
messageId?: string;
|
|
145
|
-
};
|
|
146
|
-
export type MonitoringParameterValuesStatus = MotionMasterMessage.Status.IMonitoringParameterValues & {
|
|
147
|
-
request: RequestStatus;
|
|
148
|
-
messageId?: string;
|
|
149
|
-
};
|
|
150
|
-
export type EthercatNetworkStateStatus = MotionMasterMessage.Status.IEthercatNetworkState & {
|
|
151
|
-
request: RequestStatus;
|
|
152
|
-
messageId?: string;
|
|
153
|
-
};
|
|
154
|
-
export type NarrowAngleCalibrationStatus = MotionMasterMessage.Status.INarrowAngleCalibration & {
|
|
155
|
-
request: RequestStatus;
|
|
156
|
-
messageId?: string;
|
|
157
|
-
};
|
|
158
|
-
export type SystemIdentificationStatus = MotionMasterMessage.Status.ISystemIdentification & {
|
|
159
|
-
request: RequestStatus;
|
|
160
|
-
messageId?: string;
|
|
161
|
-
};
|
|
162
|
-
export type CirculoEncoderMagnetDistanceStatus = MotionMasterMessage.Status.ICirculoEncoderMagnetDistance & {
|
|
163
|
-
request: RequestStatus;
|
|
164
|
-
messageId?: string;
|
|
165
|
-
};
|
|
166
|
-
export type CirculoEncoderNarrowAngleCalibrationProcedureStatus = MotionMasterMessage.Status.ICirculoEncoderNarrowAngleCalibrationProcedure & {
|
|
167
|
-
request: RequestStatus;
|
|
168
|
-
messageId?: string;
|
|
169
|
-
};
|
|
170
|
-
export type DeviceCiA402StateStatus = MotionMasterMessage.Status.IDeviceCiA402State & {
|
|
171
|
-
request: RequestStatus;
|
|
172
|
-
messageId?: string;
|
|
173
|
-
};
|
|
174
|
-
export type SystemLogStatus = MotionMasterMessage.Status.ISystemLog & {
|
|
175
|
-
request: RequestStatus;
|
|
176
|
-
messageId?: string;
|
|
177
|
-
};
|
|
178
|
-
export type DeviceSiiRestoreStatus = MotionMasterMessage.Status.IDeviceSiiRestore & {
|
|
179
|
-
request: RequestStatus;
|
|
180
|
-
messageId?: string;
|
|
181
|
-
};
|
|
182
|
-
export type OpenLoopFieldControlStatus = MotionMasterMessage.Status.IOpenLoopFieldControl & {
|
|
183
|
-
request: RequestStatus;
|
|
184
|
-
messageId?: string;
|
|
185
|
-
};
|
|
186
|
-
export type FullAutoTuningStatus = MotionMasterMessage.Status.IFullAutoTuning & {
|
|
187
|
-
request: RequestStatus;
|
|
188
|
-
messageId?: string;
|
|
189
|
-
};
|
|
190
|
-
export type CirculoEncoderConfigurationStatus = MotionMasterMessage.Status.ICirculoEncoderConfiguration & {
|
|
191
|
-
request: RequestStatus;
|
|
192
|
-
messageId?: string;
|
|
193
|
-
};
|
|
194
|
-
export type OsCommandStatus = MotionMasterMessage.Status.IOsCommand & {
|
|
195
|
-
request: RequestStatus;
|
|
196
|
-
messageId?: string;
|
|
197
|
-
};
|
|
99
|
+
export type SystemVersionStatus = MotionMasterMessage.Status.ISystemVersion & StatusMessageExtension;
|
|
100
|
+
export type DeviceInfoStatus = MotionMasterMessage.Status.IDeviceInfo & StatusMessageExtension;
|
|
101
|
+
export type DeviceParameterInfoStatus = MotionMasterMessage.Status.IDeviceParameterInfo & StatusMessageExtension;
|
|
102
|
+
export type DeviceParameterValuesStatus = MotionMasterMessage.Status.IDeviceParameterValues & StatusMessageExtension;
|
|
103
|
+
export type MultiDeviceParameterValuesStatus = MotionMasterMessage.Status.IMultiDeviceParameterValues & StatusMessageExtension;
|
|
104
|
+
export type DeviceFileListStatus = MotionMasterMessage.Status.IDeviceFileList & StatusMessageExtension;
|
|
105
|
+
export type DeviceFileStatus = MotionMasterMessage.Status.IDeviceFile & StatusMessageExtension;
|
|
106
|
+
export type DeviceFaultResetStatus = MotionMasterMessage.Status.IDeviceFaultReset & StatusMessageExtension;
|
|
107
|
+
export type DeviceStopStatus = MotionMasterMessage.Status.IDeviceStop & StatusMessageExtension;
|
|
108
|
+
export type DeviceFirmwareInstallationStatus = MotionMasterMessage.Status.IDeviceFirmwareInstallation & StatusMessageExtension;
|
|
109
|
+
export type DeviceLogStatus = MotionMasterMessage.Status.IDeviceLog & StatusMessageExtension;
|
|
110
|
+
export type CoggingTorqueRecordingStatus = MotionMasterMessage.Status.ICoggingTorqueRecording & StatusMessageExtension;
|
|
111
|
+
export type CoggingTorqueDataStatus = MotionMasterMessage.Status.ICoggingTorqueData & StatusMessageExtension;
|
|
112
|
+
export type OffsetDetectionStatus = MotionMasterMessage.Status.IOffsetDetection & StatusMessageExtension;
|
|
113
|
+
export type PlantIdentificationStatus = MotionMasterMessage.Status.IPlantIdentification & StatusMessageExtension;
|
|
114
|
+
export type AutoTuningStatus = MotionMasterMessage.Status.IAutoTuning & StatusMessageExtension;
|
|
115
|
+
export type MotionControllerStatus = MotionMasterMessage.Status.IMotionController & StatusMessageExtension;
|
|
116
|
+
export type SignalGeneratorStatus = MotionMasterMessage.Status.ISignalGenerator & StatusMessageExtension;
|
|
117
|
+
export type MonitoringParameterValuesStatus = MotionMasterMessage.Status.IMonitoringParameterValues & StatusMessageExtension;
|
|
118
|
+
export type EthercatNetworkStateStatus = MotionMasterMessage.Status.IEthercatNetworkState & StatusMessageExtension;
|
|
119
|
+
export type NarrowAngleCalibrationStatus = MotionMasterMessage.Status.INarrowAngleCalibration & StatusMessageExtension;
|
|
120
|
+
export type SystemIdentificationStatus = MotionMasterMessage.Status.ISystemIdentification & StatusMessageExtension;
|
|
121
|
+
export type CirculoEncoderMagnetDistanceStatus = MotionMasterMessage.Status.ICirculoEncoderMagnetDistance & StatusMessageExtension;
|
|
122
|
+
export type CirculoEncoderNarrowAngleCalibrationProcedureStatus = MotionMasterMessage.Status.ICirculoEncoderNarrowAngleCalibrationProcedure & StatusMessageExtension;
|
|
123
|
+
export type DeviceCiA402StateStatus = MotionMasterMessage.Status.IDeviceCiA402State & StatusMessageExtension;
|
|
124
|
+
export type SystemLogStatus = MotionMasterMessage.Status.ISystemLog & StatusMessageExtension;
|
|
125
|
+
export type DeviceSiiRestoreStatus = MotionMasterMessage.Status.IDeviceSiiRestore & StatusMessageExtension;
|
|
126
|
+
export type OpenLoopFieldControlStatus = MotionMasterMessage.Status.IOpenLoopFieldControl & StatusMessageExtension;
|
|
127
|
+
export type FullAutoTuningStatus = MotionMasterMessage.Status.IFullAutoTuning & StatusMessageExtension;
|
|
128
|
+
export type CirculoEncoderConfigurationStatus = MotionMasterMessage.Status.ICirculoEncoderConfiguration & StatusMessageExtension;
|
|
129
|
+
export type OsCommandStatus = MotionMasterMessage.Status.IOsCommand & StatusMessageExtension;
|
|
198
130
|
export import ValueType = MotionMasterMessage.Status.DeviceParameterInfo.Parameter.ValueType;
|
|
199
131
|
export declare function isArrayOfDeviceSerialNumbers(ids: DeviceParameterIds): ids is string[];
|
|
200
132
|
export declare function isObjectOfDeviceSerialNumberToValues(ids: {
|
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;
|
|
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;AAkCrE,MAAa,YAAa,SAAQ,KAAK;CAAI;AAA3C,oCAA2C;AAgB1C,CAAC;AAaF,6DAA6D;AAC/C,QAAA,oBAAoB,GAAG,2BAAmB,CAAC,OAAO,CAAC,uBAAuB,CAAC,KAAK,CAAC;AAE/F,6DAA6D;AAC/C,QAAA,cAAc,GAAG,2BAAmB,CAAC,OAAO,CAAC,sBAAsB,CAAC,cAAc,CAAC;AA8EjG,6DAA6D;AAC/C,QAAA,SAAS,GAAG,2BAAmB,CAAC,MAAM,CAAC,mBAAmB,CAAC,SAAS,CAAC,SAAS,CAAC;AAE7F,SAAgB,4BAA4B,CAAC,GAAuB;IAClE,OAAO,GAAG,CAAC,MAAM,GAAG,CAAC,IAAI,OAAO,GAAG,CAAC,CAAC,CAAC,KAAK,QAAQ,CAAC;AACtD,CAAC;AAFD,oEAEC;AAED,SAAgB,oCAAoC,CAAC,GAAwF;IAC3I,OAAO,CAAC,KAAK,CAAC,OAAO,CAAC,GAAG,CAAC,CAAC;AAC7B,CAAC;AAFD,oFAEC;AAED,IAAY,4BAGX;AAHD,WAAY,4BAA4B;IACtC,mIAAkC,CAAA;IAClC,qJAA2C,CAAA;AAC7C,CAAC,EAHW,4BAA4B,GAA5B,oCAA4B,KAA5B,oCAA4B,QAGvC"}
|