@synapticon/motion-master-client 6.0.0-alpha.64 → 6.0.0-alpha.66
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/dist/generated/Api.d.ts +40 -54
- package/dist/generated/Api.js +42 -27
- package/dist/generated/data-contracts.d.ts +232 -2
- package/dist/index.d.ts +0 -1
- package/dist/index.js +0 -1
- package/package.json +1 -1
- package/dist/somanet.d.ts +0 -5
- package/dist/somanet.js +0 -15
package/dist/generated/Api.d.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { AlStatusCode, BrakeState, Cia402Status, DcSyncStatus, DeviceDiagnostics, DeviceParameter, EscRegister, EsiParseResult, FoeErrorCode, GameLoopHealth, MailboxErrorCode, Monitoring, ObjectDataTypeInfo, OutputStageResult, ParameterCacheEntry, PdoMapping, PdoMappingRequest, ProcedureListing, ProcedureRequest, ProcedureSnapshot, ProcessDataWatchdog, ProcessImageObject, SdoAbortCode, SlaveConfig, SlaveInformationInterface, UserCacheListing } from "./data-contracts.js";
|
|
1
|
+
import { AlStatusCode, BrakeState, Cia402Status, DcSyncStatus, DeviceDiagnostics, DeviceFile, DeviceParameter, EscRegister, EsiParseResult, FirmwarePackageName, FoeErrorCode, GameLoopHealth, HrdRecording, MailboxErrorCode, Monitoring, ObjectDataTypeInfo, OutputStageResult, ParameterCacheEntry, 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
|
/**
|
|
@@ -671,7 +671,7 @@ export declare class Api<SecurityDataType = unknown> extends HttpClient<Security
|
|
|
671
671
|
*/
|
|
672
672
|
listProcedures: (slavePosition: number, params?: RequestParams) => Promise<import("./http-client.js").HttpResponse<ProcedureListing[], void>>;
|
|
673
673
|
/**
|
|
674
|
-
* @description Starts the named procedure and returns as soon as the run is under way — this does **not** wait for it to finish. Poll `GET` on the same path for its outcome, or `DELETE` to cancel it. The request body carries the procedure's parameters
|
|
674
|
+
* @description Starts the named procedure and returns as soon as the run is under way — this does **not** wait for it to finish. Poll `GET` on the same path for its outcome, or `DELETE` to cancel it. The request body carries the procedure's parameters, and each descriptor from `GET /api/devices/{slavePosition}/procedures` reports its own in `parameters` — name, type, bounds, default, and whether it is required — which is enough to build a form for any procedure without hard-coding one per name. A procedure that takes no parameters may be started with no body. Only one procedure may run on a device at a time; a second start is refused with 409 while the first is in flight. Most procedures require an active mailbox, so the device must be in PRE-OP, SAFE-OP or OP. A run the drive answers with an error is not a failure of *this* request — it is reported in the snapshot as a failed run.
|
|
675
675
|
*
|
|
676
676
|
* @name StartProcedure
|
|
677
677
|
* @summary Start a procedure on a device
|
|
@@ -702,6 +702,20 @@ export declare class Api<SecurityDataType = unknown> extends HttpClient<Security
|
|
|
702
702
|
* @request GET:/api/devices/{slavePosition}/brake
|
|
703
703
|
*/
|
|
704
704
|
getBrake: (slavePosition: number, params?: RequestParams) => Promise<import("./http-client.js").HttpResponse<BrakeState, void>>;
|
|
705
|
+
/**
|
|
706
|
+
* @description Reads the files the `hrd-streaming` procedure recorded, concatenates them in order and decodes them into samples. Run that procedure first; this endpoint only reads what is already on the drive. **`data` is required and must match what was recorded.** Nothing on the drive says which signal its files hold, so the wrong selection reinterprets the same bytes as a different layout and returns plausible nonsense. The procedure's `configure-stream` step reports the selection it used for exactly this reason. Samples travel positionally — `columns` names the fields of each row, once, the way a monitoring topic ships its parameter order once — because a full recording is up to ten thousand rows. `trailingBytes` is what was left over past the last whole sample: the drive allocates its files in fixed-size blocks, so a recording that does not fill the last block ends in padding rather than data. Answers **JSON or CSV**, chosen by the `Accept` header. CSV is the same numbers in the same column order, one header row then one row per sample — a file to open in a spreadsheet rather than JSON to read, which for ten thousand rows is usually what is wanted. Values are decoded, not raw: `velocityRpm` is converted out of the file's Q15 fixed point (exactly — multiply by 32768 to recover the stored integer), while `torquePermil` and the encoder's `raw` word are the file's own values. Blocks for the transfer, which is up to five 8 KB FoE reads plus the listing.
|
|
707
|
+
*
|
|
708
|
+
* @name ReadHrdRecording
|
|
709
|
+
* @summary Read back a drive's high resolution data recording
|
|
710
|
+
* @request GET:/api/devices/{slavePosition}/hrd
|
|
711
|
+
*/
|
|
712
|
+
readHrdRecording: (slavePosition: number, query: {
|
|
713
|
+
/**
|
|
714
|
+
* Which layout the files hold — the same selection the recording was made with.
|
|
715
|
+
* @example "encoder-raw"
|
|
716
|
+
*/
|
|
717
|
+
data: "encoder-raw" | "system-identification";
|
|
718
|
+
}, params?: RequestParams) => Promise<import("./http-client.js").HttpResponse<HrdRecording, void>>;
|
|
705
719
|
/**
|
|
706
720
|
* @description Writes "disengaged" to the brake state object (0x2004:07) and waits the drive's pull time (0x2004:03) plus `settle` before answering, because the firmware blocks motion — and motion-related OS commands — until the pull time expires. Answers with the brake state read back. **The release only actually happens while the drive is in OP ENABLED.** In any other state the write merely energises the brake output (phase D). Note also that entering OP ENABLED releases the brake automatically in normal operation but **not** in diagnostics mode, where the master owns the brake — which is why a diagnostics procedure has to call this. **On a pin brake this moves the shaft**: the controller raises current progressively until the load has lifted off the pin by the minimum displacement (0x2004:08), reversing direction if it reaches the current ceiling (0x2004:09, a percentage of rated current) first. Check `releaseMovesShaft` on `GET .../brake`. Brake release is open-loop — nothing confirms the brake let go — so the wait is the only margin there is. A brake whose release strategy is `manualOutputVoltage` is left alone and the returned state says so; that is not an error. **A released brake stays released**: nothing re-engages it for you, so on a vertical or loaded axis engage it again when you are done.
|
|
707
721
|
*
|
|
@@ -734,58 +748,6 @@ export declare class Api<SecurityDataType = unknown> extends HttpClient<Security
|
|
|
734
748
|
*/
|
|
735
749
|
settle?: number;
|
|
736
750
|
}, params?: RequestParams) => Promise<import("./http-client.js").HttpResponse<BrakeState, void>>;
|
|
737
|
-
/**
|
|
738
|
-
* @description Commands the device to persist its current parameters (the generic CANopen "store parameters" object 0x1010:01) and waits for confirmation. The server writes the ASCII "save" signature, waits a fixed settle (~1 s) for the drive to begin the flash write, then polls 0x1010:01 until it reads back 1 ("save completed"). Because a store in progress can leave the mailbox briefly unresponsive, a poll that does not yet confirm — a value mismatch or a transient read error alike — is retried up to `retries` more times, `interval` apart. The call blocks until the store is confirmed or the retry budget is exhausted (up to a few seconds); the device's mailbox must be active (PRE-OP/SAFE-OP/OP).
|
|
739
|
-
*
|
|
740
|
-
* @name StoreParameters
|
|
741
|
-
* @summary Store a device's parameters to non-volatile memory
|
|
742
|
-
* @request POST:/api/devices/{slavePosition}/store-parameters
|
|
743
|
-
*/
|
|
744
|
-
storeParameters: (slavePosition: number, query?: {
|
|
745
|
-
/**
|
|
746
|
-
* Maximum number of extra confirmation polls after the first.
|
|
747
|
-
* @min 0
|
|
748
|
-
* @default 10
|
|
749
|
-
* @example 5
|
|
750
|
-
*/
|
|
751
|
-
retries?: number;
|
|
752
|
-
/**
|
|
753
|
-
* Delay between confirmation polls, in milliseconds.
|
|
754
|
-
* @min 0
|
|
755
|
-
* @default 500
|
|
756
|
-
* @example 500
|
|
757
|
-
*/
|
|
758
|
-
interval?: number;
|
|
759
|
-
}, params?: RequestParams) => Promise<import("./http-client.js").HttpResponse<void, void>>;
|
|
760
|
-
/**
|
|
761
|
-
* @description Commands the device to restore its default parameters (the generic CANopen "restore default parameters" object 0x1011) for the selected `group`, and waits for confirmation. The server writes the ASCII "load" signature to the matching 0x1011 sub-entry, waits a fixed settle (~1 s) for the device to begin, then polls that sub-entry until it reads back 1 ("restore completed"), retrying a poll that does not yet confirm — a value mismatch or a transient read error alike — up to `retries` more times, `interval` apart. The call blocks until the restore is confirmed or the retry budget is exhausted (up to a few seconds); the device's mailbox must be active (PRE-OP/SAFE-OP/OP). **Destructive:** this overwrites the selected group's parameter values in the device's volatile memory with the device's defaults, replacing the current live values (not the persisted store). Which values it touches, and whether it takes effect immediately or after the next reset, is device-specific.
|
|
762
|
-
*
|
|
763
|
-
* @name RestoreDefaultParameters
|
|
764
|
-
* @summary Restore a device's default parameters
|
|
765
|
-
* @request POST:/api/devices/{slavePosition}/restore-default-parameters
|
|
766
|
-
*/
|
|
767
|
-
restoreDefaultParameters: (slavePosition: number, query?: {
|
|
768
|
-
/**
|
|
769
|
-
* Which group of defaults to restore — all (0x1011:01), communication (0x1011:02), application (0x1011:03), or manufacturer (0x1011:04).
|
|
770
|
-
* @default "all"
|
|
771
|
-
* @example "all"
|
|
772
|
-
*/
|
|
773
|
-
group?: "all" | "communication" | "application" | "manufacturer";
|
|
774
|
-
/**
|
|
775
|
-
* Maximum number of extra confirmation polls after the first.
|
|
776
|
-
* @min 0
|
|
777
|
-
* @default 10
|
|
778
|
-
* @example 5
|
|
779
|
-
*/
|
|
780
|
-
retries?: number;
|
|
781
|
-
/**
|
|
782
|
-
* Delay between confirmation polls, in milliseconds.
|
|
783
|
-
* @min 0
|
|
784
|
-
* @default 500
|
|
785
|
-
* @example 500
|
|
786
|
-
*/
|
|
787
|
-
interval?: number;
|
|
788
|
-
}, params?: RequestParams) => Promise<import("./http-client.js").HttpResponse<void, void>>;
|
|
789
751
|
/**
|
|
790
752
|
* @description Performs a CoE SDO upload — reads the value of object `index:subindex` from the device at `slavePosition` and returns the raw bytes as a JSON array. Both `index` and `subindex` accept decimal or hexadecimal notation; prefix with `0x` for hex (e.g. `0x6064` or `24676` for object 0x6064).
|
|
791
753
|
*
|
|
@@ -829,6 +791,16 @@ export declare class Api<SecurityDataType = unknown> extends HttpClient<Security
|
|
|
829
791
|
*/
|
|
830
792
|
error: string;
|
|
831
793
|
}>>;
|
|
794
|
+
/**
|
|
795
|
+
* @description Lists what the device holds — firmware images, the ESI, logs, configuration and any high resolution data recording — with the size it reports for each. **Vendor-specific despite reading like a filesystem listing.** EtherCAT defines no directory service, so SOMANET firmware serves its own as a pseudo-file (`fs-getlist`) read over FoE. A device that is not a SOMANET drive is refused rather than probed. `byteCount` is absent when the device reported a name without a size, which is a formatting quirk of one entry rather than a reason to hide the file.
|
|
796
|
+
*
|
|
797
|
+
* @name ListDeviceFiles
|
|
798
|
+
* @summary List the files stored on a device
|
|
799
|
+
* @request GET:/api/devices/{slavePosition}/files
|
|
800
|
+
*/
|
|
801
|
+
listDeviceFiles: (slavePosition: number, params?: RequestParams) => Promise<import("./http-client.js").HttpResponse<{
|
|
802
|
+
files: DeviceFile[];
|
|
803
|
+
}, void>>;
|
|
832
804
|
/**
|
|
833
805
|
* @description Sends an FoE read request for `filename` to the device at `slavePosition` and returns the raw file bytes. FoE is available in Boot, Pre-Op, Safe-Op, and Op states (device-dependent); the caller is responsible for ensuring the device is in a suitable state before calling. The call blocks until the full file has been received or a per-packet timeout of 700 ms is exceeded.
|
|
834
806
|
*
|
|
@@ -899,6 +871,20 @@ export declare class Api<SecurityDataType = unknown> extends HttpClient<Security
|
|
|
899
871
|
* @request POST:/api/sii/parse
|
|
900
872
|
*/
|
|
901
873
|
parseSii: (data: File, params?: RequestParams) => Promise<import("./http-client.js").HttpResponse<SlaveInformationInterface, void>>;
|
|
874
|
+
/**
|
|
875
|
+
* @description Breaks a firmware package filename into the five fields the SOMANET naming convention defines (Hardware description specification §3.4.2) — `package_<hardware>_<fullFirmwareDescriptor>_<software>_v<version>.zip` — and, where the descriptor is the numeric `<id>-<version>[-<key>[-<fieldbus>]]` kind, decodes it further. The specification allows a descriptor that is not (its own example `Branded-Drive-Elite` carries `MyProduct-v25-key3-ecat`), so those four fields are omitted rather than guessed. Bus-independent, like `/api/sii/parse` and `/api/esi/parse`, but a `GET` with a query because there is no file to upload — only a short string. This is the same decoder firmware installation uses to decide whether a package can be cached, so what it reports is what that will do.
|
|
876
|
+
*
|
|
877
|
+
* @name GetFirmwarePackageName
|
|
878
|
+
* @summary Decode a SOMANET firmware package filename
|
|
879
|
+
* @request GET:/api/firmware-package-name
|
|
880
|
+
*/
|
|
881
|
+
getFirmwarePackageName: (query: {
|
|
882
|
+
/**
|
|
883
|
+
* The package filename, with no directory part.
|
|
884
|
+
* @example "package_SOMANET-Circulo-7_8500-04-2332_motion-drive_v5.6.10.zip"
|
|
885
|
+
*/
|
|
886
|
+
filename: string;
|
|
887
|
+
}, params?: RequestParams) => Promise<import("./http-client.js").HttpResponse<FirmwarePackageName, void>>;
|
|
902
888
|
/**
|
|
903
889
|
* @description Decodes a vendor's ESI XML supplied in the request body. No device is involved — the Tools page uses this to inspect an ESI with no hardware present, which is the only way to see object descriptions, enum option labels, engineering units and min/max bounds: the CoE SDO-Information service reports none of them. The response carries the vendor, every module, and **every device with its own assembled `entries` table** — one row per addressable `(index, subindex)`, merged from the device's own dictionary plus the dictionaries of the modules its slots reference, with each row recording in `source` where it came from. Object-level annotation (an object's description and raw properties) is attached to **subindex 0 only** — that row *is* the object — rather than repeated onto every subindex. A RECORD member still carries its own description on its own row; an ARRAY element carries none, because the ESI describes an array once rather than per element. To read an object's text for any subindex, look at subindex 0 of the same index. Where a slot offers mutually exclusive module variants the merge necessarily collides; it is resolved last-wins and reported in that device's `warnings`. Pass `modules` to model one concrete configuration instead.
|
|
904
890
|
*
|
package/dist/generated/Api.js
CHANGED
|
@@ -470,7 +470,7 @@ export class Api extends HttpClient {
|
|
|
470
470
|
...params,
|
|
471
471
|
});
|
|
472
472
|
/**
|
|
473
|
-
* @description Starts the named procedure and returns as soon as the run is under way — this does **not** wait for it to finish. Poll `GET` on the same path for its outcome, or `DELETE` to cancel it. The request body carries the procedure's parameters
|
|
473
|
+
* @description Starts the named procedure and returns as soon as the run is under way — this does **not** wait for it to finish. Poll `GET` on the same path for its outcome, or `DELETE` to cancel it. The request body carries the procedure's parameters, and each descriptor from `GET /api/devices/{slavePosition}/procedures` reports its own in `parameters` — name, type, bounds, default, and whether it is required — which is enough to build a form for any procedure without hard-coding one per name. A procedure that takes no parameters may be started with no body. Only one procedure may run on a device at a time; a second start is refused with 409 while the first is in flight. Most procedures require an active mailbox, so the device must be in PRE-OP, SAFE-OP or OP. A run the drive answers with an error is not a failure of *this* request — it is reported in the snapshot as a failed run.
|
|
474
474
|
*
|
|
475
475
|
* @name StartProcedure
|
|
476
476
|
* @summary Start a procedure on a device
|
|
@@ -522,6 +522,20 @@ export class Api extends HttpClient {
|
|
|
522
522
|
format: "json",
|
|
523
523
|
...params,
|
|
524
524
|
});
|
|
525
|
+
/**
|
|
526
|
+
* @description Reads the files the `hrd-streaming` procedure recorded, concatenates them in order and decodes them into samples. Run that procedure first; this endpoint only reads what is already on the drive. **`data` is required and must match what was recorded.** Nothing on the drive says which signal its files hold, so the wrong selection reinterprets the same bytes as a different layout and returns plausible nonsense. The procedure's `configure-stream` step reports the selection it used for exactly this reason. Samples travel positionally — `columns` names the fields of each row, once, the way a monitoring topic ships its parameter order once — because a full recording is up to ten thousand rows. `trailingBytes` is what was left over past the last whole sample: the drive allocates its files in fixed-size blocks, so a recording that does not fill the last block ends in padding rather than data. Answers **JSON or CSV**, chosen by the `Accept` header. CSV is the same numbers in the same column order, one header row then one row per sample — a file to open in a spreadsheet rather than JSON to read, which for ten thousand rows is usually what is wanted. Values are decoded, not raw: `velocityRpm` is converted out of the file's Q15 fixed point (exactly — multiply by 32768 to recover the stored integer), while `torquePermil` and the encoder's `raw` word are the file's own values. Blocks for the transfer, which is up to five 8 KB FoE reads plus the listing.
|
|
527
|
+
*
|
|
528
|
+
* @name ReadHrdRecording
|
|
529
|
+
* @summary Read back a drive's high resolution data recording
|
|
530
|
+
* @request GET:/api/devices/{slavePosition}/hrd
|
|
531
|
+
*/
|
|
532
|
+
readHrdRecording = (slavePosition, query, params = {}) => this.request({
|
|
533
|
+
path: `/api/devices/${slavePosition}/hrd`,
|
|
534
|
+
method: "GET",
|
|
535
|
+
query: query,
|
|
536
|
+
format: "json",
|
|
537
|
+
...params,
|
|
538
|
+
});
|
|
525
539
|
/**
|
|
526
540
|
* @description Writes "disengaged" to the brake state object (0x2004:07) and waits the drive's pull time (0x2004:03) plus `settle` before answering, because the firmware blocks motion — and motion-related OS commands — until the pull time expires. Answers with the brake state read back. **The release only actually happens while the drive is in OP ENABLED.** In any other state the write merely energises the brake output (phase D). Note also that entering OP ENABLED releases the brake automatically in normal operation but **not** in diagnostics mode, where the master owns the brake — which is why a diagnostics procedure has to call this. **On a pin brake this moves the shaft**: the controller raises current progressively until the load has lifted off the pin by the minimum displacement (0x2004:08), reversing direction if it reaches the current ceiling (0x2004:09, a percentage of rated current) first. Check `releaseMovesShaft` on `GET .../brake`. Brake release is open-loop — nothing confirms the brake let go — so the wait is the only margin there is. A brake whose release strategy is `manualOutputVoltage` is left alone and the returned state says so; that is not an error. **A released brake stays released**: nothing re-engages it for you, so on a vertical or loaded axis engage it again when you are done.
|
|
527
541
|
*
|
|
@@ -550,32 +564,6 @@ export class Api extends HttpClient {
|
|
|
550
564
|
format: "json",
|
|
551
565
|
...params,
|
|
552
566
|
});
|
|
553
|
-
/**
|
|
554
|
-
* @description Commands the device to persist its current parameters (the generic CANopen "store parameters" object 0x1010:01) and waits for confirmation. The server writes the ASCII "save" signature, waits a fixed settle (~1 s) for the drive to begin the flash write, then polls 0x1010:01 until it reads back 1 ("save completed"). Because a store in progress can leave the mailbox briefly unresponsive, a poll that does not yet confirm — a value mismatch or a transient read error alike — is retried up to `retries` more times, `interval` apart. The call blocks until the store is confirmed or the retry budget is exhausted (up to a few seconds); the device's mailbox must be active (PRE-OP/SAFE-OP/OP).
|
|
555
|
-
*
|
|
556
|
-
* @name StoreParameters
|
|
557
|
-
* @summary Store a device's parameters to non-volatile memory
|
|
558
|
-
* @request POST:/api/devices/{slavePosition}/store-parameters
|
|
559
|
-
*/
|
|
560
|
-
storeParameters = (slavePosition, query, params = {}) => this.request({
|
|
561
|
-
path: `/api/devices/${slavePosition}/store-parameters`,
|
|
562
|
-
method: "POST",
|
|
563
|
-
query: query,
|
|
564
|
-
...params,
|
|
565
|
-
});
|
|
566
|
-
/**
|
|
567
|
-
* @description Commands the device to restore its default parameters (the generic CANopen "restore default parameters" object 0x1011) for the selected `group`, and waits for confirmation. The server writes the ASCII "load" signature to the matching 0x1011 sub-entry, waits a fixed settle (~1 s) for the device to begin, then polls that sub-entry until it reads back 1 ("restore completed"), retrying a poll that does not yet confirm — a value mismatch or a transient read error alike — up to `retries` more times, `interval` apart. The call blocks until the restore is confirmed or the retry budget is exhausted (up to a few seconds); the device's mailbox must be active (PRE-OP/SAFE-OP/OP). **Destructive:** this overwrites the selected group's parameter values in the device's volatile memory with the device's defaults, replacing the current live values (not the persisted store). Which values it touches, and whether it takes effect immediately or after the next reset, is device-specific.
|
|
568
|
-
*
|
|
569
|
-
* @name RestoreDefaultParameters
|
|
570
|
-
* @summary Restore a device's default parameters
|
|
571
|
-
* @request POST:/api/devices/{slavePosition}/restore-default-parameters
|
|
572
|
-
*/
|
|
573
|
-
restoreDefaultParameters = (slavePosition, query, params = {}) => this.request({
|
|
574
|
-
path: `/api/devices/${slavePosition}/restore-default-parameters`,
|
|
575
|
-
method: "POST",
|
|
576
|
-
query: query,
|
|
577
|
-
...params,
|
|
578
|
-
});
|
|
579
567
|
/**
|
|
580
568
|
* @description Performs a CoE SDO upload — reads the value of object `index:subindex` from the device at `slavePosition` and returns the raw bytes as a JSON array. Both `index` and `subindex` accept decimal or hexadecimal notation; prefix with `0x` for hex (e.g. `0x6064` or `24676` for object 0x6064).
|
|
581
569
|
*
|
|
@@ -604,6 +592,19 @@ export class Api extends HttpClient {
|
|
|
604
592
|
format: "json",
|
|
605
593
|
...params,
|
|
606
594
|
});
|
|
595
|
+
/**
|
|
596
|
+
* @description Lists what the device holds — firmware images, the ESI, logs, configuration and any high resolution data recording — with the size it reports for each. **Vendor-specific despite reading like a filesystem listing.** EtherCAT defines no directory service, so SOMANET firmware serves its own as a pseudo-file (`fs-getlist`) read over FoE. A device that is not a SOMANET drive is refused rather than probed. `byteCount` is absent when the device reported a name without a size, which is a formatting quirk of one entry rather than a reason to hide the file.
|
|
597
|
+
*
|
|
598
|
+
* @name ListDeviceFiles
|
|
599
|
+
* @summary List the files stored on a device
|
|
600
|
+
* @request GET:/api/devices/{slavePosition}/files
|
|
601
|
+
*/
|
|
602
|
+
listDeviceFiles = (slavePosition, params = {}) => this.request({
|
|
603
|
+
path: `/api/devices/${slavePosition}/files`,
|
|
604
|
+
method: "GET",
|
|
605
|
+
format: "json",
|
|
606
|
+
...params,
|
|
607
|
+
});
|
|
607
608
|
/**
|
|
608
609
|
* @description Sends an FoE read request for `filename` to the device at `slavePosition` and returns the raw file bytes. FoE is available in Boot, Pre-Op, Safe-Op, and Op states (device-dependent); the caller is responsible for ensuring the device is in a suitable state before calling. The call blocks until the full file has been received or a per-packet timeout of 700 ms is exceeded.
|
|
609
610
|
*
|
|
@@ -671,6 +672,20 @@ export class Api extends HttpClient {
|
|
|
671
672
|
format: "json",
|
|
672
673
|
...params,
|
|
673
674
|
});
|
|
675
|
+
/**
|
|
676
|
+
* @description Breaks a firmware package filename into the five fields the SOMANET naming convention defines (Hardware description specification §3.4.2) — `package_<hardware>_<fullFirmwareDescriptor>_<software>_v<version>.zip` — and, where the descriptor is the numeric `<id>-<version>[-<key>[-<fieldbus>]]` kind, decodes it further. The specification allows a descriptor that is not (its own example `Branded-Drive-Elite` carries `MyProduct-v25-key3-ecat`), so those four fields are omitted rather than guessed. Bus-independent, like `/api/sii/parse` and `/api/esi/parse`, but a `GET` with a query because there is no file to upload — only a short string. This is the same decoder firmware installation uses to decide whether a package can be cached, so what it reports is what that will do.
|
|
677
|
+
*
|
|
678
|
+
* @name GetFirmwarePackageName
|
|
679
|
+
* @summary Decode a SOMANET firmware package filename
|
|
680
|
+
* @request GET:/api/firmware-package-name
|
|
681
|
+
*/
|
|
682
|
+
getFirmwarePackageName = (query, params = {}) => this.request({
|
|
683
|
+
path: `/api/firmware-package-name`,
|
|
684
|
+
method: "GET",
|
|
685
|
+
query: query,
|
|
686
|
+
format: "json",
|
|
687
|
+
...params,
|
|
688
|
+
});
|
|
674
689
|
/**
|
|
675
690
|
* @description Decodes a vendor's ESI XML supplied in the request body. No device is involved — the Tools page uses this to inspect an ESI with no hardware present, which is the only way to see object descriptions, enum option labels, engineering units and min/max bounds: the CoE SDO-Information service reports none of them. The response carries the vendor, every module, and **every device with its own assembled `entries` table** — one row per addressable `(index, subindex)`, merged from the device's own dictionary plus the dictionaries of the modules its slots reference, with each row recording in `source` where it came from. Object-level annotation (an object's description and raw properties) is attached to **subindex 0 only** — that row *is* the object — rather than repeated onto every subindex. A RECORD member still carries its own description on its own row; an ARRAY element carries none, because the ESI describes an array once rather than per element. To read an object's text for any subindex, look at subindex 0 of the same index. Where a slot offers mutually exclusive module variants the merge necessarily collides; it is resolved last-wins and reported in that device's `warnings`. Pass `modules` to model one concrete configuration instead.
|
|
676
691
|
*
|
|
@@ -390,6 +390,54 @@ export interface ProcedureSnapshot {
|
|
|
390
390
|
/** Why the run failed when no step captured it — a failure belonging to no step, such as the device not being the kind the procedure needs. Absent otherwise. */
|
|
391
391
|
error?: string;
|
|
392
392
|
}
|
|
393
|
+
/** One file stored on a device, as its file list reports it. */
|
|
394
|
+
export interface DeviceFile {
|
|
395
|
+
/**
|
|
396
|
+
* Filename as FoE addresses it.
|
|
397
|
+
* @example "hr_data0.bin"
|
|
398
|
+
*/
|
|
399
|
+
name: string;
|
|
400
|
+
/**
|
|
401
|
+
* Size the device reported. Absent when it reported the name without one — the size is what the listing claims, not what a read returned.
|
|
402
|
+
* @example 8032
|
|
403
|
+
*/
|
|
404
|
+
byteCount?: number;
|
|
405
|
+
}
|
|
406
|
+
/** One high resolution data recording, read back from a drive's files and decoded. */
|
|
407
|
+
export interface HrdRecording {
|
|
408
|
+
/**
|
|
409
|
+
* Which layout the files were decoded as — echoes the request.
|
|
410
|
+
* @example "encoder-raw"
|
|
411
|
+
*/
|
|
412
|
+
data: "encoder-raw" | "system-identification";
|
|
413
|
+
/** The files it was read from, in order. A recording that came back shorter than expected can be told from one that was never made by what is listed here. */
|
|
414
|
+
files: DeviceFile[];
|
|
415
|
+
/**
|
|
416
|
+
* Total bytes read across those files.
|
|
417
|
+
* @example 20000
|
|
418
|
+
*/
|
|
419
|
+
byteCount: number;
|
|
420
|
+
/**
|
|
421
|
+
* Bytes past the last whole sample. The drive allocates its files in fixed-size blocks, so this is the last block's padding rather than data that failed to decode.
|
|
422
|
+
* @example 0
|
|
423
|
+
*/
|
|
424
|
+
trailingBytes: number;
|
|
425
|
+
/**
|
|
426
|
+
* How many samples were decoded.
|
|
427
|
+
* @example 5000
|
|
428
|
+
*/
|
|
429
|
+
sampleCount: number;
|
|
430
|
+
/**
|
|
431
|
+
* What each value of a row is, in order. For `encoder-raw`: `raw` (the 32-bit word the encoder reported), `masterCount` (its low 14 bits) and `noniusCount` (the next 14) — the raw word is kept because the firmware specification describes only bits 0-27 and says nothing about the top four. For `system-identification`: `velocityRpm` (converted out of the file's Q15 fixed point) and `torquePermil` (per mille of rated torque).
|
|
432
|
+
* @example ["raw","masterCount","noniusCount"]
|
|
433
|
+
*/
|
|
434
|
+
columns: string[];
|
|
435
|
+
/**
|
|
436
|
+
* One row per sample, positional in the order `columns` gives — a full recording is up to ten thousand rows, so the names travel once beside them rather than on every row.
|
|
437
|
+
* @example [[4661,4661,0],[4662,4662,0]]
|
|
438
|
+
*/
|
|
439
|
+
samples: number[][];
|
|
440
|
+
}
|
|
393
441
|
/** A drive's brake configuration and current state — the parts of object 0x2004 that decide what commanding the brake will actually do. Returned by every brake endpoint, so the outcome of a release or engage arrives in the same shape as a plain read. */
|
|
394
442
|
export interface BrakeState {
|
|
395
443
|
/**
|
|
@@ -454,12 +502,122 @@ export interface ProcedureDescriptor {
|
|
|
454
502
|
* @example false
|
|
455
503
|
*/
|
|
456
504
|
requiresEnabled: boolean;
|
|
505
|
+
/** What the request body may carry, in the order a client should present it. Empty for a procedure that takes none, which is most of them — a procedure's timings are properties of the command it issues rather than a caller's choice. */
|
|
506
|
+
parameters: ProcedureParameter[];
|
|
457
507
|
/**
|
|
458
508
|
* The ordered step ids the procedure reports against — bare ids, because a template's per-step status is always idle and says nothing. Live status for the same ids is in the snapshot's `steps`.
|
|
459
509
|
* @example ["command"]
|
|
460
510
|
*/
|
|
461
511
|
steps: string[];
|
|
462
512
|
}
|
|
513
|
+
/** One choice of an `enum` parameter. */
|
|
514
|
+
export interface ParameterOption {
|
|
515
|
+
/**
|
|
516
|
+
* What the request body carries when this option is chosen.
|
|
517
|
+
* @example 1
|
|
518
|
+
*/
|
|
519
|
+
value: any;
|
|
520
|
+
/**
|
|
521
|
+
* What the user picks.
|
|
522
|
+
* @example "Encoder 1"
|
|
523
|
+
*/
|
|
524
|
+
title: string;
|
|
525
|
+
}
|
|
526
|
+
/** One named parameter a procedure accepts — enough to render a field for it and to know what to put in. Descriptive rather than authoritative: the server validates every request whatever a client sends, and this is what lets a client build a sensible form and catch a mistake before the request goes out. The three type-specific fields are absent where they do not apply. */
|
|
527
|
+
export interface ProcedureParameter {
|
|
528
|
+
/**
|
|
529
|
+
* The key in the request body.
|
|
530
|
+
* @example "registerAddress"
|
|
531
|
+
*/
|
|
532
|
+
name: string;
|
|
533
|
+
/**
|
|
534
|
+
* Short label.
|
|
535
|
+
* @example "Register address"
|
|
536
|
+
*/
|
|
537
|
+
title: string;
|
|
538
|
+
/** What it does and what a sensible value is. */
|
|
539
|
+
description: string;
|
|
540
|
+
/**
|
|
541
|
+
* Which kind of control to render. `file` carries a whole file as a base64 string, so a client renders a file picker and encodes what it reads; `stringArray` is an editable list of free-text values.
|
|
542
|
+
* @example "integer"
|
|
543
|
+
*/
|
|
544
|
+
type: "integer" | "boolean" | "enum" | "byteArray" | "string" | "stringArray" | "file";
|
|
545
|
+
/**
|
|
546
|
+
* Whether a request must carry it — true exactly when there is no `defaultValue`. Reported rather than left to be derived, so a client need not know the rule.
|
|
547
|
+
* @example true
|
|
548
|
+
*/
|
|
549
|
+
required: boolean;
|
|
550
|
+
/**
|
|
551
|
+
* What an omitting request gets. Absent when the parameter is required.
|
|
552
|
+
* @example 1
|
|
553
|
+
*/
|
|
554
|
+
defaultValue?: any;
|
|
555
|
+
/**
|
|
556
|
+
* `integer` only: smallest accepted value.
|
|
557
|
+
* @example 0
|
|
558
|
+
*/
|
|
559
|
+
minValue?: number;
|
|
560
|
+
/**
|
|
561
|
+
* `integer` only: largest accepted value.
|
|
562
|
+
* @example 255
|
|
563
|
+
*/
|
|
564
|
+
maxValue?: number;
|
|
565
|
+
/**
|
|
566
|
+
* `byteArray` only: the exact number of bytes.
|
|
567
|
+
* @example 8
|
|
568
|
+
*/
|
|
569
|
+
length?: number;
|
|
570
|
+
/** `enum` only: the values that may be chosen. */
|
|
571
|
+
options?: ParameterOption[];
|
|
572
|
+
}
|
|
573
|
+
/** A SOMANET firmware package filename broken into its fields. The four decoded-descriptor properties are absent — not null — when the full firmware descriptor is not the numeric kind, which the naming specification explicitly allows. */
|
|
574
|
+
export interface FirmwarePackageName {
|
|
575
|
+
/**
|
|
576
|
+
* The format description; always `package` for a firmware bundle.
|
|
577
|
+
* @example "package"
|
|
578
|
+
*/
|
|
579
|
+
description: string;
|
|
580
|
+
/**
|
|
581
|
+
* Human-readable hardware name.
|
|
582
|
+
* @example "SOMANET-Circulo-7"
|
|
583
|
+
*/
|
|
584
|
+
hardwareName: string;
|
|
585
|
+
/**
|
|
586
|
+
* The full firmware descriptor, verbatim.
|
|
587
|
+
* @example "8500-04-2332"
|
|
588
|
+
*/
|
|
589
|
+
firmwareId: string;
|
|
590
|
+
/**
|
|
591
|
+
* Software name.
|
|
592
|
+
* @example "motion-drive"
|
|
593
|
+
*/
|
|
594
|
+
firmwareName: string;
|
|
595
|
+
/**
|
|
596
|
+
* Software version, including the leading `v`.
|
|
597
|
+
* @example "v5.6.10"
|
|
598
|
+
*/
|
|
599
|
+
firmwareVersion: string;
|
|
600
|
+
/**
|
|
601
|
+
* Product id from the descriptor.
|
|
602
|
+
* @example 8500
|
|
603
|
+
*/
|
|
604
|
+
productId?: number;
|
|
605
|
+
/**
|
|
606
|
+
* Product version from the descriptor.
|
|
607
|
+
* @example 4
|
|
608
|
+
*/
|
|
609
|
+
productVersion?: number;
|
|
610
|
+
/**
|
|
611
|
+
* Firmware encryption key id from the descriptor.
|
|
612
|
+
* @example 2332
|
|
613
|
+
*/
|
|
614
|
+
keyId?: number;
|
|
615
|
+
/**
|
|
616
|
+
* Fieldbus protocol from the descriptor, decoded as hexadecimal. 1 is EtherCAT.
|
|
617
|
+
* @example 1
|
|
618
|
+
*/
|
|
619
|
+
fieldbusProtocol?: number;
|
|
620
|
+
}
|
|
463
621
|
/** One procedure paired with how its last run on this device went — an entry of `GET /api/devices/{slavePosition}/procedures`. The pairing is what lets a page render in a single request instead of one per procedure. */
|
|
464
622
|
export interface ProcedureListing {
|
|
465
623
|
/** What a procedure *is*, independent of any run — everything needed to render a control for it. The text is served rather than held per client, because the house rule that every action carries a description and its caveats means it has to exist somewhere, and duplicating it in each client is how it goes stale. */
|
|
@@ -467,7 +625,7 @@ export interface ProcedureListing {
|
|
|
467
625
|
/** The complete state of a procedure on one device — an accumulating snapshot rather than an event, which is what makes polling lossless. */
|
|
468
626
|
snapshot: ProcedureSnapshot;
|
|
469
627
|
}
|
|
470
|
-
/** A procedure's parameters. Which fields apply is per procedure
|
|
628
|
+
/** A procedure's parameters. Which fields apply is per procedure, and each descriptor reports its own in `parameters` — so this schema is open, and a procedure that takes none may be started with no body at all. The properties below are the union of every procedure's, each naming the procedure it belongs to. */
|
|
471
629
|
export interface ProcedureRequest {
|
|
472
630
|
/**
|
|
473
631
|
* `os-command` only, and required for it: the eight request bytes. Byte 0 is the OS command ID; bytes 1-7 are that command's parameters.
|
|
@@ -485,12 +643,84 @@ export interface ProcedureRequest {
|
|
|
485
643
|
*/
|
|
486
644
|
timeoutMs?: number;
|
|
487
645
|
/**
|
|
488
|
-
*
|
|
646
|
+
* `os-command` only: how often the server reads the drive's response object while waiting.
|
|
489
647
|
* @min 1
|
|
490
648
|
* @max 1000
|
|
491
649
|
* @default 10
|
|
492
650
|
*/
|
|
493
651
|
pollIntervalMs?: number;
|
|
652
|
+
/**
|
|
653
|
+
* `encoder-register-communication` and `ic-mu-calibration-mode`: which of the drive's encoders to address. Encoder 1 is whatever 0x2110 configures and encoder 2 whatever 0x2112 does, so the ordinal picks a configured slot rather than a kind of encoder.
|
|
654
|
+
* @default 1
|
|
655
|
+
* @example 1
|
|
656
|
+
*/
|
|
657
|
+
encoder?: 1 | 2;
|
|
658
|
+
/**
|
|
659
|
+
* `encoder-register-communication` only: false reads the register, true writes `value` into it. Either way the drive reports what the register holds afterwards.
|
|
660
|
+
* @default false
|
|
661
|
+
*/
|
|
662
|
+
write?: boolean;
|
|
663
|
+
/**
|
|
664
|
+
* `encoder-register-communication` only, and required for it: the register to access. The map belongs to the encoder chip rather than to the drive's firmware.
|
|
665
|
+
* @min 0
|
|
666
|
+
* @max 255
|
|
667
|
+
* @example 117
|
|
668
|
+
*/
|
|
669
|
+
registerAddress?: number;
|
|
670
|
+
/**
|
|
671
|
+
* `encoder-register-communication` only: the byte to write into the register. Ignored when reading.
|
|
672
|
+
* @min 0
|
|
673
|
+
* @max 255
|
|
674
|
+
* @default 0
|
|
675
|
+
* @example 7
|
|
676
|
+
*/
|
|
677
|
+
value?: number;
|
|
678
|
+
/**
|
|
679
|
+
* `hrd-streaming` only, and required for it: which signal to record. Also decides how the recording decodes when it is read back from `/api/devices/{slavePosition}/hrd`.
|
|
680
|
+
* @example "encoder-raw"
|
|
681
|
+
*/
|
|
682
|
+
data?: "encoder-raw" | "system-identification";
|
|
683
|
+
/**
|
|
684
|
+
* `hrd-streaming` only, and required for it: how long to record. One sample is written every millisecond into at most five 8032-byte files, so the real ceiling depends on the sample size — 10000 ms for `encoder-raw`, but only 6000 ms for `system-identification`. The drive applies both limits; the narrower one is checked here too, so an over-long request is rejected before a run starts rather than failing on its first step.
|
|
685
|
+
* @min 1
|
|
686
|
+
* @max 10000
|
|
687
|
+
* @example 5000
|
|
688
|
+
*/
|
|
689
|
+
durationMs?: number;
|
|
690
|
+
/**
|
|
691
|
+
* `ic-mu-calibration-mode` only, and required for it: how the BiSS service should clock the encoder. `standard` is normal operation; `configuration` keeps the encoder clocked but uses only the register-communication bits, so position stops updating and no CRC fault is raised; `raw` clocks an encoder already configured for raw output and averages that data into 0x2704. There is no default — the mode is the instruction.
|
|
692
|
+
* @example "configuration"
|
|
693
|
+
*/
|
|
694
|
+
mode?: "configuration" | "raw" | "standard";
|
|
695
|
+
/**
|
|
696
|
+
* `restore-default-parameters` only: which group of defaults to restore — all (0x1011:01), communication (0x1011:02), application (0x1011:03), or manufacturer (0x1011:04).
|
|
697
|
+
* @default "all"
|
|
698
|
+
* @example "all"
|
|
699
|
+
*/
|
|
700
|
+
group?: "all" | "communication" | "application" | "manufacturer";
|
|
701
|
+
/** `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 `{}`.) */
|
|
702
|
+
packageContent?: string;
|
|
703
|
+
/**
|
|
704
|
+
* `firmware-installation`: the package's filename. Optional — it names the package for caching and identifies a cached one to re-install without uploading it again. A name outside the SOMANET convention still installs, it is just not cached.
|
|
705
|
+
* @example "package_SOMANET-Circulo-7_8500-04-2332_motion-drive_v5.6.10.zip"
|
|
706
|
+
*/
|
|
707
|
+
packageFilename?: string;
|
|
708
|
+
/**
|
|
709
|
+
* `firmware-installation`: entries inside the package that are not written to the device. An explicit list replaces the defaults wholesale rather than adding to them, so `[]` means "write everything the package holds". Any entry can be named, including the SII and the firmware binaries.
|
|
710
|
+
* @default ["SOMANET_CiA_402.xml.zip","stack_image.svg.zip"]
|
|
711
|
+
*/
|
|
712
|
+
skipFiles?: string[];
|
|
713
|
+
/**
|
|
714
|
+
* `firmware-installation`: keep a copy of the package on the server so it can be re-installed without uploading it again. Only possible when a filename is given and it follows the SOMANET package naming convention.
|
|
715
|
+
* @default true
|
|
716
|
+
*/
|
|
717
|
+
cachePackage?: boolean;
|
|
718
|
+
/**
|
|
719
|
+
* `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.
|
|
720
|
+
* @default 2
|
|
721
|
+
* @example 2
|
|
722
|
+
*/
|
|
723
|
+
finalState?: 1 | 2 | 3 | 4 | 8;
|
|
494
724
|
[key: string]: any;
|
|
495
725
|
}
|
|
496
726
|
export interface OutputStageResult {
|
package/dist/index.d.ts
CHANGED
package/dist/index.js
CHANGED
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@synapticon/motion-master-client",
|
|
3
|
-
"version": "6.0.0-alpha.
|
|
3
|
+
"version": "6.0.0-alpha.66",
|
|
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": {
|
package/dist/somanet.d.ts
DELETED
package/dist/somanet.js
DELETED
|
@@ -1,15 +0,0 @@
|
|
|
1
|
-
// Helpers for SOMANET (Synapticon) drive specifics.
|
|
2
|
-
// Parse the body of a SOMANET `fs-getlist` FoE read. Each entry is one line in
|
|
3
|
-
// the form `<filename>, size: <bytes>`; size is null when a line doesn't match.
|
|
4
|
-
export function parseSomanetFileList(text) {
|
|
5
|
-
return text
|
|
6
|
-
.split(/\r?\n/)
|
|
7
|
-
.map(line => line.trim())
|
|
8
|
-
.filter(Boolean)
|
|
9
|
-
.map(line => {
|
|
10
|
-
const match = line.match(/^(.*?),\s*size:\s*(\d+)\s*$/);
|
|
11
|
-
if (match)
|
|
12
|
-
return { name: match[1].trim(), size: Number(match[2]) };
|
|
13
|
-
return { name: line, size: null };
|
|
14
|
-
});
|
|
15
|
-
}
|