motion-master-client 0.0.363 → 0.0.366
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 +2 -2
- package/src/api.js +54 -1
- package/src/api.js.map +1 -1
- package/src/index.d.ts +1 -0
- package/src/index.js +1 -0
- package/src/index.js.map +1 -1
- package/src/lib/encoder.d.ts +1 -1
- package/src/lib/integro-encoder-calibration.js +2 -2
- package/src/lib/motion-master-req-res-client.d.ts +58 -2
- package/src/lib/motion-master-req-res-client.js +226 -5
- package/src/lib/motion-master-req-res-client.js.map +1 -1
- package/src/lib/motion-master.proto.d.ts +82 -2
- package/src/lib/motion-master.proto.js +827 -4
- package/src/lib/offset-detection.d.ts +75 -0
- package/src/lib/offset-detection.js +99 -0
- package/src/lib/offset-detection.js.map +1 -0
- package/src/lib/parameter.d.ts +1 -1
- package/src/lib/product.d.ts +146 -13
- package/src/lib/product.js +171 -37
- package/src/lib/product.js.map +1 -1
- package/src/lib/request-status-resolver.js +7 -1
- package/src/lib/request-status-resolver.js.map +1 -1
- package/src/lib/sii.d.ts +80 -1
- package/src/lib/sii.js +276 -18
- package/src/lib/sii.js.map +1 -1
- package/src/lib/types.d.ts +26 -0
- package/src/lib/types.js.map +1 -1
- package/src/lib/units.d.ts +4 -0
- package/src/lib/units.js +125 -3
- package/src/lib/units.js.map +1 -1
package/src/lib/sii.js
CHANGED
|
@@ -25,6 +25,32 @@ var SiiCategoryType;
|
|
|
25
25
|
SiiCategoryType[SiiCategoryType["APPLICATION_SPECIFIC"] = 8192] = "APPLICATION_SPECIFIC";
|
|
26
26
|
SiiCategoryType[SiiCategoryType["END"] = 65535] = "END";
|
|
27
27
|
})(SiiCategoryType = exports.SiiCategoryType || (exports.SiiCategoryType = {}));
|
|
28
|
+
/**
|
|
29
|
+
* Resolve a raw SII category type value into a normalized {@link SiiCategoryType}.
|
|
30
|
+
*
|
|
31
|
+
* @param value Raw 16-bit category type value from SII.
|
|
32
|
+
* @returns Resolved category type, or `undefined` if not recognized.
|
|
33
|
+
*
|
|
34
|
+
* @remarks
|
|
35
|
+
* - The SII specification defines both fixed category IDs and value ranges:
|
|
36
|
+
*
|
|
37
|
+
* **Mapped ranges:**
|
|
38
|
+
* - 0x0001–0x0009 → DEVICE_SPECIFIC
|
|
39
|
+
* - 0x0800–0x1FFF → VENDOR_SPECIFIC
|
|
40
|
+
* - 0x2000–0x2FFF → APPLICATION_SPECIFIC
|
|
41
|
+
* - 0x3000–0xFFFE → VENDOR_SPECIFIC
|
|
42
|
+
*
|
|
43
|
+
* - For values outside these ranges, a direct enum lookup is attempted:
|
|
44
|
+
* - Matches known categories such as STRINGS, GENERAL, FMMU, etc.
|
|
45
|
+
*
|
|
46
|
+
* - The END marker (0xFFFF) is handled via direct enum lookup.
|
|
47
|
+
*
|
|
48
|
+
* @note
|
|
49
|
+
* - Range-based values are normalized to a single enum representative
|
|
50
|
+
* (e.g. all vendor-specific values map to `VENDOR_SPECIFIC`).
|
|
51
|
+
* - The original numeric value is not preserved.
|
|
52
|
+
* - Unknown values return `undefined` and should be treated as unsupported categories.
|
|
53
|
+
*/
|
|
28
54
|
function resolveSiiCategoryType(value) {
|
|
29
55
|
if (value >= 1 && value <= 9) {
|
|
30
56
|
return SiiCategoryType.DEVICE_SPECIFIC;
|
|
@@ -44,6 +70,58 @@ function resolveSiiCategoryType(value) {
|
|
|
44
70
|
return;
|
|
45
71
|
}
|
|
46
72
|
exports.resolveSiiCategoryType = resolveSiiCategoryType;
|
|
73
|
+
/**
|
|
74
|
+
* Parse a raw EtherCAT Slave Information Interface (SII) EEPROM buffer.
|
|
75
|
+
*
|
|
76
|
+
* @param buffer Full SII EEPROM content.
|
|
77
|
+
* @returns Parsed {@link SlaveInformationInterface}.
|
|
78
|
+
*
|
|
79
|
+
* @remarks
|
|
80
|
+
* The SII structure consists of:
|
|
81
|
+
*
|
|
82
|
+
* 1. **Fixed header (first 128 bytes)**
|
|
83
|
+
* Parsed using:
|
|
84
|
+
* `@HHHHH4xHLLLL8xHHHHHHHHH66xHHHH`
|
|
85
|
+
*
|
|
86
|
+
* Contains:
|
|
87
|
+
* - PDI configuration and control
|
|
88
|
+
* - Vendor/product identification
|
|
89
|
+
* - Mailbox configuration
|
|
90
|
+
* - EEPROM size and version
|
|
91
|
+
*
|
|
92
|
+
* 2. **Category section (starting at offset 128)**
|
|
93
|
+
* A sequence of variable-length categories:
|
|
94
|
+
*
|
|
95
|
+
* Category layout:
|
|
96
|
+
* - uint16 categoryType
|
|
97
|
+
* - uint16 categoryWordSize (number of 16-bit words)
|
|
98
|
+
* - payload (categoryWordSize * 2 bytes)
|
|
99
|
+
*
|
|
100
|
+
* Parsing continues sequentially until:
|
|
101
|
+
* - Category type `0xFFFF` (END), or
|
|
102
|
+
* - Category type resolves to {@link SiiCategoryType.NOP}
|
|
103
|
+
*
|
|
104
|
+
* - Recognized categories are dispatched to dedicated parsers:
|
|
105
|
+
* - STRINGS → {@link parseSiiCategoryStrings}
|
|
106
|
+
* - GENERAL → {@link parseSiiCategoryGeneral}
|
|
107
|
+
* - FMMU → {@link parseSiiCategoryFmmu}
|
|
108
|
+
* - SYNC_M → {@link parseSiiCategorySyncManager}
|
|
109
|
+
* - RXPDO / TXPDO → {@link parseSiiCategoryPdo}
|
|
110
|
+
* - DC → {@link parseSiiCategoryDc}
|
|
111
|
+
*
|
|
112
|
+
* - Multiple PDO categories are supported and accumulated.
|
|
113
|
+
*
|
|
114
|
+
* @note
|
|
115
|
+
* - Unrecognized categories are skipped.
|
|
116
|
+
* - No validation is performed for:
|
|
117
|
+
* - Buffer size correctness
|
|
118
|
+
* - Category alignment or integrity
|
|
119
|
+
* - Semantic correctness of parsed values
|
|
120
|
+
*
|
|
121
|
+
* - String indices in parsed structures refer to entries from the STRINGS category.
|
|
122
|
+
*
|
|
123
|
+
* - This function assumes little-endian layout and native alignment as used by `python-struct`.
|
|
124
|
+
*/
|
|
47
125
|
function parseSiiBuffer(buffer) {
|
|
48
126
|
let strings = [];
|
|
49
127
|
let general = {
|
|
@@ -64,7 +142,8 @@ function parseSiiBuffer(buffer) {
|
|
|
64
142
|
};
|
|
65
143
|
let fmmus = [];
|
|
66
144
|
let syncManagers = [];
|
|
67
|
-
let
|
|
145
|
+
let rxPdos = [];
|
|
146
|
+
let txPdos = [];
|
|
68
147
|
let dcs = [];
|
|
69
148
|
const data = (0, python_struct_1.unpack)('@HHHHH4xHLLLL8xHHHHHHHHH66xHHHH', buffer);
|
|
70
149
|
const info = {
|
|
@@ -112,8 +191,11 @@ function parseSiiBuffer(buffer) {
|
|
|
112
191
|
else if (categoryType === SiiCategoryType.SYNC_M) {
|
|
113
192
|
syncManagers = parseSiiCategorySyncManager(categoryDataBuffer);
|
|
114
193
|
}
|
|
115
|
-
else if (categoryType === SiiCategoryType.RXPDO
|
|
116
|
-
|
|
194
|
+
else if (categoryType === SiiCategoryType.RXPDO) {
|
|
195
|
+
rxPdos.push(...parseSiiCategoryPdo(categoryDataBuffer));
|
|
196
|
+
}
|
|
197
|
+
else if (categoryType === SiiCategoryType.TXPDO) {
|
|
198
|
+
txPdos.push(...parseSiiCategoryPdo(categoryDataBuffer));
|
|
117
199
|
}
|
|
118
200
|
else if (categoryType === SiiCategoryType.DC) {
|
|
119
201
|
dcs = parseSiiCategoryDc(categoryDataBuffer);
|
|
@@ -130,12 +212,38 @@ function parseSiiBuffer(buffer) {
|
|
|
130
212
|
general,
|
|
131
213
|
fmmus,
|
|
132
214
|
syncManagers,
|
|
133
|
-
|
|
215
|
+
rxPdos,
|
|
216
|
+
txPdos,
|
|
134
217
|
distributedClocks: dcs,
|
|
135
218
|
},
|
|
136
219
|
};
|
|
137
220
|
}
|
|
138
221
|
exports.parseSiiBuffer = parseSiiBuffer;
|
|
222
|
+
/**
|
|
223
|
+
* Parse string table from SII (Category 10).
|
|
224
|
+
*
|
|
225
|
+
* @param buffer Raw category payload buffer.
|
|
226
|
+
* @returns Array of decoded strings.
|
|
227
|
+
*
|
|
228
|
+
* @remarks
|
|
229
|
+
* - The buffer layout is:
|
|
230
|
+
* - uint8 numberOfStrings
|
|
231
|
+
* - Repeated `numberOfStrings` times:
|
|
232
|
+
* - uint8 length
|
|
233
|
+
* - `length` bytes ASCII string (no null terminator)
|
|
234
|
+
*
|
|
235
|
+
* - Strings are stored sequentially and referenced by index from other categories.
|
|
236
|
+
* - The parser advances linearly using a pointer (`p`).
|
|
237
|
+
*
|
|
238
|
+
* - No bounds checking is performed:
|
|
239
|
+
* - Assumes `numberOfStrings` matches actual content.
|
|
240
|
+
* - Assumes each string length fits within the buffer.
|
|
241
|
+
*
|
|
242
|
+
* @note
|
|
243
|
+
* - Returned array is zero-based, while SII indices typically start from 1.
|
|
244
|
+
* Consumers may need to adjust indexing accordingly.
|
|
245
|
+
* - Encoding is assumed to be ASCII; no decoding/validation is performed.
|
|
246
|
+
*/
|
|
139
247
|
function parseSiiCategoryStrings(buffer) {
|
|
140
248
|
const numberOfStrings = buffer[0];
|
|
141
249
|
let p = 1;
|
|
@@ -148,6 +256,38 @@ function parseSiiCategoryStrings(buffer) {
|
|
|
148
256
|
}
|
|
149
257
|
return strings;
|
|
150
258
|
}
|
|
259
|
+
/**
|
|
260
|
+
* Parse General device information from SII (Category 30).
|
|
261
|
+
*
|
|
262
|
+
* @param buffer Raw category payload buffer.
|
|
263
|
+
* @returns Parsed general device information structure.
|
|
264
|
+
*
|
|
265
|
+
* @remarks
|
|
266
|
+
* - The structure is decoded using the format string `@12BhB1xHH12x`.
|
|
267
|
+
* - Layout (little-endian, native alignment via `@`):
|
|
268
|
+
* - uint8 groupIdx Index into string table (group)
|
|
269
|
+
* - uint8 imgIdx Index into string table (image)
|
|
270
|
+
* - uint8 orderIdx Index into string table (order number)
|
|
271
|
+
* - uint8 nameIdx Index into string table (device name)
|
|
272
|
+
* - uint8 coeDetails CoE capability flags
|
|
273
|
+
* - uint8 foeDetails FoE capability flags
|
|
274
|
+
* - uint8 eoeDetails EoE capability flags
|
|
275
|
+
* - uint8 soeChannels Number of SoE channels
|
|
276
|
+
* - uint8 ds402Channels Number of DS402 channels
|
|
277
|
+
* - uint8 sysmanClass Sync manager class
|
|
278
|
+
* - uint8 flags General device flags
|
|
279
|
+
* - uint8 currentOnEBus Current consumption on E-Bus (mA)
|
|
280
|
+
* - uint16 physicalPort Physical port configuration
|
|
281
|
+
* - uint16 physicalMemoryAddress Physical memory address
|
|
282
|
+
* - 12 bytes padding/reserved
|
|
283
|
+
*
|
|
284
|
+
* - The function assumes the buffer is correctly sized and aligned.
|
|
285
|
+
* - No validation is performed on buffer length or field values.
|
|
286
|
+
*
|
|
287
|
+
* @note
|
|
288
|
+
* - String indices reference entries from the STRINGS category (Category 10).
|
|
289
|
+
* - Capability fields (CoE, FoE, EoE) are bitfields and may require further decoding.
|
|
290
|
+
*/
|
|
151
291
|
function parseSiiCategoryGeneral(buffer) {
|
|
152
292
|
const data = (0, python_struct_1.unpack)('@12BhB1xHH12x', buffer);
|
|
153
293
|
return {
|
|
@@ -167,9 +307,46 @@ function parseSiiCategoryGeneral(buffer) {
|
|
|
167
307
|
physicalMemoryAddress: data[13],
|
|
168
308
|
};
|
|
169
309
|
}
|
|
310
|
+
/**
|
|
311
|
+
* Parse FMMU configuration entries from SII (Category 40).
|
|
312
|
+
*
|
|
313
|
+
* @param buffer Raw category payload buffer.
|
|
314
|
+
* @returns Array of 16-bit FMMU values.
|
|
315
|
+
*
|
|
316
|
+
* @remarks
|
|
317
|
+
* - The buffer is interpreted as a contiguous array of uint16 values.
|
|
318
|
+
* - Each value represents part of the FMMU configuration as defined in the SII.
|
|
319
|
+
* - The total number of entries is `buffer.length / 2`.
|
|
320
|
+
* - No structural decoding is performed; values are returned as raw words.
|
|
321
|
+
*
|
|
322
|
+
* @note
|
|
323
|
+
* - The caller is responsible for interpreting the returned values according
|
|
324
|
+
* to the EtherCAT FMMU configuration layout.
|
|
325
|
+
* - Buffer length must be even; otherwise unpacking will be invalid.
|
|
326
|
+
*/
|
|
170
327
|
function parseSiiCategoryFmmu(buffer) {
|
|
171
328
|
return (0, python_struct_1.unpack)(`@${buffer.length / 2}H`, buffer);
|
|
172
329
|
}
|
|
330
|
+
/**
|
|
331
|
+
* Parse Sync Manager definitions from SII (Category 41).
|
|
332
|
+
*
|
|
333
|
+
* @param buffer Raw category payload buffer.
|
|
334
|
+
* @returns Array of parsed Sync Manager elements.
|
|
335
|
+
*
|
|
336
|
+
* @remarks
|
|
337
|
+
* - Each Sync Manager entry is 8 bytes long.
|
|
338
|
+
* - Layout (little-endian, native alignment via `@`):
|
|
339
|
+
* - uint16 physicalStartAddress Start address in DPRAM
|
|
340
|
+
* - uint16 length Length in bytes
|
|
341
|
+
* - uint8 controlRegister Sync Manager control register value
|
|
342
|
+
* - uint8 statusRegister Sync Manager status register value
|
|
343
|
+
* - uint8 enableSyncManager Enable flag (non-zero = enabled)
|
|
344
|
+
* - uint8 syncManagerType Type (e.g. mailbox, process data)
|
|
345
|
+
*
|
|
346
|
+
* - The function iterates linearly over the buffer in 8-byte steps.
|
|
347
|
+
* - No validation is performed to ensure buffer length is a multiple of 8.
|
|
348
|
+
* Caller is responsible for providing a well-formed buffer.
|
|
349
|
+
*/
|
|
173
350
|
function parseSiiCategorySyncManager(buffer) {
|
|
174
351
|
const elements = [];
|
|
175
352
|
for (let i = 0; i < buffer.length; i += 8) {
|
|
@@ -185,6 +362,101 @@ function parseSiiCategorySyncManager(buffer) {
|
|
|
185
362
|
}
|
|
186
363
|
return elements;
|
|
187
364
|
}
|
|
365
|
+
/**
|
|
366
|
+
* Parse PDO definitions (RxPDO or TxPDO) from an SII category buffer.
|
|
367
|
+
*
|
|
368
|
+
* @param buffer Raw category payload buffer.
|
|
369
|
+
* @returns Array of parsed PDO elements.
|
|
370
|
+
*
|
|
371
|
+
* @remarks
|
|
372
|
+
* - The buffer contains a sequence of PDO blocks.
|
|
373
|
+
* - Each PDO consists of:
|
|
374
|
+
*
|
|
375
|
+
* PDO header (8 bytes):
|
|
376
|
+
* - uint16 pdoIndex PDO index (object dictionary)
|
|
377
|
+
* - uint8 nEntries Number of mapped entries
|
|
378
|
+
* - uint8 syncM Assigned Sync Manager
|
|
379
|
+
* - uint8 synchronization Synchronization type
|
|
380
|
+
* - uint8 nameIdx Index into string table (PDO name)
|
|
381
|
+
* - uint16 flags PDO flags
|
|
382
|
+
*
|
|
383
|
+
* Followed by `nEntries` PDO entry descriptors:
|
|
384
|
+
*
|
|
385
|
+
* PDO entry (8 bytes each):
|
|
386
|
+
* - uint16 entryIndex Object index
|
|
387
|
+
* - uint8 subindex Object subindex
|
|
388
|
+
* - uint8 entryNameIdx Index into string table
|
|
389
|
+
* - uint8 dataType EtherCAT data type
|
|
390
|
+
* - uint8 bitLen Bit length of the entry
|
|
391
|
+
* - uint16 flags Entry flags
|
|
392
|
+
*
|
|
393
|
+
* - Parsing continues until the buffer is exhausted.
|
|
394
|
+
* - A safety check prevents reading beyond buffer bounds for entries.
|
|
395
|
+
* - If the buffer is truncated, remaining entries in the current PDO are skipped.
|
|
396
|
+
*
|
|
397
|
+
* @note
|
|
398
|
+
* - `nEntry` reflects the declared number of entries, even if fewer were parsed
|
|
399
|
+
* due to buffer truncation.
|
|
400
|
+
* - No validation is performed for semantic correctness of indices or types.
|
|
401
|
+
*/
|
|
402
|
+
function parseSiiCategoryPdo(buffer) {
|
|
403
|
+
const pdos = [];
|
|
404
|
+
let offset = 0;
|
|
405
|
+
while (offset + 8 <= buffer.length) {
|
|
406
|
+
const pdoHeader = (0, python_struct_1.unpack)('@HBBBBH', buffer.subarray(offset, offset + 8));
|
|
407
|
+
const nEntries = pdoHeader[1];
|
|
408
|
+
const entries = [];
|
|
409
|
+
offset += 8;
|
|
410
|
+
for (let i = 0; i < nEntries; i++) {
|
|
411
|
+
if (offset + 8 > buffer.length) {
|
|
412
|
+
break; // Safety check
|
|
413
|
+
}
|
|
414
|
+
const entryData = (0, python_struct_1.unpack)('@HBBBBH', buffer.subarray(offset, offset + 8));
|
|
415
|
+
entries.push({
|
|
416
|
+
entryIndex: entryData[0],
|
|
417
|
+
subindex: entryData[1],
|
|
418
|
+
entryNameIdx: entryData[2],
|
|
419
|
+
dataType: entryData[3],
|
|
420
|
+
bitLen: entryData[4],
|
|
421
|
+
flags: entryData[5],
|
|
422
|
+
});
|
|
423
|
+
offset += 8;
|
|
424
|
+
}
|
|
425
|
+
pdos.push({
|
|
426
|
+
pdoIndex: pdoHeader[0],
|
|
427
|
+
nEntry: nEntries,
|
|
428
|
+
syncM: pdoHeader[2],
|
|
429
|
+
synchronization: pdoHeader[3],
|
|
430
|
+
nameIdx: pdoHeader[4],
|
|
431
|
+
flags: pdoHeader[5],
|
|
432
|
+
entries,
|
|
433
|
+
});
|
|
434
|
+
}
|
|
435
|
+
return pdos;
|
|
436
|
+
}
|
|
437
|
+
/**
|
|
438
|
+
* Parse Distributed Clocks (DC) configuration entries from SII (Category 60).
|
|
439
|
+
*
|
|
440
|
+
* @param buffer Raw category payload buffer.
|
|
441
|
+
* @returns Array of parsed Distributed Clock elements.
|
|
442
|
+
*
|
|
443
|
+
* @remarks
|
|
444
|
+
* - Each DC entry is 24 bytes long.
|
|
445
|
+
* - Layout (little-endian, native alignment via `@`):
|
|
446
|
+
* - uint32 cycleTime0 Sync0 cycle time (ns)
|
|
447
|
+
* - uint32 shiftTime0 Sync0 shift time (ns)
|
|
448
|
+
* - uint32 shiftTime1 Sync1 shift time (ns)
|
|
449
|
+
* - int16 sync1CycleFactor Sync1 cycle factor
|
|
450
|
+
* - uint16 assignActivate DC assign/activate register value
|
|
451
|
+
* - int16 sync0CycleFactor Sync0 cycle factor
|
|
452
|
+
* - uint8 nameIdx Index into string table (name)
|
|
453
|
+
* - uint8 descIdx Index into string table (description)
|
|
454
|
+
* - 4 bytes padding
|
|
455
|
+
*
|
|
456
|
+
* - The function iterates linearly over the buffer in 24-byte steps.
|
|
457
|
+
* - No bounds validation is performed beyond stride stepping.
|
|
458
|
+
* Caller must ensure buffer length is a multiple of 24.
|
|
459
|
+
*/
|
|
188
460
|
function parseSiiCategoryDc(buffer) {
|
|
189
461
|
const elements = [];
|
|
190
462
|
for (let i = 0; i < buffer.length; i += 24) {
|
|
@@ -202,18 +474,4 @@ function parseSiiCategoryDc(buffer) {
|
|
|
202
474
|
}
|
|
203
475
|
return elements;
|
|
204
476
|
}
|
|
205
|
-
// function parseSiiPdo(buffer: Buffer): SiiCategoryPdoElement[] {
|
|
206
|
-
// const data = unpack('@HBBBBH', buffer);
|
|
207
|
-
// return [];
|
|
208
|
-
// }
|
|
209
|
-
// function parseSiiPdoEntry(): SiiCategoryPdoEntryElement {
|
|
210
|
-
// return {
|
|
211
|
-
// bitLen: 0,
|
|
212
|
-
// dataType: 0,
|
|
213
|
-
// entryIndex: 0,
|
|
214
|
-
// entryNameIdx: 0,
|
|
215
|
-
// flags: 0,
|
|
216
|
-
// subindex: 0,
|
|
217
|
-
// };
|
|
218
|
-
// }
|
|
219
477
|
//# sourceMappingURL=sii.js.map
|
package/src/lib/sii.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"sii.js","sourceRoot":"","sources":["../../../../../libs/motion-master-client/src/lib/sii.ts"],"names":[],"mappings":";;;AAAA,iDAAuC;
|
|
1
|
+
{"version":3,"file":"sii.js","sourceRoot":"","sources":["../../../../../libs/motion-master-client/src/lib/sii.ts"],"names":[],"mappings":";;;AAAA,iDAAuC;AA6FvC,IAAY,eAqBX;AArBD,WAAY,eAAe;IACzB,mDAAO,CAAA;IACP,2EAAmB,CAAA;IACnB,4DAAY,CAAA;IACZ,kEAAe,CAAA;IACf,4DAAY,CAAA;IACZ,sDAAS,CAAA;IACT,0DAAW,CAAA;IACX,wDAAU,CAAA;IACV,gEAAc,CAAA;IACd,wDAAU,CAAA;IACV,wDAAU,CAAA;IACV,kDAAO,CAAA;IACP,8DAAa,CAAA;IACb,kEAAe,CAAA;IACf,8DAAa,CAAA;IACb,mFAAwB,CAAA;IACxB,2DAAY,CAAA;IACZ,8EAAwB,CAAA;IACxB,wFA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127,7 @@ export type StopCirculoEncoderNarrowAngleCalibrationProcedureRequest = MotionMas
|
|
|
127
127
|
export type StartOsCommandRequest = MotionMasterMessage.Request.IStartOsCommand & DeviceRefObj;
|
|
128
128
|
export type ExecuteForwardCallRequest = MotionMasterMessage.Request.IExecuteForwardCall & DeviceRefObj;
|
|
129
129
|
export type SetPdoModeRequest = MotionMasterMessage.Request.ISetPdoMode & DeviceRefObj;
|
|
130
|
+
export type GetDeviceSiiRequest = MotionMasterMessage.Request.IGetDeviceSii & DeviceRefObj;
|
|
130
131
|
export type SystemVersionStatus = MotionMasterMessage.Status.ISystemVersion & RequestStatusMessage;
|
|
131
132
|
export type SystemInformationStatus = MotionMasterMessage.Status.ISystemInformation & RequestStatusMessage;
|
|
132
133
|
export type DeviceInfoStatus = MotionMasterMessage.Status.IDeviceInfo & RequestStatusMessage;
|
|
@@ -161,6 +162,7 @@ export type CirculoEncoderConfigurationStatus = MotionMasterMessage.Status.ICirc
|
|
|
161
162
|
export type OsCommandStatus = MotionMasterMessage.Status.IOsCommand & RequestStatusMessage;
|
|
162
163
|
export type ForwardCallStatus = MotionMasterMessage.Status.IForwardCall & RequestStatusMessage;
|
|
163
164
|
export type PdoModeStatus = MotionMasterMessage.Status.IPdoMode & RequestStatusMessage;
|
|
165
|
+
export type DeviceSiiStatus = MotionMasterMessage.Status.IDeviceSii & RequestStatusMessage;
|
|
164
166
|
export import ValueType = MotionMasterMessage.Status.DeviceParameterInfo.Parameter.ValueType;
|
|
165
167
|
export declare function isArrayOfDeviceSerialNumbers(ids: DeviceParameterIds): ids is string[];
|
|
166
168
|
export declare function isObjectOfDeviceSerialNumberToValues(ids: {
|
|
@@ -559,3 +561,27 @@ export type SmmBinaryHeaderValues = [
|
|
|
559
561
|
crcA: number,
|
|
560
562
|
crcB: number
|
|
561
563
|
];
|
|
564
|
+
/**
|
|
565
|
+
* Represents the possible statuses of a progress step in a process.
|
|
566
|
+
*
|
|
567
|
+
* - `'idle'`: The step has not started yet.
|
|
568
|
+
* - `'running'`: The step is currently in progress.
|
|
569
|
+
* - `'succeeded'`: The step has completed successfully.
|
|
570
|
+
* - `'failed'`: The step has completed with an error.
|
|
571
|
+
*/
|
|
572
|
+
export type ProgressStepStatus = 'idle' | 'running' | 'succeeded' | 'failed';
|
|
573
|
+
/**
|
|
574
|
+
* Represents a single step in a progress sequence, typically used to track the status of multi-step operations.
|
|
575
|
+
*
|
|
576
|
+
* @property label - A human-readable label describing the step.
|
|
577
|
+
* @property status - The current status of the step, represented by a `ProgressStepStatus` value.
|
|
578
|
+
* @property value - Optional. An arbitrary value associated with the step, such as a result or intermediate data.
|
|
579
|
+
* @property error - Optional. An error message if the step encountered a problem.
|
|
580
|
+
*/
|
|
581
|
+
export interface ProgressStep<T = number> {
|
|
582
|
+
readonly id: string;
|
|
583
|
+
readonly label: string;
|
|
584
|
+
status: ProgressStepStatus;
|
|
585
|
+
value?: T;
|
|
586
|
+
error?: string;
|
|
587
|
+
}
|
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;AA6D1C,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;
|
|
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;AA6D1C,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;AAsGjG,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,CAClD,GAAwF;IAExF,OAAO,CAAC,KAAK,CAAC,OAAO,CAAC,GAAG,CAAC,CAAC;AAC7B,CAAC;AAJD,oFAIC;AAED,IAAY,4BAGX;AAHD,WAAY,4BAA4B;IACtC,mIAAkC,CAAA;IAClC,qJAA2C,CAAA;AAC7C,CAAC,EAHW,4BAA4B,GAA5B,oCAA4B,KAA5B,oCAA4B,QAGvC"}
|
package/src/lib/units.d.ts
CHANGED
|
@@ -135,14 +135,18 @@ export interface UnitConverters {
|
|
|
135
135
|
motorRatedCurrent: number;
|
|
136
136
|
}>;
|
|
137
137
|
friction: UnitConverter<unknown>;
|
|
138
|
+
inductance: UnitConverter<unknown>;
|
|
138
139
|
inertia: UnitConverter<unknown>;
|
|
139
140
|
position: UnitConverter<{
|
|
140
141
|
resolution: number;
|
|
141
142
|
feed?: number;
|
|
142
143
|
}>;
|
|
144
|
+
resistance: UnitConverter<unknown>;
|
|
143
145
|
torque: UnitConverter<{
|
|
144
146
|
motorRatedTorque: number;
|
|
147
|
+
motorRatedCurrent: number;
|
|
145
148
|
}>;
|
|
149
|
+
torqueConstant: UnitConverter<unknown>;
|
|
146
150
|
velocity: UnitConverter<{
|
|
147
151
|
siUnitVelocity: number;
|
|
148
152
|
feed?: number;
|
package/src/lib/units.js
CHANGED
|
@@ -345,6 +345,9 @@ exports.unitConverters = {
|
|
|
345
345
|
if (unit === 'mA') {
|
|
346
346
|
return (0, util_1.toFixedFormat)(Math.round((value / 1000) * data.motorRatedCurrent));
|
|
347
347
|
}
|
|
348
|
+
else if (unit === 'A') {
|
|
349
|
+
return (0, util_1.toFixedFormat)(Math.round(((value / 1000) * data.motorRatedCurrent) / 1000));
|
|
350
|
+
}
|
|
348
351
|
else {
|
|
349
352
|
return (0, util_1.toFixedFormat)(value);
|
|
350
353
|
}
|
|
@@ -352,12 +355,16 @@ exports.unitConverters = {
|
|
|
352
355
|
options: [
|
|
353
356
|
{ value: '‰', text: 'Per mille (native)' },
|
|
354
357
|
{ value: 'mA', text: 'Milliampere' },
|
|
358
|
+
{ value: 'A', text: 'Ampere' },
|
|
355
359
|
],
|
|
356
360
|
parser: (unit, value, data) => {
|
|
357
361
|
value = typeof value === 'string' ? parseFloat(value) : value;
|
|
358
362
|
if (unit === 'mA') {
|
|
359
363
|
return (value / data.motorRatedCurrent) * 1000;
|
|
360
364
|
}
|
|
365
|
+
else if (unit === 'A') {
|
|
366
|
+
return (value / data.motorRatedCurrent) * 1000 * 1000;
|
|
367
|
+
}
|
|
361
368
|
else {
|
|
362
369
|
return value;
|
|
363
370
|
}
|
|
@@ -426,6 +433,9 @@ exports.unitConverters = {
|
|
|
426
433
|
if (unit === 'deg') {
|
|
427
434
|
feed = 360;
|
|
428
435
|
}
|
|
436
|
+
else if (unit === 'mdeg') {
|
|
437
|
+
feed = 360000;
|
|
438
|
+
}
|
|
429
439
|
else if (unit === 'rev') {
|
|
430
440
|
feed = 1;
|
|
431
441
|
}
|
|
@@ -438,6 +448,7 @@ exports.unitConverters = {
|
|
|
438
448
|
options: [
|
|
439
449
|
{ value: 'inc', text: 'Increments (native)' },
|
|
440
450
|
{ value: 'deg', text: 'Degrees' },
|
|
451
|
+
{ value: 'mdeg', text: 'Millidegrees' },
|
|
441
452
|
{ value: 'rev', text: 'Revolutions' },
|
|
442
453
|
],
|
|
443
454
|
parser: (unit, value, data) => {
|
|
@@ -447,6 +458,9 @@ exports.unitConverters = {
|
|
|
447
458
|
if (unit === 'deg') {
|
|
448
459
|
feed = 360;
|
|
449
460
|
}
|
|
461
|
+
else if (unit === 'mdeg') {
|
|
462
|
+
feed = 360000;
|
|
463
|
+
}
|
|
450
464
|
else if (unit === 'rev') {
|
|
451
465
|
feed = 1;
|
|
452
466
|
}
|
|
@@ -457,6 +471,68 @@ exports.unitConverters = {
|
|
|
457
471
|
return Math.round((value / feed) * data.resolution);
|
|
458
472
|
},
|
|
459
473
|
},
|
|
474
|
+
resistance: {
|
|
475
|
+
id: 'resistance',
|
|
476
|
+
formatter: (unit, value) => {
|
|
477
|
+
if (unit === 'Ω') {
|
|
478
|
+
return (0, util_1.toFixedFormat)(value / 1000 / 1000);
|
|
479
|
+
}
|
|
480
|
+
else if (unit === 'mΩ') {
|
|
481
|
+
return (0, util_1.toFixedFormat)(value / 1000);
|
|
482
|
+
}
|
|
483
|
+
else {
|
|
484
|
+
return (0, util_1.toFixedFormat)(value);
|
|
485
|
+
}
|
|
486
|
+
},
|
|
487
|
+
options: [
|
|
488
|
+
{ value: 'μΩ', text: 'Microohm' },
|
|
489
|
+
{ value: 'mΩ', text: 'Milliohm' },
|
|
490
|
+
{ value: 'Ω', text: 'Ohm' },
|
|
491
|
+
],
|
|
492
|
+
parser: (unit, value) => {
|
|
493
|
+
value = typeof value === 'string' ? parseFloat(value) : value;
|
|
494
|
+
if (unit === 'Ω') {
|
|
495
|
+
return value * 1e6;
|
|
496
|
+
}
|
|
497
|
+
else if (unit === 'mΩ') {
|
|
498
|
+
return value * 1e3;
|
|
499
|
+
}
|
|
500
|
+
else {
|
|
501
|
+
return value;
|
|
502
|
+
}
|
|
503
|
+
},
|
|
504
|
+
},
|
|
505
|
+
inductance: {
|
|
506
|
+
id: 'inductance',
|
|
507
|
+
formatter: (unit, value) => {
|
|
508
|
+
if (unit === 'H') {
|
|
509
|
+
return (0, util_1.toFixedFormat)(value / 1000 / 1000);
|
|
510
|
+
}
|
|
511
|
+
else if (unit === 'mH') {
|
|
512
|
+
return (0, util_1.toFixedFormat)(value / 1000);
|
|
513
|
+
}
|
|
514
|
+
else {
|
|
515
|
+
return (0, util_1.toFixedFormat)(value);
|
|
516
|
+
}
|
|
517
|
+
},
|
|
518
|
+
options: [
|
|
519
|
+
{ value: 'μH', text: 'Microhenry' },
|
|
520
|
+
{ value: 'mH', text: 'Millihenry' },
|
|
521
|
+
{ value: 'H', text: 'Henry' },
|
|
522
|
+
],
|
|
523
|
+
parser: (unit, value) => {
|
|
524
|
+
value = typeof value === 'string' ? parseFloat(value) : value;
|
|
525
|
+
if (unit === 'H') {
|
|
526
|
+
return value * 1e6;
|
|
527
|
+
}
|
|
528
|
+
else if (unit === 'mH') {
|
|
529
|
+
return value * 1e3;
|
|
530
|
+
}
|
|
531
|
+
else {
|
|
532
|
+
return value;
|
|
533
|
+
}
|
|
534
|
+
},
|
|
535
|
+
},
|
|
460
536
|
torque: {
|
|
461
537
|
id: 'torque',
|
|
462
538
|
formatter: (unit, value, data) => {
|
|
@@ -481,6 +557,37 @@ exports.unitConverters = {
|
|
|
481
557
|
}
|
|
482
558
|
},
|
|
483
559
|
},
|
|
560
|
+
torqueConstant: {
|
|
561
|
+
id: 'torqueConstant',
|
|
562
|
+
formatter: (unit, value) => {
|
|
563
|
+
if (unit === 'Nm/A') {
|
|
564
|
+
return (0, util_1.toFixedFormat)(value / 1000 / 1000);
|
|
565
|
+
}
|
|
566
|
+
else if (unit === 'mNm/A') {
|
|
567
|
+
return (0, util_1.toFixedFormat)(value / 1000);
|
|
568
|
+
}
|
|
569
|
+
else {
|
|
570
|
+
return (0, util_1.toFixedFormat)(value);
|
|
571
|
+
}
|
|
572
|
+
},
|
|
573
|
+
options: [
|
|
574
|
+
{ value: 'μNm/A', text: 'Micronewton per ampere (RMS)' },
|
|
575
|
+
{ value: 'mNm/A', text: 'Millinewton per ampere (RMS)' },
|
|
576
|
+
{ value: 'Nm/A', text: 'Newton per ampere (RMS)' },
|
|
577
|
+
],
|
|
578
|
+
parser: (unit, value) => {
|
|
579
|
+
value = typeof value === 'string' ? parseFloat(value) : value;
|
|
580
|
+
if (unit === 'Nm/A') {
|
|
581
|
+
return value * 1e6;
|
|
582
|
+
}
|
|
583
|
+
else if (unit === 'mNm/A') {
|
|
584
|
+
return value * 1e3;
|
|
585
|
+
}
|
|
586
|
+
else {
|
|
587
|
+
return value;
|
|
588
|
+
}
|
|
589
|
+
},
|
|
590
|
+
},
|
|
484
591
|
velocity: {
|
|
485
592
|
id: 'velocity',
|
|
486
593
|
formatter: (unit, value, data) => {
|
|
@@ -538,16 +645,31 @@ exports.unitConverters = {
|
|
|
538
645
|
};
|
|
539
646
|
exports.unitConverterParameters = {
|
|
540
647
|
acceleration: exports.unitConverterAccelerationParameters,
|
|
541
|
-
current: [
|
|
648
|
+
current: [
|
|
649
|
+
[0x6073, 0],
|
|
650
|
+
[0x6075, 0], // Motor rated current
|
|
651
|
+
],
|
|
542
652
|
friction: [],
|
|
653
|
+
inductance: [
|
|
654
|
+
[0x2003, 4], // Phase inductance
|
|
655
|
+
],
|
|
543
656
|
inertia: [],
|
|
544
|
-
position:
|
|
657
|
+
position: [
|
|
658
|
+
...exports.unitConverterPositionParameters,
|
|
659
|
+
[0x2004, 8], // Minimum displacement (pin brake)
|
|
660
|
+
],
|
|
661
|
+
resistance: [
|
|
662
|
+
[0x2003, 3], // Phase resistance
|
|
663
|
+
],
|
|
545
664
|
torque: [
|
|
546
665
|
[0x6071, 0],
|
|
547
666
|
[0x6072, 0],
|
|
548
667
|
[0x6074, 0],
|
|
549
668
|
[0x6077, 0],
|
|
550
|
-
[0x60b2, 0],
|
|
669
|
+
[0x60b2, 0], // Torque offset
|
|
670
|
+
],
|
|
671
|
+
torqueConstant: [
|
|
672
|
+
[0x2003, 2], // Torque constant
|
|
551
673
|
],
|
|
552
674
|
velocity: exports.unitConverterVelocityParameters,
|
|
553
675
|
};
|