@synapticon/motion-master-client 6.0.0-alpha.110 → 6.0.0-alpha.112

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.
@@ -1,4 +1,4 @@
1
- import { AlStatusCode, AutoTuningError, AutoTuningRunRequest, AutoTuningRunResponse, AutoTuningStatus, BrakeState, CaptureSummary, Cia402Status, DcSyncStatus, DeviceDiagnostics, DeviceFile, DeviceParameter, Encoders, EscRegister, EsiParseResult, FirmwareCompatibility, FirmwarePackageName, FoeErrorCode, GameLoopHealth, HardwareDescription, HrdRecording, IntegroVariant, IntegroVariantOption, MailboxErrorCode, Monitoring, ObjectDataTypeInfo, OperationModes, OutputStageResult, ParameterCacheEntry, ParameterValue, PdoMapping, PdoMappingRequest, ProcedureListing, ProcedureRequest, ProcedureSnapshot, ProcessDataWatchdog, ProcessImageObject, SdoAbortCode, SlaveConfig, SlaveInformationInterface, UserCacheListing } from "./data-contracts.js";
1
+ import { AlStatusCode, AutoTuningError, AutoTuningRunRequest, AutoTuningRunResponse, AutoTuningStatus, BrakeState, CaptureSummary, Cia402Status, DcSyncStatus, DeviceDiagnostics, DeviceFile, DeviceParameter, Encoders, EscRegister, EsiParseResult, FirmwareCompatibility, FirmwarePackageName, FoeErrorCode, GameLoopHealth, HardwareDescription, HrdRecording, IdentifiedPlantModel, IntegroVariant, IntegroVariantOption, MailboxErrorCode, Monitoring, ObjectDataTypeInfo, OperationModes, OutputStageResult, ParameterCacheEntry, ParameterValue, PdoMapping, PdoMappingRequest, ProcedureListing, ProcedureRequest, ProcedureSnapshot, ProcessDataWatchdog, ProcessImageObject, SdoAbortCode, SlaveConfig, SlaveInformationInterface, UserCacheListing } from "./data-contracts.js";
2
2
  import { HttpClient, RequestParams } from "./http-client.js";
3
3
  export declare class Api<SecurityDataType = unknown> extends HttpClient<SecurityDataType> {
4
4
  /**
@@ -1112,6 +1112,14 @@ export declare class Api<SecurityDataType = unknown> extends HttpClient<Security
1112
1112
  * @request GET:/api/devices/{slavePosition}/variant
1113
1113
  */
1114
1114
  getDeviceIntegroVariant: (slavePosition: number, params?: RequestParams) => Promise<import("./http-client.js").HttpResponse<IntegroVariant, void>>;
1115
+ /**
1116
+ * @description Reads and decodes the drive's `plant_model.csv` over FoE: the transfer function from torque in Nm to velocity in rad/s that the `plant-identification` procedure fitted, and the chirp it was identified with. Controller and notch filter auto-tuning compute from this model. **A 404 is the answer for a drive that was never identified.** The file is written by the procedure and by nothing else, so its absence is a state rather than a problem. The Bode data is not in the file; it is in the result of the run that produced the model.
1117
+ *
1118
+ * @name GetDevicePlantModel
1119
+ * @summary Read the plant model stored on a drive
1120
+ * @request GET:/api/devices/{slavePosition}/plant-model
1121
+ */
1122
+ getDevicePlantModel: (slavePosition: number, params?: RequestParams) => Promise<import("./http-client.js").HttpResponse<IdentifiedPlantModel, void>>;
1115
1123
  /**
1116
1124
  * @description Reads the device's `.hardware_description` and `.variant`, assembles the full firmware descriptors it accepts, and compares them against the descriptor in `filename`. **A mismatch is a `200` carrying `compatible: false`**, not an error status: the client asked a question and got an answer, and the body names both descriptors so it can say which hardware the package was for. A `4xx` means the question could not be asked — the filename is not a package name, or the hardware description could not be read. **Nothing acts on the answer.** The firmware installation procedure writes whatever it is given, on purpose, so this exists to tell a user before they start.
1117
1125
  *
@@ -1508,6 +1516,90 @@ export declare class Api<SecurityDataType = unknown> extends HttpClient<Security
1508
1516
  */
1509
1517
  error: string;
1510
1518
  }>>;
1519
+ /**
1520
+ * @description Commands one or more devices to INIT and then up to `target` one EtherCAT Application Layer state at a time: PRE-OP, SAFE-OP, OP. A `target` of BOOT is INIT and then BOOT. Each step blocks until every targeted device arrives or the timeout elapses, and the walk stops at the first step a device does not reach. `step` is the last state commanded, and `devices` holds the settled state of every targeted device after it, each with a `reached` flag. `ok` is true only when `step` is `target` and every device reached it. A restart drops every targeted device out of process data exchange, so a drive that was enabled is disabled, and a monitoring reports null for it until it exchanges again. The body is optional: no body restarts every discovered device to OP (8). State values are the standard AL state register encodings from ETG.1000.6: 1 (Init), 2 (PreOp), 3 (Boot), 4 (SafeOp), 8 (Op).
1521
+ *
1522
+ * @name RestartDevices
1523
+ * @summary Restart devices through INIT up to an AL state
1524
+ * @request POST:/api/devices/restart
1525
+ */
1526
+ restartDevices: (data?: {
1527
+ /**
1528
+ * 1-based slave positions to restart. Omit or pass an empty array to restart all discovered devices.
1529
+ * @example [1,2]
1530
+ */
1531
+ positions?: number[];
1532
+ /**
1533
+ * The EtherCAT AL state to end in (ETG.1000.6 AL control register encoding): 1 = Init, 2 = PreOp, 3 = Boot, 4 = SafeOp, 8 = Op.
1534
+ * @default 8
1535
+ * @example 8
1536
+ */
1537
+ target?: 1 | 2 | 3 | 4 | 8;
1538
+ /**
1539
+ * Maximum time to wait for all devices, in milliseconds, for each step
1540
+ * @default 5000
1541
+ * @example 5000
1542
+ */
1543
+ timeout?: number;
1544
+ }, params?: RequestParams) => Promise<import("./http-client.js").HttpResponse<{
1545
+ /**
1546
+ * True only when every targeted device reached `target`.
1547
+ * @example true
1548
+ */
1549
+ ok: boolean;
1550
+ /**
1551
+ * The last AL state the restart commanded. It is `target` when every device arrived, and the state a device fell short of otherwise.
1552
+ * @example 8
1553
+ */
1554
+ step: 1 | 2 | 3 | 4 | 8;
1555
+ /** Settled state of each targeted device, in the order targeted. */
1556
+ devices: {
1557
+ /**
1558
+ * 1-based position on the fieldbus
1559
+ * @example 1
1560
+ */
1561
+ slavePosition: number;
1562
+ /**
1563
+ * Raw AL Status register value (ETG.1000.6 §6.4.1). Bits 3:0 encode the state; bit 4 is the error indicator.
1564
+ * @example 2
1565
+ */
1566
+ alStatus: number;
1567
+ /**
1568
+ * Current AL state decoded from alStatus (ETG.1000.6 encoding): 1 = Init, 2 = PreOp, 3 = Boot, 4 = SafeOp, 8 = Op. 0 when the device does not answer (see `reachability`).
1569
+ * @example 2
1570
+ */
1571
+ alState: 0 | 1 | 2 | 3 | 4 | 8;
1572
+ /**
1573
+ * True when the AL Status error indicator bit (bit 4) is set
1574
+ * @example false
1575
+ */
1576
+ error: boolean;
1577
+ /**
1578
+ * AL Status Code register (ETG.1000.6 §6.4.1). Non-zero when error is true; identifies the error cause (e.g. 0x0014 = No valid firmware).
1579
+ * @example 0
1580
+ */
1581
+ alStatusCode: number;
1582
+ /**
1583
+ * Whether the device answers at the station address the master gave it. `addressLost`: nothing answers at that address, but a device answers at its wire position. A reset, such as a power cycle, clears the address. Run `POST /api/scan` to command it again. `notAnswering`: nothing answers at that address or at its wire position. Check the cabling and the power. If devices were removed from the chain, run a scan. The wire position is checked by position only, so after a change to the chain the device that answers there can be a different one. When the value is not `answering`, the state of the device is unknown, and `alStatus`, `alState` and `alStatusCode` are 0.
1584
+ * @example "answering"
1585
+ */
1586
+ reachability: "answering" | "addressLost" | "notAnswering";
1587
+ /**
1588
+ * True when this device reached `step` (error clear and alState equal to `step`).
1589
+ * @example true
1590
+ */
1591
+ reached: boolean;
1592
+ }[];
1593
+ }, void | {
1594
+ /** Why the driver refuses state changes */
1595
+ error: string;
1596
+ } | {
1597
+ /**
1598
+ * Human-readable error message from the driver
1599
+ * @example "FPRD slave 1: wkc=0"
1600
+ */
1601
+ error: string;
1602
+ }>>;
1511
1603
  /**
1512
1604
  * No description
1513
1605
  *
@@ -1817,7 +1909,7 @@ export declare class Api<SecurityDataType = unknown> extends HttpClient<Security
1817
1909
  */
1818
1910
  deleteMonitoring: (topic: string, params?: RequestParams) => Promise<import("./http-client.js").HttpResponse<void, void>>;
1819
1911
  /**
1820
- * @description Returns one entry per cached parameter-definition file on disk, keyed by device identity (vendor, product, revision). The cache stores only the object-dictionary *definitions* (not live values), so a scan of previously-seen hardware can skip the slow SDO enumeration. Independent of the bus — works whether or not a driver is initialised.
1912
+ * @description Returns one entry per cached parameter-definition file on disk, keyed by vendor ID, product code and firmware version (object 0x100A). A device without 0x100A is not cached. The cache stores only the object-dictionary *definitions* (not live values), so a scan of previously-seen hardware can skip the slow SDO enumeration. Independent of the bus — works whether or not a driver is initialised.
1821
1913
  *
1822
1914
  * @name ListParameterCacheEntries
1823
1915
  * @summary List on-disk parameter caches
@@ -1833,7 +1925,7 @@ export declare class Api<SecurityDataType = unknown> extends HttpClient<Security
1833
1925
  */
1834
1926
  getParameterCache: (id: string, params?: RequestParams) => Promise<import("./http-client.js").HttpResponse<object, void>>;
1835
1927
  /**
1836
- * @description Removes one cached file from disk. The next scan of that hardware re-enumerates it. Useful when a vendor reused a revision across an object-dictionary change.
1928
+ * @description Removes one cached file from disk. The next scan of that hardware re-enumerates it. Useful when a firmware changed its object dictionary and kept its version string.
1837
1929
  *
1838
1930
  * @name DeleteParameterCache
1839
1931
  * @summary Delete a parameter-cache file
@@ -765,6 +765,19 @@ export class Api extends HttpClient {
765
765
  format: "json",
766
766
  ...params,
767
767
  });
768
+ /**
769
+ * @description Reads and decodes the drive's `plant_model.csv` over FoE: the transfer function from torque in Nm to velocity in rad/s that the `plant-identification` procedure fitted, and the chirp it was identified with. Controller and notch filter auto-tuning compute from this model. **A 404 is the answer for a drive that was never identified.** The file is written by the procedure and by nothing else, so its absence is a state rather than a problem. The Bode data is not in the file; it is in the result of the run that produced the model.
770
+ *
771
+ * @name GetDevicePlantModel
772
+ * @summary Read the plant model stored on a drive
773
+ * @request GET:/api/devices/{slavePosition}/plant-model
774
+ */
775
+ getDevicePlantModel = (slavePosition, params = {}) => this.request({
776
+ path: `/api/devices/${slavePosition}/plant-model`,
777
+ method: "GET",
778
+ format: "json",
779
+ ...params,
780
+ });
768
781
  /**
769
782
  * @description Reads the device's `.hardware_description` and `.variant`, assembles the full firmware descriptors it accepts, and compares them against the descriptor in `filename`. **A mismatch is a `200` carrying `compatible: false`**, not an error status: the client asked a question and got an answer, and the body names both descriptors so it can say which hardware the package was for. A `4xx` means the question could not be asked — the filename is not a package name, or the hardware description could not be read. **Nothing acts on the answer.** The firmware installation procedure writes whatever it is given, on purpose, so this exists to tell a user before they start.
770
783
  *
@@ -1029,6 +1042,21 @@ export class Api extends HttpClient {
1029
1042
  format: "json",
1030
1043
  ...params,
1031
1044
  });
1045
+ /**
1046
+ * @description Commands one or more devices to INIT and then up to `target` one EtherCAT Application Layer state at a time: PRE-OP, SAFE-OP, OP. A `target` of BOOT is INIT and then BOOT. Each step blocks until every targeted device arrives or the timeout elapses, and the walk stops at the first step a device does not reach. `step` is the last state commanded, and `devices` holds the settled state of every targeted device after it, each with a `reached` flag. `ok` is true only when `step` is `target` and every device reached it. A restart drops every targeted device out of process data exchange, so a drive that was enabled is disabled, and a monitoring reports null for it until it exchanges again. The body is optional: no body restarts every discovered device to OP (8). State values are the standard AL state register encodings from ETG.1000.6: 1 (Init), 2 (PreOp), 3 (Boot), 4 (SafeOp), 8 (Op).
1047
+ *
1048
+ * @name RestartDevices
1049
+ * @summary Restart devices through INIT up to an AL state
1050
+ * @request POST:/api/devices/restart
1051
+ */
1052
+ restartDevices = (data, params = {}) => this.request({
1053
+ path: `/api/devices/restart`,
1054
+ method: "POST",
1055
+ body: data,
1056
+ type: ContentType.Json,
1057
+ format: "json",
1058
+ ...params,
1059
+ });
1032
1060
  /**
1033
1061
  * No description
1034
1062
  *
@@ -1202,7 +1230,7 @@ export class Api extends HttpClient {
1202
1230
  ...params,
1203
1231
  });
1204
1232
  /**
1205
- * @description Returns one entry per cached parameter-definition file on disk, keyed by device identity (vendor, product, revision). The cache stores only the object-dictionary *definitions* (not live values), so a scan of previously-seen hardware can skip the slow SDO enumeration. Independent of the bus — works whether or not a driver is initialised.
1233
+ * @description Returns one entry per cached parameter-definition file on disk, keyed by vendor ID, product code and firmware version (object 0x100A). A device without 0x100A is not cached. The cache stores only the object-dictionary *definitions* (not live values), so a scan of previously-seen hardware can skip the slow SDO enumeration. Independent of the bus — works whether or not a driver is initialised.
1206
1234
  *
1207
1235
  * @name ListParameterCacheEntries
1208
1236
  * @summary List on-disk parameter caches
@@ -1228,7 +1256,7 @@ export class Api extends HttpClient {
1228
1256
  ...params,
1229
1257
  });
1230
1258
  /**
1231
- * @description Removes one cached file from disk. The next scan of that hardware re-enumerates it. Useful when a vendor reused a revision across an object-dictionary change.
1259
+ * @description Removes one cached file from disk. The next scan of that hardware re-enumerates it. Useful when a firmware changed its object dictionary and kept its version string.
1232
1260
  *
1233
1261
  * @name DeleteParameterCache
1234
1262
  * @summary Delete a parameter-cache file
@@ -232,8 +232,8 @@ export interface UserCacheFile {
232
232
  /** Summary of one on-disk parameter-cache file (its identity, size, and count). */
233
233
  export interface ParameterCacheEntry {
234
234
  /**
235
- * Opaque key addressing this cache file in the download/delete endpoints ("<vendor>-<product>-<revision>"). Use it verbatim — do not construct it client-side.
236
- * @example "000022d2-00000201-0000000a"
235
+ * Opaque key addressing this cache file in the download/delete endpoints ("<vendor>-<product>-<version>", the version reduced to URL-safe characters). Use it verbatim — do not construct it client-side.
236
+ * @example "000022d2-00000201-v5.6.6"
237
237
  */
238
238
  id: string;
239
239
  /**
@@ -247,10 +247,10 @@ export interface ParameterCacheEntry {
247
247
  */
248
248
  productCode: number;
249
249
  /**
250
- * Revision number.
251
- * @example 10
250
+ * The device's firmware version (0x100A) the file was written for, in full.
251
+ * @example "v5.6.6"
252
252
  */
253
- revisionNumber: number;
253
+ firmwareVersion: string;
254
254
  /**
255
255
  * Number of cached parameter definitions in the file.
256
256
  * @example 312
@@ -878,6 +878,36 @@ export interface IntegroVariantOption {
878
878
  }
879
879
  /** One option code from a decoded file, expanded into its catalogue entry. Everything but `id` is absent for a code the catalogue does not name, so "we do not know what this is" is missing properties rather than the string `unknown`. */
880
880
  export type IntegroVariantFileOption = UtilRequiredKeys<IntegroVariantOption, "id">;
881
+ /**
882
+ * A plant model as plant identification stored it on the drive: the transfer function from torque in Nm to velocity in rad/s, coefficients highest order first and normalised so that the numerator's last coefficient is 1, and the chirp it was identified with. The last two denominator coefficients are the effective inertia and the effective viscous friction of the reduced model, which is how auto-tuning reads them.
883
+ * @example {"numerator":[1],"denominator":[0.000123,0.0456],"inertia":0.000123,"friction":0.0456,"chirp":{"startFrequencyHz":1,"endFrequencyHz":100,"amplitudePermil":300,"durationMs":3000,"signalType":"logarithmic"}}
884
+ */
885
+ export interface IdentifiedPlantModel {
886
+ numerator: number[];
887
+ denominator: number[];
888
+ /**
889
+ * The denominator coefficient before the last; null when there are fewer than two
890
+ * @format double
891
+ */
892
+ inertia: number | null;
893
+ /**
894
+ * The last denominator coefficient; null when the denominator is empty
895
+ * @format double
896
+ */
897
+ friction: number | null;
898
+ /** What excited the plant. A file written without a chirp row reads back with zeros and the logarithmic type. */
899
+ chirp: {
900
+ /** @format double */
901
+ startFrequencyHz: number;
902
+ /** @format double */
903
+ endFrequencyHz: number;
904
+ /** Peak excitation, in per mille of rated torque */
905
+ amplitudePermil: number;
906
+ /** How long the sweep took */
907
+ durationMs: number;
908
+ signalType: "logarithmic" | "linear";
909
+ };
910
+ }
881
911
  /**
882
912
  * A decoded `.variant` file: which features a SOMANET Integro was licensed with.
883
913
  *
@@ -988,7 +1018,7 @@ export interface ProcedureRequest {
988
1018
  */
989
1019
  pollIntervalMs?: number;
990
1020
  /**
991
- * `os-command` only: whether the command moves bulk data through the drive's fs-buffer, and which way. Most commands move none. The transfer runs while the command runs, because the drive holds the command in progress until all the data has moved, and it needs firmware 5.2 or newer. Setting a direction for a command that moves no bulk data leaves the server waiting for a transfer the drive will never start.
1021
+ * `os-command` only: whether the command moves bulk data through the drive's fs-buffer, and which way. Most commands move none. A write runs while the command runs, because the command reads its input as it arrives, and it needs firmware 5.2 or newer. A read runs after the command succeeds, because the command completes when its whole output is in the fs-buffer. No read runs after a failure. An output larger than the 2024-byte fs-buffer cannot be read: the command waits for the master to empty it and runs into its timeout. Setting a direction for a command that moves no bulk data makes the transfer wait for an answer the drive never sends.
992
1022
  * @default "none"
993
1023
  * @example "read"
994
1024
  */
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@synapticon/motion-master-client",
3
- "version": "6.0.0-alpha.110",
3
+ "version": "6.0.0-alpha.112",
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": {