@synapticon/motion-master-client 6.0.0-alpha.50 → 6.0.0-alpha.51

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, DcSyncStatus, DeviceDiagnostics, DeviceParameter, EscRegister, FoeErrorCode, GameLoopHealth, MailboxErrorCode, Monitoring, ObjectDataTypeInfo, OutputStageResult, ParameterCacheEntry, PdoMapping, PdoMappingRequest, ProcessDataWatchdog, ProcessImageObject, SdoAbortCode, SlaveConfig, SlaveInformationInterface } from "./data-contracts.js";
1
+ import { AlStatusCode, Cia402Status, DcSyncStatus, DeviceDiagnostics, DeviceParameter, EscRegister, FoeErrorCode, GameLoopHealth, MailboxErrorCode, Monitoring, ObjectDataTypeInfo, OutputStageResult, ParameterCacheEntry, PdoMapping, PdoMappingRequest, ProcessDataWatchdog, ProcessImageObject, SdoAbortCode, SlaveConfig, SlaveInformationInterface } 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
  /**
@@ -249,10 +249,15 @@ export declare class Api<SecurityDataType = unknown> extends HttpClient<Security
249
249
  */
250
250
  slavePosition: number;
251
251
  /**
252
- * Human-readable device name from SII EEPROM
253
- * @example "SOMANET Node"
252
+ * Human-readable device name from SII EEPROM. For SOMANET drives this is the generic group name "SOMANET"; use productName to distinguish products.
253
+ * @example "SOMANET"
254
254
  */
255
255
  name: string;
256
+ /**
257
+ * Canonical product name, independent of the SII EEPROM. For a recognised SOMANET product this distinguishes the product (e.g. "SOMANET Circulo"); otherwise it falls back to name.
258
+ * @example "SOMANET Node"
259
+ */
260
+ productName: string;
256
261
  /**
257
262
  * Vendor ID from EEPROM
258
263
  * @format int64
@@ -277,6 +282,11 @@ export declare class Api<SecurityDataType = unknown> extends HttpClient<Security
277
282
  * @example 12345
278
283
  */
279
284
  serialNumber: number;
285
+ /**
286
+ * Whether the device implements the CiA402 drive profile (both controlword 0x6040 and statusword 0x6041 present in its object dictionary). Gates the CiA402 motion-control endpoints under /api/devices/{slavePosition}/cia402.
287
+ * @example true
288
+ */
289
+ isCia402: boolean;
280
290
  }, void>>;
281
291
  /**
282
292
  * @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.
@@ -592,6 +602,61 @@ export declare class Api<SecurityDataType = unknown> extends HttpClient<Security
592
602
  */
593
603
  error: string;
594
604
  }>>;
605
+ /**
606
+ * @description Returns the drive's current control state — the decoded state-machine state, the raw status (0x6041) and control (0x6040) words, and the active operation mode (display object 0x6061). The values are read live (from the process image when the device is exchanging, else over SDO), so poll this to drive a motion UI. Only valid for a CiA402 device (see the isCia402 flag on GET /api/devices).
607
+ *
608
+ * @name GetCia402Status
609
+ * @summary Read a device's CiA402 control snapshot
610
+ * @request GET:/api/devices/{slavePosition}/cia402
611
+ */
612
+ getCia402Status: (slavePosition: number, params?: RequestParams) => Promise<import("./http-client.js").HttpResponse<Cia402Status, void>>;
613
+ /**
614
+ * @description Writes the requested operation mode to 0x6060 and returns the resulting control snapshot. The drive reflects the accepted mode in 0x6061 (the modeOfOperation of the response) once it takes effect.
615
+ *
616
+ * @name SetCia402OperationMode
617
+ * @summary Set a device's CiA402 operation mode
618
+ * @request POST:/api/devices/{slavePosition}/cia402/mode
619
+ */
620
+ setCia402OperationMode: (slavePosition: number, data: {
621
+ /**
622
+ * CiA402 operation mode (0x6060 value): 0 NoMode, 1 Profile Position, 3 Profile Velocity, 4 Profile Torque, 6 Homing, 8 Cyclic Sync Position, 9 Cyclic Sync Velocity, 10 Cyclic Sync Torque.
623
+ * @example 9
624
+ */
625
+ mode: number;
626
+ }, params?: RequestParams) => Promise<import("./http-client.js").HttpResponse<Cia402Status, void>>;
627
+ /**
628
+ * @description Drives the CiA402 device-control state machine. "enable" walks every intermediate transition to Operation Enabled (clearing a fault first if needed); "disable" goes to Switch On Disabled; "quickStop" triggers a quick stop; "faultReset" clears a latched fault. The device must be exchanging process data for "enable" to make progress. Returns the resulting control snapshot.
629
+ *
630
+ * @name RunCia402Command
631
+ * @summary Run a CiA402 state-machine command
632
+ * @request POST:/api/devices/{slavePosition}/cia402/command
633
+ */
634
+ runCia402Command: (slavePosition: number, data: {
635
+ /**
636
+ * The state-machine action to perform.
637
+ * @example "enable"
638
+ */
639
+ command: "enable" | "disable" | "quickStop" | "faultReset";
640
+ }, params?: RequestParams) => Promise<import("./http-client.js").HttpResponse<Cia402Status, void>>;
641
+ /**
642
+ * @description Writes the one setpoint that matches the active operation mode — target position (0x607A, INTEGER32) in PP/CSP, target velocity (0x60FF, INTEGER32) in PV/CSV, or target torque (0x6071, INTEGER16, per-mille of rated) in PT/CST. All are signed: negative values command reverse motion or regenerative torque. Routes through the live process image when the object is PDO-mapped and the device is exchanging, else an SDO download.
643
+ *
644
+ * @name SetCia402Target
645
+ * @summary Set a CiA402 cyclic setpoint (target)
646
+ * @request POST:/api/devices/{slavePosition}/cia402/target
647
+ */
648
+ setCia402Target: (slavePosition: number, data: {
649
+ /**
650
+ * Which setpoint to write (pick the one matching the active mode).
651
+ * @example "velocity"
652
+ */
653
+ target: "position" | "velocity" | "torque";
654
+ /**
655
+ * The setpoint value in the object's own units (signed). For torque it is per-mille of rated and is narrowed to INTEGER16.
656
+ * @example 1000
657
+ */
658
+ value: number;
659
+ }, params?: RequestParams) => Promise<import("./http-client.js").HttpResponse<void, void>>;
595
660
  /**
596
661
  * @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).
597
662
  *
@@ -875,10 +940,15 @@ export declare class Api<SecurityDataType = unknown> extends HttpClient<Security
875
940
  */
876
941
  slavePosition: number;
877
942
  /**
878
- * Human-readable device name from SII EEPROM
879
- * @example "SOMANET Node"
943
+ * Human-readable device name from SII EEPROM. For SOMANET drives this is the generic group name "SOMANET"; use productName to distinguish products.
944
+ * @example "SOMANET"
880
945
  */
881
946
  name: string;
947
+ /**
948
+ * Canonical product name, independent of the SII EEPROM. For a recognised SOMANET product this distinguishes the product (e.g. "SOMANET Circulo"); otherwise it falls back to name.
949
+ * @example "SOMANET Node"
950
+ */
951
+ productName: string;
882
952
  /**
883
953
  * Vendor ID from EEPROM
884
954
  * @format int64
@@ -903,6 +973,11 @@ export declare class Api<SecurityDataType = unknown> extends HttpClient<Security
903
973
  * @example 12345
904
974
  */
905
975
  serialNumber: number;
976
+ /**
977
+ * Whether the device implements the CiA402 drive profile (both controlword 0x6040 and statusword 0x6041 present in its object dictionary). Gates the CiA402 motion-control endpoints under /api/devices/{slavePosition}/cia402.
978
+ * @example true
979
+ */
980
+ isCia402: boolean;
906
981
  }[], any>>;
907
982
  /**
908
983
  * @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.
@@ -399,6 +399,63 @@ export class Api extends HttpClient {
399
399
  format: "json",
400
400
  ...params,
401
401
  });
402
+ /**
403
+ * @description Returns the drive's current control state — the decoded state-machine state, the raw status (0x6041) and control (0x6040) words, and the active operation mode (display object 0x6061). The values are read live (from the process image when the device is exchanging, else over SDO), so poll this to drive a motion UI. Only valid for a CiA402 device (see the isCia402 flag on GET /api/devices).
404
+ *
405
+ * @name GetCia402Status
406
+ * @summary Read a device's CiA402 control snapshot
407
+ * @request GET:/api/devices/{slavePosition}/cia402
408
+ */
409
+ getCia402Status = (slavePosition, params = {}) => this.request({
410
+ path: `/api/devices/${slavePosition}/cia402`,
411
+ method: "GET",
412
+ format: "json",
413
+ ...params,
414
+ });
415
+ /**
416
+ * @description Writes the requested operation mode to 0x6060 and returns the resulting control snapshot. The drive reflects the accepted mode in 0x6061 (the modeOfOperation of the response) once it takes effect.
417
+ *
418
+ * @name SetCia402OperationMode
419
+ * @summary Set a device's CiA402 operation mode
420
+ * @request POST:/api/devices/{slavePosition}/cia402/mode
421
+ */
422
+ setCia402OperationMode = (slavePosition, data, params = {}) => this.request({
423
+ path: `/api/devices/${slavePosition}/cia402/mode`,
424
+ method: "POST",
425
+ body: data,
426
+ type: ContentType.Json,
427
+ format: "json",
428
+ ...params,
429
+ });
430
+ /**
431
+ * @description Drives the CiA402 device-control state machine. "enable" walks every intermediate transition to Operation Enabled (clearing a fault first if needed); "disable" goes to Switch On Disabled; "quickStop" triggers a quick stop; "faultReset" clears a latched fault. The device must be exchanging process data for "enable" to make progress. Returns the resulting control snapshot.
432
+ *
433
+ * @name RunCia402Command
434
+ * @summary Run a CiA402 state-machine command
435
+ * @request POST:/api/devices/{slavePosition}/cia402/command
436
+ */
437
+ runCia402Command = (slavePosition, data, params = {}) => this.request({
438
+ path: `/api/devices/${slavePosition}/cia402/command`,
439
+ method: "POST",
440
+ body: data,
441
+ type: ContentType.Json,
442
+ format: "json",
443
+ ...params,
444
+ });
445
+ /**
446
+ * @description Writes the one setpoint that matches the active operation mode — target position (0x607A, INTEGER32) in PP/CSP, target velocity (0x60FF, INTEGER32) in PV/CSV, or target torque (0x6071, INTEGER16, per-mille of rated) in PT/CST. All are signed: negative values command reverse motion or regenerative torque. Routes through the live process image when the object is PDO-mapped and the device is exchanging, else an SDO download.
447
+ *
448
+ * @name SetCia402Target
449
+ * @summary Set a CiA402 cyclic setpoint (target)
450
+ * @request POST:/api/devices/{slavePosition}/cia402/target
451
+ */
452
+ setCia402Target = (slavePosition, data, params = {}) => this.request({
453
+ path: `/api/devices/${slavePosition}/cia402/target`,
454
+ method: "POST",
455
+ body: data,
456
+ type: ContentType.Json,
457
+ ...params,
458
+ });
402
459
  /**
403
460
  * @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).
404
461
  *
@@ -1,3 +1,36 @@
1
+ /** A CiA402 drive's control snapshot — its state machine, control words, and mode. */
2
+ export interface Cia402Status {
3
+ /**
4
+ * Decoded CiA402 state-machine state (from the statusword, 0x6041).
5
+ * @example "OperationEnabled"
6
+ */
7
+ state: "NotReadyToSwitchOn" | "SwitchOnDisabled" | "ReadyToSwitchOn" | "SwitchedOn" | "OperationEnabled" | "QuickStopActive" | "FaultReactionActive" | "Fault";
8
+ /**
9
+ * Raw statusword (0x6041), 0–65535.
10
+ * @example 4663
11
+ */
12
+ statusword: number;
13
+ /**
14
+ * Last-commanded controlword (0x6040), 0–65535.
15
+ * @example 15
16
+ */
17
+ controlword: number;
18
+ /**
19
+ * Active operation mode (display object 0x6061), as an INTEGER8 value.
20
+ * @example 9
21
+ */
22
+ modeOfOperation: number;
23
+ /**
24
+ * Human-readable name of the active operation mode.
25
+ * @example "CyclicSyncVelocity"
26
+ */
27
+ modeName: string;
28
+ /**
29
+ * The setpoint currently commanded for the active mode — target position 0x607A (PP/CSP), velocity 0x60FF (PV/CSV), or torque 0x6071 (PT/CST), widened to INTEGER32. 0 only when the active mode has no linear setpoint (NoMode / Homing).
30
+ * @example 100000
31
+ */
32
+ target: number;
33
+ }
1
34
  /** Point-in-time health of the real-time game loop. Times are nanoseconds; rates are hertz. All fields are diagnostic (relaxed reads), not synchronised. */
2
35
  export interface GameLoopHealth {
3
36
  /**
@@ -382,10 +415,15 @@ export interface SlaveConfig {
382
415
  */
383
416
  slavePosition: number;
384
417
  /**
385
- * Device name for this slave position, empty if unknown
386
- * @example "SOMANET Node"
418
+ * SII device name for this slave position, empty if unknown. For SOMANET drives this is the generic group name "SOMANET"; use productName to distinguish products.
419
+ * @example "SOMANET"
387
420
  */
388
421
  deviceName: string;
422
+ /**
423
+ * Canonical product name, empty if unknown. For a recognised SOMANET product this distinguishes the product (e.g. "SOMANET Circulo"); otherwise it falls back to deviceName.
424
+ * @example "SOMANET Node"
425
+ */
426
+ productName: string;
389
427
  /**
390
428
  * Vendor ID from EEPROM (0 if the slave is unknown)
391
429
  * @format int64
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@synapticon/motion-master-client",
3
- "version": "6.0.0-alpha.50",
3
+ "version": "6.0.0-alpha.51",
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": {