@synapticon/motion-master-client 6.0.0-alpha.88 → 6.0.0-alpha.90

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.
@@ -297,14 +297,29 @@ export declare class Api<SecurityDataType = unknown> extends HttpClient<Security
297
297
  * @example true
298
298
  */
299
299
  isCia402: boolean;
300
+ /**
301
+ * Whether the device is a SOMANET device, which runs SOMANET firmware. The server decides this from the vendor ID: Synapticon (0x22D2) or Sensodrive (0x063A). Gates the SOMANET features, such as the SOMANET files and the SOMANET procedures.
302
+ * @example true
303
+ */
304
+ isSomanet: boolean;
300
305
  /**
301
306
  * Whether an object-dictionary read for this device has failed since it was scanned. The automatic read on reaching a mailbox-active state is attempted once, so a device flagged here keeps an empty parameter list until `POST /api/devices/{slavePosition}/parameters/init` is called; that clears the flag on success.
302
307
  * @example false
303
308
  */
304
309
  parametersUnavailable: boolean;
310
+ /**
311
+ * Whether the device has an EtherCAT Slave Controller: SII, ESC registers, distributed clocks and the ESC diagnostics. False over SPoE, where those endpoints answer 409.
312
+ * @example true
313
+ */
314
+ supportsEsc?: boolean;
315
+ /**
316
+ * Whether the transport can blink the device's LEDs, which is what the `device-locate` procedure does. True over SPoE.
317
+ * @example false
318
+ */
319
+ supportsLocate?: boolean;
305
320
  }, void>>;
306
321
  /**
307
- * @description Constructs the requested fieldbus driver, opens the network interface, and makes the driver available for subsequent calls to /api/scan. The driver defaults to SOEM when omitted. SOEM has no adapter auto-detect: a network adapter must be supplied, otherwise init fails.
322
+ * @description Constructs the requested fieldbus driver and makes it available for subsequent calls to /api/scan. The body is the `fieldbus` block of the config file, and the same rules check it. The driver defaults to SOEM when omitted. SOEM opens the network interface. It has no adapter auto-detect: a network adapter must be supplied, otherwise init fails. SPoE connects to each drive at scan time. It needs `ipAddresses`, one address per drive, and the list order is the position order.
308
323
  *
309
324
  * @name Init
310
325
  * @summary Initialise the fieldbus driver
@@ -312,16 +327,42 @@ export declare class Api<SecurityDataType = unknown> extends HttpClient<Security
312
327
  */
313
328
  init: (data?: {
314
329
  /**
315
- * Fieldbus driver to use (only soem is implemented today; spoe is planned)
330
+ * Fieldbus driver to use
316
331
  * @default "soem"
317
332
  * @example "soem"
318
333
  */
319
334
  driver?: "soem" | "spoe";
320
335
  /**
321
- * Network interface name or MAC address. Required for SOEM — there is no auto-detect, so an empty value makes init fail.
336
+ * SOEM only. Network interface name or MAC address. Required for SOEM — there is no auto-detect, so an empty value makes init fail.
322
337
  * @example "eth0"
323
338
  */
324
339
  adapter?: string;
340
+ /**
341
+ * SPoE only. One IP address per drive, at least one. The list order is the position order, and a drive that does not answer keeps its position.
342
+ * @example ["192.168.0.10"]
343
+ */
344
+ ipAddresses?: string[];
345
+ /** SPoE only. */
346
+ spoe?: {
347
+ /**
348
+ * Who owns the drive's state. In `monitor` mode a PLC owns it, Motion Master only parametrises and observes, and a state change answers 409. In `control` mode Motion Master owns it.
349
+ * @default "monitor"
350
+ */
351
+ mode?: "monitor" | "control";
352
+ /**
353
+ * Control mode only. The drive faults when no SPoE message arrives for this long. At least 50. Firmware with SPoE protocol 1.0 cannot set it and uses a fixed watchdog.
354
+ * @min 50
355
+ * @default 75
356
+ */
357
+ watchdogMs?: number;
358
+ /**
359
+ * The TCP port of the SPoE server on every drive.
360
+ * @min 1
361
+ * @max 65535
362
+ * @default 8080
363
+ */
364
+ port?: number;
365
+ };
325
366
  }, params?: RequestParams) => Promise<import("./http-client.js").HttpResponse<{
326
367
  /** @example true */
327
368
  ok: boolean;
@@ -336,7 +377,7 @@ export declare class Api<SecurityDataType = unknown> extends HttpClient<Security
336
377
  error: string;
337
378
  }>>;
338
379
  /**
339
- * @description Scans the fieldbus for slaves and configures their sync managers and FMMUs. Must be called after a successful POST /api/init. Slaves remain in INIT state after this call; state transitions are driven by subsequent API calls. An empty bus is a successful scan returning 0 slaves, not an error: the master cannot distinguish a bus with no devices powered from a disconnected one, and the user recovers by powering devices on and scanning again. A 500 is returned only on a genuine driver failure (e.g. no driver initialised). A scan does not wait for work already in flight. A procedure that is running keeps running against the devices it started on, and fails at its next bus transfer. Retained procedure snapshots are discarded, because a position may name different hardware after a scan. A scan frees the recording, the retained process images and the previous device set, so it first waits up to 200 ms for the real-time loop to leave the cycle it is in. If the loop is stalled — a cyclic task that overruns, or severe CPU contention — the scan fails with 500 and changes nothing, rather than freeing memory the loop is still reading. `GET /api/game-loop` shows the stall. The same applies to `POST /api/process-data`, which re-allocates the recorder. `POST /api/reset` never fails this way: it holds the memory back instead and reclaims it later.
380
+ * @description Scans the fieldbus for slaves and configures their sync managers and FMMUs. Must be called after a successful POST /api/init. With SOEM, slaves remain in INIT state after this call, and state transitions are driven by subsequent API calls. An SPoE drive starts in OP. When a scan finds a device already in SAFE-OP or OP, it reads that device's object dictionary and publishes the process image, so the exchange starts with no state change. The dictionary comes from the parameter cache when the cache has it. Otherwise the first read of a drive model takes several seconds. If this step fails, the scan still returns 200 and the server logs a warning. A later state change to SAFE-OP or OP maps the image again. An empty bus is a successful scan returning 0 slaves, not an error: the master cannot distinguish a bus with no devices powered from a disconnected one, and the user recovers by powering devices on and scanning again. A 500 is returned only on a genuine driver failure (e.g. no driver initialised). A scan does not wait for work already in flight. A procedure that is running keeps running against the devices it started on, and fails at its next bus transfer. Retained procedure snapshots are discarded, because a position may name different hardware after a scan. A scan frees the recording, the retained process images and the previous device set, so it first waits up to 200 ms for the real-time loop to leave the cycle it is in. If the loop is stalled — a cyclic task that overruns, or severe CPU contention — the scan fails with 500 and changes nothing, rather than freeing memory the loop is still reading. `GET /api/game-loop` shows the stall. The same applies to `POST /api/process-data`, which re-allocates the recorder. `POST /api/reset` never fails this way: it holds the memory back instead and reclaims it later.
340
381
  *
341
382
  * @name Scan
342
383
  * @summary Scan the bus for slaves
@@ -659,6 +700,8 @@ export declare class Api<SecurityDataType = unknown> extends HttpClient<Security
659
700
  */
660
701
  data: number[];
661
702
  }, void | {
703
+ error: string;
704
+ } | {
662
705
  /**
663
706
  * Human-readable error message from the driver
664
707
  * @example "SDOread slave 1 0x2345:01 failed (no response — mailbox timeout)"
@@ -682,6 +725,8 @@ export declare class Api<SecurityDataType = unknown> extends HttpClient<Security
682
725
  /** @example true */
683
726
  ok: boolean;
684
727
  }, void | {
728
+ error: string;
729
+ } | {
685
730
  /**
686
731
  * Human-readable error message from the driver
687
732
  * @example "SDOread slave 1 0x2345:01 failed (no response — mailbox timeout)"
@@ -696,6 +741,8 @@ export declare class Api<SecurityDataType = unknown> extends HttpClient<Security
696
741
  * @request GET:/api/devices/{slavePosition}/watchdog
697
742
  */
698
743
  getProcessDataWatchdog: (slavePosition: number, params?: RequestParams) => Promise<import("./http-client.js").HttpResponse<ProcessDataWatchdog, void | {
744
+ error: string;
745
+ } | {
699
746
  /**
700
747
  * Human-readable error message from the driver
701
748
  * @example "SDOread slave 1 0x2345:01 failed (no response — mailbox timeout)"
@@ -717,6 +764,8 @@ export declare class Api<SecurityDataType = unknown> extends HttpClient<Security
717
764
  */
718
765
  timeoutMs: number;
719
766
  }, params?: RequestParams) => Promise<import("./http-client.js").HttpResponse<ProcessDataWatchdog, void | {
767
+ error: string;
768
+ } | {
720
769
  /**
721
770
  * Human-readable error message from the driver
722
771
  * @example "SDOread slave 1 0x2345:01 failed (no response — mailbox timeout)"
@@ -1053,6 +1102,8 @@ export declare class Api<SecurityDataType = unknown> extends HttpClient<Security
1053
1102
  * @request GET:/api/devices/{slavePosition}/sii
1054
1103
  */
1055
1104
  readSii: (slavePosition: number, params?: RequestParams) => Promise<import("./http-client.js").HttpResponse<SlaveInformationInterface, void | {
1105
+ error: string;
1106
+ } | {
1056
1107
  /**
1057
1108
  * Human-readable error message from the driver
1058
1109
  * @example "SDOread slave 1 0x2345:01 failed (no response — mailbox timeout)"
@@ -1070,6 +1121,8 @@ export declare class Api<SecurityDataType = unknown> extends HttpClient<Security
1070
1121
  /** @example true */
1071
1122
  ok?: boolean;
1072
1123
  }, void | {
1124
+ error: string;
1125
+ } | {
1073
1126
  /**
1074
1127
  * Human-readable error message from the driver
1075
1128
  * @example "SDOread slave 1 0x2345:01 failed (no response — mailbox timeout)"
@@ -1168,6 +1221,8 @@ export declare class Api<SecurityDataType = unknown> extends HttpClient<Security
1168
1221
  */
1169
1222
  positions?: string;
1170
1223
  }, params?: RequestParams) => Promise<import("./http-client.js").HttpResponse<DeviceDiagnostics[], void | {
1224
+ error: string;
1225
+ } | {
1171
1226
  /**
1172
1227
  * Human-readable error message from the driver
1173
1228
  * @example "SDOread slave 1 0x2345:01 failed (no response — mailbox timeout)"
@@ -1188,6 +1243,8 @@ export declare class Api<SecurityDataType = unknown> extends HttpClient<Security
1188
1243
  */
1189
1244
  positions?: string;
1190
1245
  }, params?: RequestParams) => Promise<import("./http-client.js").HttpResponse<DcSyncStatus[], void | {
1246
+ error: string;
1247
+ } | {
1191
1248
  /**
1192
1249
  * Human-readable error message from the driver
1193
1250
  * @example "SDOread slave 1 0x2345:01 failed (no response — mailbox timeout)"
@@ -1304,6 +1361,9 @@ export declare class Api<SecurityDataType = unknown> extends HttpClient<Security
1304
1361
  reached: boolean;
1305
1362
  }[];
1306
1363
  }, void | {
1364
+ /** Why the driver refuses state changes */
1365
+ error: string;
1366
+ } | {
1307
1367
  /**
1308
1368
  * Human-readable error message from the driver
1309
1369
  * @example "FPRD slave 1: wkc=0"
@@ -1362,11 +1422,26 @@ export declare class Api<SecurityDataType = unknown> extends HttpClient<Security
1362
1422
  * @example true
1363
1423
  */
1364
1424
  isCia402: boolean;
1425
+ /**
1426
+ * Whether the device is a SOMANET device, which runs SOMANET firmware. The server decides this from the vendor ID: Synapticon (0x22D2) or Sensodrive (0x063A). Gates the SOMANET features, such as the SOMANET files and the SOMANET procedures.
1427
+ * @example true
1428
+ */
1429
+ isSomanet: boolean;
1365
1430
  /**
1366
1431
  * Whether an object-dictionary read for this device has failed since it was scanned. The automatic read on reaching a mailbox-active state is attempted once, so a device flagged here keeps an empty parameter list until `POST /api/devices/{slavePosition}/parameters/init` is called; that clears the flag on success.
1367
1432
  * @example false
1368
1433
  */
1369
1434
  parametersUnavailable: boolean;
1435
+ /**
1436
+ * Whether the device has an EtherCAT Slave Controller: SII, ESC registers, distributed clocks and the ESC diagnostics. False over SPoE, where those endpoints answer 409.
1437
+ * @example true
1438
+ */
1439
+ supportsEsc?: boolean;
1440
+ /**
1441
+ * Whether the transport can blink the device's LEDs, which is what the `device-locate` procedure does. True over SPoE.
1442
+ * @example false
1443
+ */
1444
+ supportsLocate?: boolean;
1370
1445
  }[], any>>;
1371
1446
  /**
1372
1447
  * @description Returns the whole-bus process image: the byte sizes of each direction, the expected and last working counters and overall health, the number of retained image generations (one per re-map since the last reset), and every mapped object resolved to its absolute bit offset. While an image is live `configured` is true and the layout describes it. When no image is published (no device is in SAFE-OP/OP) but at least one generation has been mapped, `configured` is false and the layout describes the most recent retained generation — the last-known mapping — so a bus that has dropped out of SAFE-OP/OP stays inspectable; `lastWkc` then holds the final exchange value and working-counter health does not apply. The object lists are empty only before any image has ever been mapped. Object `name` is populated only for devices whose object dictionary has been enumerated.
@@ -1414,6 +1489,12 @@ export declare class Api<SecurityDataType = unknown> extends HttpClient<Security
1414
1489
  * @example 0
1415
1490
  */
1416
1491
  shortWkcCycles: number;
1492
+ /**
1493
+ * Input frames the driver dropped since the process data was configured, summed over all devices. Only a transport that buffers input frames can drop one: a SPoE drive returns its frames in batches, and the oldest are dropped when the real-time loop falls more than 30 cycles behind. Every other transport reports 0.
1494
+ * @format int64
1495
+ * @example 0
1496
+ */
1497
+ droppedInputFrames: number;
1417
1498
  /**
1418
1499
  * Epoch microseconds of the first such cycle, 0 if there has been none
1419
1500
  * @format int64
@@ -115,7 +115,7 @@ export class Api extends HttpClient {
115
115
  ...params,
116
116
  });
117
117
  /**
118
- * @description Constructs the requested fieldbus driver, opens the network interface, and makes the driver available for subsequent calls to /api/scan. The driver defaults to SOEM when omitted. SOEM has no adapter auto-detect: a network adapter must be supplied, otherwise init fails.
118
+ * @description Constructs the requested fieldbus driver and makes it available for subsequent calls to /api/scan. The body is the `fieldbus` block of the config file, and the same rules check it. The driver defaults to SOEM when omitted. SOEM opens the network interface. It has no adapter auto-detect: a network adapter must be supplied, otherwise init fails. SPoE connects to each drive at scan time. It needs `ipAddresses`, one address per drive, and the list order is the position order.
119
119
  *
120
120
  * @name Init
121
121
  * @summary Initialise the fieldbus driver
@@ -130,7 +130,7 @@ export class Api extends HttpClient {
130
130
  ...params,
131
131
  });
132
132
  /**
133
- * @description Scans the fieldbus for slaves and configures their sync managers and FMMUs. Must be called after a successful POST /api/init. Slaves remain in INIT state after this call; state transitions are driven by subsequent API calls. An empty bus is a successful scan returning 0 slaves, not an error: the master cannot distinguish a bus with no devices powered from a disconnected one, and the user recovers by powering devices on and scanning again. A 500 is returned only on a genuine driver failure (e.g. no driver initialised). A scan does not wait for work already in flight. A procedure that is running keeps running against the devices it started on, and fails at its next bus transfer. Retained procedure snapshots are discarded, because a position may name different hardware after a scan. A scan frees the recording, the retained process images and the previous device set, so it first waits up to 200 ms for the real-time loop to leave the cycle it is in. If the loop is stalled — a cyclic task that overruns, or severe CPU contention — the scan fails with 500 and changes nothing, rather than freeing memory the loop is still reading. `GET /api/game-loop` shows the stall. The same applies to `POST /api/process-data`, which re-allocates the recorder. `POST /api/reset` never fails this way: it holds the memory back instead and reclaims it later.
133
+ * @description Scans the fieldbus for slaves and configures their sync managers and FMMUs. Must be called after a successful POST /api/init. With SOEM, slaves remain in INIT state after this call, and state transitions are driven by subsequent API calls. An SPoE drive starts in OP. When a scan finds a device already in SAFE-OP or OP, it reads that device's object dictionary and publishes the process image, so the exchange starts with no state change. The dictionary comes from the parameter cache when the cache has it. Otherwise the first read of a drive model takes several seconds. If this step fails, the scan still returns 200 and the server logs a warning. A later state change to SAFE-OP or OP maps the image again. An empty bus is a successful scan returning 0 slaves, not an error: the master cannot distinguish a bus with no devices powered from a disconnected one, and the user recovers by powering devices on and scanning again. A 500 is returned only on a genuine driver failure (e.g. no driver initialised). A scan does not wait for work already in flight. A procedure that is running keeps running against the devices it started on, and fails at its next bus transfer. Retained procedure snapshots are discarded, because a position may name different hardware after a scan. A scan frees the recording, the retained process images and the previous device set, so it first waits up to 200 ms for the real-time loop to leave the cycle it is in. If the loop is stalled — a cyclic task that overruns, or severe CPU contention — the scan fails with 500 and changes nothing, rather than freeing memory the loop is still reading. `GET /api/game-loop` shows the stall. The same applies to `POST /api/process-data`, which re-allocates the recorder. `POST /api/reset` never fails this way: it holds the memory back instead and reclaims it later.
134
134
  *
135
135
  * @name Scan
136
136
  * @summary Scan the bus for slaves
@@ -954,6 +954,14 @@ export interface ProcedureRequest {
954
954
  * @example "all"
955
955
  */
956
956
  group?: "all" | "communication" | "application" | "manufacturer";
957
+ /**
958
+ * `device-locate` only: how long the LEDs blink, in seconds. They stop at the end, and when the run is cancelled. Only a device whose transport can blink the LEDs offers `device-locate`, which today is a SPoE drive.
959
+ * @min 1
960
+ * @max 3600
961
+ * @default 10
962
+ * @example 10
963
+ */
964
+ duration?: number;
957
965
  /** `firmware-installation`: the .zip firmware package, base64-encoded into this JSON string. One of this or a `packageFilename` naming an already-cached package must be present; this wins when both are given. To avoid base64 entirely, `PUT` the raw bytes to `/api/user-cache/firmwares/<name>.zip` first and then send only `packageFilename` — the firmware cache is that directory. (Deliberately not `format: byte`: that is the correct OpenAPI spelling for base64, but generators map it to a binary type — `Blob` in TypeScript — which is not what goes on the wire here and would serialise to `{}`.) */
958
966
  packageContent?: string;
959
967
  /**
@@ -972,7 +980,7 @@ export interface ProcedureRequest {
972
980
  */
973
981
  cachePackage?: boolean;
974
982
  /**
975
- * `firmware-installation`: where the device is left, as an AL state number — the same ETG.1000.6 encoding `POST /api/devices/state` takes and `alState` reports, so a client holds one way to name a state rather than two. `2` (PRE-OP) is the default and the confirmation that the install worked: the bootloader hands over to the newly written firmware on that transition, so reaching PRE-OP means the new firmware booted. No power cycle is needed for the firmware (an SII written from the package does need one — the ESC reads its EEPROM at reset). Choose `3` (BOOT) when no application will be present, after erasing one or between two installs, since a PRE-OP transition then has nothing to hand over to and the drive answers AL status `0x0014`, "No valid firmware". `4` and `8` climb through PRE-OP and re-map the whole bus on the way, briefly pausing every other device. The state the device was in beforehand is not restored.
983
+ * `firmware-installation`: where the device is left, as an AL state number — the same ETG.1000.6 encoding `POST /api/devices/state` takes and `alState` reports, so a client holds one way to name a state rather than two. `2` (PRE-OP) is the default and the confirmation that the install worked: the bootloader hands over to the newly written firmware on that transition, so reaching PRE-OP means the new firmware booted. No power cycle is needed for the firmware (an SII written from the package does need one — the ESC reads its EEPROM at reset). Choose `3` (BOOT) when no application will be present, after erasing one or between two installs, since a PRE-OP transition then has nothing to hand over to and the drive answers AL status `0x0014`, "No valid firmware". `4` and `8` climb through PRE-OP and re-map the whole bus on the way, briefly pausing every other device. The state the device was in beforehand is not restored. Over SPoE the drive restarts into the new firmware and comes up in PRE-OP, so `3` cannot keep it in BOOT.
976
984
  * @default 2
977
985
  * @example 2
978
986
  */
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@synapticon/motion-master-client",
3
- "version": "6.0.0-alpha.88",
3
+ "version": "6.0.0-alpha.90",
4
4
  "description": "Isomorphic TypeScript client for Motion Master: the generated HTTP API client, the WebSocket connection, and helpers.",
5
5
  "license": "MIT",
6
6
  "repository": {