motion-master-client 0.0.422 → 0.0.423
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/package.json +1 -1
- package/src/api.js +44 -39
- package/src/api.js.map +1 -1
- package/src/lib/motion-master-req-res-client.d.ts +75 -20
- package/src/lib/motion-master-req-res-client.js +230 -171
- package/src/lib/motion-master-req-res-client.js.map +1 -1
- package/src/lib/smm.d.ts +12 -1
- package/src/lib/smm.js +17 -1
- package/src/lib/smm.js.map +1 -1
- package/src/lib/types.d.ts +40 -0
|
@@ -6,7 +6,7 @@ import { HardwareDescription, StackInfo } from './hardware-description';
|
|
|
6
6
|
import { MotionMasterReqResSocket } from './motion-master-req-res-socket';
|
|
7
7
|
import { UIFeaturesConfig } from './parameter';
|
|
8
8
|
import { SystemLogLine } from './system-log-line';
|
|
9
|
-
import { MotionMasterMessage, ParameterValueType, ParameterTypeValue, DeviceParameterValuesStatus, ParameterTypeValueKey, DeviceRefObj, DeviceRef, FullAutoTuningStatus, SystemVersionStatus, DeviceInfoStatus, DeviceParameterInfoStatus, GetDeviceParameterInfoRequest, GetDeviceParameterValuesRequest, GetMultiDeviceParameterValuesRequest, MultiDeviceParameterValuesStatus, SetDeviceParameterValuesRequest, SetMultiDeviceParameterValuesRequest, GetDeviceFileListRequest, DeviceFileListStatus, GetDeviceFileRequest, DeviceFileStatus, SetDeviceFileRequest, DeleteDeviceFileRequest, ResetDeviceFaultRequest, DeviceFaultResetStatus, StopDeviceRequest, DeviceStopStatus, StartDeviceFirmwareInstallationRequest, DeviceFirmwareInstallationStatus, GetDeviceLogRequest, DeviceLogStatus, StartCoggingTorqueRecordingRequest, CoggingTorqueRecordingStatus, GetCoggingTorqueDataRequest, CoggingTorqueDataStatus, StartOffsetDetectionRequest, OffsetDetectionStatus, StartPlantModelIdentificationRequest, PlantIdentificationStatus, ComputeAutoTuningGainsRequest, AutoTuningStatus, SetMotionControllerParametersRequest, MotionControllerStatus, EnableMotionControllerRequest, SetSignalGeneratorParametersRequest, SignalGeneratorStatus, StopSignalGeneratorRequest, StartMonitoringDeviceParameterValuesRequest, MonitoringParameterValuesStatus, StopMonitoringDeviceParameterValuesRequest, GetEthercatNetworkStateRequest, EthercatNetworkStateStatus, SetEthercatNetworkStateRequest, StartNarrowAngleCalibrationRequest, NarrowAngleCalibrationStatus, SetSystemClientTimeoutRequest, StartSystemIdentificationRequest, SystemIdentificationStatus, CirculoEncoderMagnetDistanceStatus, StartCirculoEncoderNarrowAngleCalibrationProcedureRequest, CirculoEncoderNarrowAngleCalibrationProcedureStatus, GetDeviceCiA402StateRequest, DeviceCiA402StateStatus, SetDeviceCiA402StateRequest, SystemLogStatus, StartDeviceSiiRestoreRequest, DeviceSiiRestoreStatus, StartOpenLoopFieldControlRequest, OpenLoopFieldControlStatus, ComputeFullAutoTuningGainsRequest, StartFullAutoTuningRequest, StopFullAutoTuningRequest, StartCirculoEncoderConfigurationRequest, CirculoEncoderConfigurationStatus, StopCirculoEncoderNarrowAngleCalibrationProcedureRequest, StartOsCommandRequest, OsCommandStatus, RestoreDefaultParametersType, DeviceParameterAddressValue, DeviceParameterIds, DeviceParameterInfo, RequestStatusMessage, UiPdoMapping, UiConfig, ExecuteForwardCallRequest, ForwardCallStatus, PlantModel, NotchFilter, LoadConfigStrategy, SystemInformationStatus, SetPdoModeRequest, PdoModeStatus, GetDeviceSiiRequest, DeviceSiiStatus, SmmAutomatedUpdate } from './types';
|
|
9
|
+
import { MotionMasterMessage, ParameterValueType, ParameterTypeValue, DeviceParameterValuesStatus, ParameterTypeValueKey, DeviceRefObj, DeviceRef, FullAutoTuningStatus, SystemVersionStatus, DeviceInfoStatus, DeviceParameterInfoStatus, GetDeviceParameterInfoRequest, GetDeviceParameterValuesRequest, GetMultiDeviceParameterValuesRequest, MultiDeviceParameterValuesStatus, SetDeviceParameterValuesRequest, SetMultiDeviceParameterValuesRequest, GetDeviceFileListRequest, DeviceFileListStatus, GetDeviceFileRequest, DeviceFileStatus, SetDeviceFileRequest, DeleteDeviceFileRequest, ResetDeviceFaultRequest, DeviceFaultResetStatus, StopDeviceRequest, DeviceStopStatus, StartDeviceFirmwareInstallationRequest, DeviceFirmwareInstallationStatus, GetDeviceLogRequest, DeviceLogStatus, StartCoggingTorqueRecordingRequest, CoggingTorqueRecordingStatus, GetCoggingTorqueDataRequest, CoggingTorqueDataStatus, StartOffsetDetectionRequest, OffsetDetectionStatus, StartPlantModelIdentificationRequest, PlantIdentificationStatus, ComputeAutoTuningGainsRequest, AutoTuningStatus, SetMotionControllerParametersRequest, MotionControllerStatus, EnableMotionControllerRequest, SetSignalGeneratorParametersRequest, SignalGeneratorStatus, StopSignalGeneratorRequest, StartMonitoringDeviceParameterValuesRequest, MonitoringParameterValuesStatus, StopMonitoringDeviceParameterValuesRequest, GetEthercatNetworkStateRequest, EthercatNetworkStateStatus, SetEthercatNetworkStateRequest, StartNarrowAngleCalibrationRequest, NarrowAngleCalibrationStatus, SetSystemClientTimeoutRequest, StartSystemIdentificationRequest, SystemIdentificationStatus, CirculoEncoderMagnetDistanceStatus, StartCirculoEncoderNarrowAngleCalibrationProcedureRequest, CirculoEncoderNarrowAngleCalibrationProcedureStatus, GetDeviceCiA402StateRequest, DeviceCiA402StateStatus, SetDeviceCiA402StateRequest, SystemLogStatus, StartDeviceSiiRestoreRequest, DeviceSiiRestoreStatus, StartOpenLoopFieldControlRequest, OpenLoopFieldControlStatus, ComputeFullAutoTuningGainsRequest, StartFullAutoTuningRequest, StopFullAutoTuningRequest, StartCirculoEncoderConfigurationRequest, CirculoEncoderConfigurationStatus, StopCirculoEncoderNarrowAngleCalibrationProcedureRequest, StartOsCommandRequest, OsCommandStatus, RestoreDefaultParametersType, DeviceParameterAddressValue, DeviceParameterIds, DeviceParameterInfo, RequestStatusMessage, UiPdoMapping, UiConfig, ExecuteForwardCallRequest, ForwardCallStatus, PlantModel, NotchFilter, LoadConfigStrategy, SystemInformationStatus, SetPdoModeRequest, PdoModeStatus, GetDeviceSiiRequest, DeviceSiiStatus, SmmAutomatedUpdate, SmmAutomatedUpdateProgress, SmmSoftwareUpdateProgress } from './types';
|
|
10
10
|
import { Cia402State, ModesOfOperation } from './cia402';
|
|
11
11
|
import { EncoderRegisterCommunicationOsCommandResponse, MotorPhaseOrderDetectionOsCommandResponse, OpenPhaseDetectionOsCommandResponse, OsCommandMode, OsCommandResponse, PhaseResistanceMeasurementOsCommandResponse, PhaseInductanceMeasurementOsCommandResponse, PolePairDetectionOsCommandResponse, CommutationOffsetMeasurementOsCommandResponse, IcMuCalibrationModeOsCommandResponse, OpenLoopFieldModeOsCommandResponse, HrdStreamingOsCommandResponse, TorqueConstantMeasurementOsCommandResponse, SkippedCyclesCounterOsCommandResponse, IgnoreBissStatusBitsOsCommandResponse, SystemIdentificationOsCommandResponse, KublerEncoderCommandOsCommandResponse, UseInternalEncoderVelocityOsCommandResponse, KublerEncoderRegisterCommunicationOsCommandResponse, SmmAcyclicHandlerOsCommandResponse, HrdStreamingOsCommandAction, HrdStreamingOsCommandDataIndex, SmmAcyclicHandlerLoadParametersForVerificationOsCommandResponse, ChirpSignalOptions, OsCommandAbortResult } from './os-command';
|
|
12
12
|
import { IntegroVariant } from './integro-variant';
|
|
@@ -238,9 +238,25 @@ export declare class MotionMasterReqResClient {
|
|
|
238
238
|
*
|
|
239
239
|
* If the requested file content is empty, Motion Master will return a not found error. This is subject to change now that Motion Master reads the file error codes.
|
|
240
240
|
*
|
|
241
|
-
* SOMANET_CiA_402.xml
|
|
241
|
+
* The ESI file ("SOMANET_CiA_402.xml" or "SOMANET_CiA_402.xml.zip") is never read from the device, see {@link getEsiFromIndexedDB}.
|
|
242
242
|
*/
|
|
243
243
|
getDeviceFile(props: GetDeviceFileRequest, requestTimeout: number, messageId?: string): Observable<DeviceFileStatus>;
|
|
244
|
+
/**
|
|
245
|
+
* Returns the ESI file cached in IndexedDB under the firmware version the device reports in 0x100A:00.
|
|
246
|
+
*
|
|
247
|
+
* The ESI file is never read from the device. Firmware installation no longer writes it to the device (see
|
|
248
|
+
* {@link installFirmwareAndCacheEsi}), and Motion Master does not remove a skipped file, so the file on the device may
|
|
249
|
+
* belong to an older firmware. Neither the file nor its ESI revision tells which firmware it belongs to.
|
|
250
|
+
* Caching it under the installed version would hide the correct ESI file for good.
|
|
251
|
+
*
|
|
252
|
+
* The ESI file gets into IndexedDB only from a firmware package: at firmware installation, see
|
|
253
|
+
* {@link cacheEsiFromFirmwarePackage}, or when a user loads it from a package in OBLAC Drives.
|
|
254
|
+
*
|
|
255
|
+
* Returns a failed status with the NOT_FOUND error code when the ESI file is not cached for the installed firmware,
|
|
256
|
+
* or when there is no IndexedDB, as outside the browser. Returns a failed status with the FAILED error code when the
|
|
257
|
+
* firmware version or IndexedDB can't be read.
|
|
258
|
+
*/
|
|
259
|
+
private getEsiFromIndexedDB;
|
|
244
260
|
private getDeviceFileUsingResolvedDeviceAddress;
|
|
245
261
|
/**
|
|
246
262
|
* Fixing a production screw-up that affects a very important customer. Added on February 29th, 2024.
|
|
@@ -315,8 +331,7 @@ export declare class MotionMasterReqResClient {
|
|
|
315
331
|
* Extracts the ESI file (SOMANET_CiA_402.xml) from a firmware package and stores its unzipped content in
|
|
316
332
|
* IndexedDB, keyed by the given firmware version.
|
|
317
333
|
*
|
|
318
|
-
*
|
|
319
|
-
* cached here, OBLAC can resolve it from IndexedDB without reading it back from the drive. This is what
|
|
334
|
+
* IndexedDB is the only source of the ESI file: {@link getDeviceFile} never reads it from the drive. This is what
|
|
320
335
|
* allows the ESI file (SOMANET_CiA_402.xml.zip) to be skipped during firmware installation, which avoids
|
|
321
336
|
* slow and unreliable FoE transfers and works around devices (e.g. NetX) that reject writing that file.
|
|
322
337
|
*
|
|
@@ -337,17 +352,18 @@ export declare class MotionMasterReqResClient {
|
|
|
337
352
|
* user-overridable: when `props.skipFiles` is provided it is passed through unchanged, so a caller can choose to
|
|
338
353
|
* still write the ESI by omitting it from that list.
|
|
339
354
|
* - Extracts the ESI from the package and stores it in IndexedDB keyed by firmware version (see
|
|
340
|
-
* {@link cacheEsiFromFirmwarePackage}) *before* the installation starts, so
|
|
341
|
-
*
|
|
342
|
-
*
|
|
343
|
-
*
|
|
355
|
+
* {@link cacheEsiFromFirmwarePackage}) *before* the installation starts, so {@link getDeviceFile} can return it
|
|
356
|
+
* as soon as the installation ends. IndexedDB is the only source of the ESI file: {@link getDeviceFile} never
|
|
357
|
+
* reads it from the drive, even when the ESI is also written there. A caching failure is logged but does not
|
|
358
|
+
* prevent installation; the ESI file is then not found until a user loads it from the package (Load ESI in
|
|
359
|
+
* OBLAC Drives).
|
|
344
360
|
*
|
|
345
361
|
* @param firmwareVersion - The firmware version to key the cached ESI by; this must match the value reported by
|
|
346
362
|
* the device parameter 0x100a:00 after installation, which {@link getDeviceFile} uses.
|
|
347
363
|
* For OBLAC firmware packages this is the version encoded in the package filename, see
|
|
348
364
|
* {@link extractFirmwareVersionFromFirmwarePackageFilename}. When it cannot be determined
|
|
349
365
|
* (e.g. an arbitrary package with an unrecognized filename), pass an empty value to skip
|
|
350
|
-
* caching; the
|
|
366
|
+
* caching; the ESI file is then not found unless it was cached before.
|
|
351
367
|
*/
|
|
352
368
|
installFirmwareAndCacheEsi(firmwareVersion: string | undefined, props: StartDeviceFirmwareInstallationRequest, requestTimeout: number, messageId?: string): Observable<DeviceFirmwareInstallationStatus>;
|
|
353
369
|
/**
|
|
@@ -1871,6 +1887,34 @@ export declare class MotionMasterReqResClient {
|
|
|
1871
1887
|
* The commands execute only when subscribed to, ensuring a strict sequence.
|
|
1872
1888
|
*/
|
|
1873
1889
|
updateSmmSoftware(deviceRef: DeviceRef, username: string, password: string, buffer: Uint8Array, crc: number, chunkSize?: number, commandTimeout?: number, responsePollingInterval?: number, fsBufferReadWriteTimeout?: number): Observable<void>;
|
|
1890
|
+
/**
|
|
1891
|
+
* Performs a complete SMM software update like {@link updateSmmSoftware}, reporting progress as it goes.
|
|
1892
|
+
*
|
|
1893
|
+
* A {@link SmmSoftwareUpdateProgress} value is emitted when each stage starts, once per transmitted chunk,
|
|
1894
|
+
* and a final `done` value after the SMM restart has been triggered. Use it to show the user what the
|
|
1895
|
+
* update is doing; transmitting a large software file can take many minutes.
|
|
1896
|
+
*
|
|
1897
|
+
* Parameters are the same as for {@link updateSmmSoftware}.
|
|
1898
|
+
*
|
|
1899
|
+
* @throws {Error} If `buffer` is empty or `chunkSize` is not a positive integer. Nothing is sent to the device then.
|
|
1900
|
+
* @throws {Error} If any step in the software update process fails.
|
|
1901
|
+
*/
|
|
1902
|
+
updateSmmSoftwareWithProgress(deviceRef: DeviceRef, username: string, password: string, buffer: Uint8Array, crc: number, chunkSize?: number, commandTimeout?: number, responsePollingInterval?: number, fsBufferReadWriteTimeout?: number): Observable<SmmSoftwareUpdateProgress>;
|
|
1903
|
+
/**
|
|
1904
|
+
* Waits until the SMM reports the expected software version.
|
|
1905
|
+
*
|
|
1906
|
+
* After an SMM software update the SMM restarts and boots the new software, which can take around 30 s.
|
|
1907
|
+
* Reads may fail or return the previous version during that time, so the version is polled until it
|
|
1908
|
+
* matches or the timeout expires.
|
|
1909
|
+
*
|
|
1910
|
+
* @param deviceRef - Reference to the target device.
|
|
1911
|
+
* @param expectedVersion - The expected SMM software version, bitwise encoded (e.g. 25344 for v99.0).
|
|
1912
|
+
* @param timeout - (Optional) How long to wait, in ms. Defaults to 90,000 ms.
|
|
1913
|
+
* @param pollingInterval - (Optional) Delay between reads, in ms. Defaults to 2000 ms.
|
|
1914
|
+
*
|
|
1915
|
+
* @throws {Error} If the SMM does not report the expected version within `timeout`.
|
|
1916
|
+
*/
|
|
1917
|
+
waitForSmmFirmwareVersion(deviceRef: DeviceRef, expectedVersion: number, timeout?: number, pollingInterval?: number): Observable<void>;
|
|
1874
1918
|
/**
|
|
1875
1919
|
* Resolves whether an automated SMM software update is allowed for the specified device.
|
|
1876
1920
|
*
|
|
@@ -1881,7 +1925,8 @@ export declare class MotionMasterReqResClient {
|
|
|
1881
1925
|
*
|
|
1882
1926
|
* The automation is only permitted when **all** of the following conditions are met:
|
|
1883
1927
|
* - The device is a recognized Somanet product (`isValidProduct`).
|
|
1884
|
-
* - The device belongs to the Circulo product family (`isCirculo`).
|
|
1928
|
+
* - The device belongs to the Circulo product family (`isCirculo`). ACTILINK-JD / JD Duo devices are judged
|
|
1929
|
+
* by the underlying Circulo from their hardware description, see {@link resolveEncoderProductId}.
|
|
1885
1930
|
* - The binary is encrypted (`isBinaryEncrypted`).
|
|
1886
1931
|
* - The binary targets one of the supported SMM versions — v1.4 (260) or v2.56 (568) (`isAllowedBinaryVersion`).
|
|
1887
1932
|
* - If targeting v2.56, the device SoC firmware version is ≥ 5.5.0 (`canInstallV256`).
|
|
@@ -1896,7 +1941,7 @@ export declare class MotionMasterReqResClient {
|
|
|
1896
1941
|
*
|
|
1897
1942
|
* @returns A promise that resolves to an {@link SmmAutomatedUpdate} object containing:
|
|
1898
1943
|
* - `isValidProduct` — Whether the device maps to a known Somanet product.
|
|
1899
|
-
* - `isCirculo` — Whether the device
|
|
1944
|
+
* - `isCirculo` — Whether the device is a Circulo or a Circulo-based ACTILINK-JD / JD Duo.
|
|
1900
1945
|
* - `isCirculo7` — Whether the device is a Circulo 7.
|
|
1901
1946
|
* - `isCirculo9` — Whether the device is a Circulo 9.
|
|
1902
1947
|
* - `isDeviceLw1` — Whether the device SMM firmware is below v1.3 (version < 259).
|
|
@@ -1911,7 +1956,8 @@ export declare class MotionMasterReqResClient {
|
|
|
1911
1956
|
*/
|
|
1912
1957
|
resolveSmmAutomatedUpdateConditions(deviceRef: DeviceRef, buffer: Uint8Array): Promise<SmmAutomatedUpdate>;
|
|
1913
1958
|
/**
|
|
1914
|
-
* Performs an automated, multi-step SMM software update to an encrypted firmware version on a Circulo device
|
|
1959
|
+
* Performs an automated, multi-step SMM software update to an encrypted firmware version on a Circulo device,
|
|
1960
|
+
* or a Circulo-based ACTILINK-JD / JD Duo (judged by the underlying Circulo).
|
|
1915
1961
|
*
|
|
1916
1962
|
* Before installing the target binary, this method evaluates the device state by calling
|
|
1917
1963
|
* {@link resolveSmmAutomatedUpdateConditions}. Based on the result, it determines which
|
|
@@ -1925,20 +1971,29 @@ export declare class MotionMasterReqResClient {
|
|
|
1925
1971
|
* - **v99.0 + Circulo 9**: v77.1 → target
|
|
1926
1972
|
* - **v77.0 or v77.1**: target only
|
|
1927
1973
|
*
|
|
1928
|
-
*
|
|
1974
|
+
* After each installation the SMM restarts. The next step starts only once the SMM reports the
|
|
1975
|
+
* version that was just installed (see {@link waitForSmmFirmwareVersion}), so a failed or
|
|
1976
|
+
* unfinished installation stops the sequence with an error instead of continuing blindly.
|
|
1977
|
+
*
|
|
1978
|
+
* Transfer settings that are not given are resolved from the device firmware with
|
|
1979
|
+
* {@link resolveSmmSoftwareUpdateTimings}. On firmware without fs-buffer streaming (< v5.2.0),
|
|
1980
|
+
* `chunkSize` is always 1000 and `commandTimeout` is at least 420,000 ms.
|
|
1929
1981
|
*
|
|
1930
1982
|
* @param deviceRef - Reference to the target device.
|
|
1931
1983
|
* @param username - Username used for SMM authentication.
|
|
1932
1984
|
* @param password - Password used for SMM authentication.
|
|
1933
1985
|
* @param buffer - The target encrypted firmware binary as a `Uint8Array`.
|
|
1934
1986
|
* @param crc - CRC32 checksum of the target firmware binary for integrity verification.
|
|
1935
|
-
* @param chunkSize - (Optional) Size of each data chunk transmitted per step, in bytes.
|
|
1936
|
-
*
|
|
1937
|
-
*
|
|
1987
|
+
* @param chunkSize - (Optional) Size of each data chunk transmitted per step, in bytes.
|
|
1988
|
+
* Defaults to 1,000,000 with streaming (one command per file) and 1000 without.
|
|
1989
|
+
* @param commandTimeout - (Optional) Timeout for each OS command in ms.
|
|
1990
|
+
* Defaults to 180,000 ms with streaming and 420,000 ms without.
|
|
1938
1991
|
* @param responsePollingInterval - (Optional) Polling interval for command responses in ms. Defaults to 1000 ms.
|
|
1939
|
-
* @param fsBufferReadWriteTimeout - (Optional) Timeout for fs-buffer read/write operations in ms.
|
|
1992
|
+
* @param fsBufferReadWriteTimeout - (Optional) Timeout for fs-buffer read/write operations in ms.
|
|
1993
|
+
* Defaults to 150,000 ms with streaming and 5000 ms without.
|
|
1940
1994
|
*
|
|
1941
|
-
* @returns An `Observable
|
|
1995
|
+
* @returns An `Observable` of {@link SmmAutomatedUpdateProgress} that reports each step and stage,
|
|
1996
|
+
* and completes when the full installation sequence finishes successfully.
|
|
1942
1997
|
*
|
|
1943
1998
|
* @throws {Error} With message `'Unknown product. Cannot perform SMM software update.'` if the device
|
|
1944
1999
|
* serial number does not map to a known Somanet product.
|
|
@@ -1946,9 +2001,9 @@ export declare class MotionMasterReqResClient {
|
|
|
1946
2001
|
* e.g. the device is not a Circulo, the binary is not encrypted, the target version is
|
|
1947
2002
|
* unsupported, the SoC firmware is below v5.5.0 (for SMM v2.56), or the device is
|
|
1948
2003
|
* already on SMM v1.3+.
|
|
1949
|
-
* @throws {Error} If any
|
|
2004
|
+
* @throws {Error} If any installation step fails, or the SMM does not report the installed version afterwards.
|
|
1950
2005
|
*/
|
|
1951
|
-
updateSmmSoftwareToEncrypted(deviceRef: DeviceRef, username: string, password: string, buffer: Uint8Array, crc: number, chunkSize?: number, commandTimeout?: number, responsePollingInterval?: number, fsBufferReadWriteTimeout?: number): Observable<
|
|
2006
|
+
updateSmmSoftwareToEncrypted(deviceRef: DeviceRef, username: string, password: string, buffer: Uint8Array, crc: number, chunkSize?: number, commandTimeout?: number, responsePollingInterval?: number, fsBufferReadWriteTimeout?: number): Observable<SmmAutomatedUpdateProgress>;
|
|
1952
2007
|
/**
|
|
1953
2008
|
* Transmits SMM parameters to the specified device.
|
|
1954
2009
|
*
|