motion-master-client 0.0.360 → 0.0.362

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/src/lib/cia402.js CHANGED
@@ -1,24 +1,6 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.supportedDriveModesBits = exports.modesOfOperationOptions = exports.ModesOfOperation = exports.cia402Transitions = exports.createControlwordCommand = exports.controlwordCommandBitmasks = exports.controlwordCommandOptions = exports.controlwordOptions = exports.getCommandFromControlword = exports.ControlwordCommand = exports.controlwordBits = exports.isInternalLimitActive = exports.getCia402State = exports.cia402StateMap = exports.Cia402State = exports.statuswordBits = void 0;
4
- exports.statuswordBits = [
5
- 'rtso = ready to switch on',
6
- 'so = switched on',
7
- 'oe = operation enabled',
8
- 'f = fault',
9
- 've = voltage enabled',
10
- 'qs = quick stop',
11
- 'sod = switch on disabled',
12
- 'w = warning',
13
- 'ms = manufacturer-specific',
14
- 'rm = remote',
15
- 'tr = target reached',
16
- 'ila = internal limit active',
17
- 'oms = operation-mode-specific',
18
- 'oms = operation-mode-specific',
19
- 'ms = manufacturer-specific',
20
- 'ms = manufacturer-specific',
21
- ];
3
+ exports.modesOfOperationOptions = exports.ModesOfOperation = exports.cia402Transitions = exports.createControlwordCommand = exports.controlwordCommandBitmasks = exports.controlwordCommandOptions = exports.controlwordOptions = exports.getCommandFromControlword = exports.ControlwordCommand = exports.isInternalLimitActive = exports.getCia402State = exports.cia402StateMap = exports.Cia402State = void 0;
22
4
  /**
23
5
  * CIA402 refers to the CANopen application profile for drives and motion control.
24
6
  * It defines various states that a CiA402-compliant device, such as a motor drive, can be in.
@@ -105,24 +87,6 @@ function isInternalLimitActive(statusword) {
105
87
  return (0x800 & statusword) === 0x800;
106
88
  }
107
89
  exports.isInternalLimitActive = isInternalLimitActive;
108
- exports.controlwordBits = [
109
- 'so = switch on',
110
- 'ev = enable voltage',
111
- 'qs = quick stop',
112
- 'eo = enable operation',
113
- 'oms = operation mode specific',
114
- 'oms = operation mode specific',
115
- 'oms = operation mode specific',
116
- 'fr = fault reset',
117
- 'h = halt',
118
- 'oms = operation mode specific',
119
- 'r = reserved',
120
- 'ms = manufacturer-specific',
121
- 'ms = manufacturer-specific',
122
- 'ms = manufacturer-specific',
123
- 'ms = manufacturer-specific',
124
- 'ms = manufacturer-specific',
125
- ];
126
90
  /**
127
91
  * In the CiA402 standard for drives and motion control, the controlword is a key component
128
92
  * used to command and control the operation of a CiA402-compliant device, such as a motor drive.
@@ -358,22 +322,4 @@ exports.modesOfOperationOptions = {
358
322
  'Cyclic synchronous velocity mode': ModesOfOperation.CYCLIC_SYNC_VELOCITY_MODE,
359
323
  'Cyclic synchronous torque mode': ModesOfOperation.CYCLIC_SYNC_TORQUE_MODE,
360
324
  };
361
- exports.supportedDriveModesBits = [
362
- 'pp = profile position mode',
363
- 'vl = velocity mode',
364
- 'pv = profile velocity mode',
365
- 'tq = torque mode',
366
- 'r = reserved',
367
- 'hm = homing mode',
368
- 'ip = interpolated position mode',
369
- 'csp = cyclic synchronous position mode',
370
- 'csv = cyclic synchronous velocity mode',
371
- 'cst = cyclic synchronous torque mode',
372
- 'r = reserved',
373
- 'r = reserved',
374
- 'r = reserved',
375
- 'r = reserved',
376
- 'r = reserved',
377
- 'r = reserved',
378
- ];
379
325
  //# sourceMappingURL=cia402.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"cia402.js","sourceRoot":"","sources":["../../../../../libs/motion-master-client/src/lib/cia402.ts"],"names":[],"mappings":";;;AAAa,QAAA,cAAc,GAAG;IAC5B,2BAA2B;IAC3B,kBAAkB;IAClB,wBAAwB;IACxB,WAAW;IACX,sBAAsB;IACtB,iBAAiB;IACjB,0BAA0B;IAC1B,aAAa;IACb,4BAA4B;IAC5B,aAAa;IACb,qBAAqB;IACrB,6BAA6B;IAC7B,+BAA+B;IAC/B,+BAA+B;IAC/B,4BAA4B;IAC5B,4BAA4B;CAC7B,CAAC;AAEF;;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AE,gBAAgB,CAAC,mBAAmB;IAC3D,aAAa,EAAE,gBAAgB,CAAC,WAAW;IAC3C,kCAAkC,EAAE,gBAAgB,CAAC,yBAAyB;IAC9E,kCAAkC,EAAE,gBAAgB,CAAC,yBAAyB;IAC9E,gCAAgC,EAAE,gBAAgB,CAAC,uBAAuB;CAC3E,CAAC;AAEW,QAAA,uBAAuB,GAAG;IACrC,4BAA4B;IAC5B,oBAAoB;IACpB,4BAA4B;IAC5B,kBAAkB;IAClB,cAAc;IACd,kBAAkB;IAClB,iCAAiC;IACjC,wCAAwC;IACxC,wCAAwC;IACxC,sCAAsC;IACtC,cAAc;IACd,cAAc;IACd,cAAc;IACd,cAAc;IACd,cAAc;IACd,cAAc;CACf,CAAC"}
1
+ {"version":3,"file":"cia402.js","sourceRoot":"","sources":["../../../../../libs/motion-master-client/src/lib/cia402.ts"],"names":[],"mappings":";;;AAAA;;;;;GAKG;AACH,IAAY,WAkEX;AAlED,WAAY,WAAW;IACrB;;;;;OAKG;IACH,gEAAiD,CAAA;IAEjD;;;;;OAKG;IACH,wDAAyC,CAAA;IAEzC;;;;;OAKG;IACH,wDAAyC,CAAA;IAEzC;;;;;OAKG;IACH,0CAA2B,CAAA;IAE3B;;;;;OAKG;IACH,sDAAuC,CAAA;IAEvC;;;;;OAKG;IACH,sDAAuC,CAAA;IAEvC;;;;;;OAMG;IACH,8DAA+C,CAAA;IAE/C;;;;;;OAMG;IACH,8BAAe,CAAA;AACjB,CAAC,EAlEW,WAAW,GAAX,mBAAW,KAAX,mBAAW,QAkEtB;AAEY,QAAA,cAAc,GAAG,IAAI,GAAG,CAAC;IACpC,CAAC,UAAU,EAAE,WAAW,CAAC,sBAAsB,CAAC;IAChD,CAAC,UAAU,EAAE,WAAW,CAAC,kBAAkB,CAAC;IAC5C,CAAC,UAAU,EAAE,WAAW,CAAC,kBAAkB,CAAC;IAC5C,CAAC,UAAU,EAAE,WAAW,CAAC,WAAW,CAAC;IACrC,CAAC,UAAU,EAAE,W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0B;IACzE,sBAAsB,EAAE,gBAAgB,CAAC,oBAAoB;IAC7D,kBAAkB,EAAE,gBAAgB,CAAC,gBAAgB;IACrD,qCAAqC,EAAE,gBAAgB,CAAC,mCAAmC;IAC3F,kBAAkB,EAAE,gBAAgB,CAAC,gBAAgB;IACrD,uBAAuB,EAAE,gBAAgB,CAAC,qBAAqB;IAC/D,uBAAuB,EAAE,gBAAgB,CAAC,qBAAqB;IAC/D,qBAAqB,EAAE,gBAAgB,CAAC,mBAAmB;IAC3D,aAAa,EAAE,gBAAgB,CAAC,WAAW;IAC3C,kCAAkC,EAAE,gBAAgB,CAAC,yBAAyB;IAC9E,kCAAkC,EAAE,gBAAgB,CAAC,yBAAyB;IAC9E,gCAAgC,EAAE,gBAAgB,CAAC,uBAAuB;CAC3E,CAAC"}
@@ -174,3 +174,14 @@ export interface EncoderConfigurationUsage {
174
174
  * @link https://docs.google.com/spreadsheets/d/1E0HTiZQtGmby2BJ9kOGV0UwD3HT6xQ7QRLjNbXpx5V0/edit?usp=sharing
175
175
  */
176
176
  export declare function getEncoderConfigurationExceptionCase(productId: number, encoderPort: number, encoderType: number, firmwareMajorMinorVersion: string): EncoderConfigurationExceptionCase | undefined;
177
+ /**
178
+ * Computes the encoder resolution in bits from the total number of increments per revolution.
179
+ *
180
+ * The resolution in bits is calculated as the ceiling of the base-2 logarithm
181
+ * of the number of increments, which represents the minimum number of bits
182
+ * needed to uniquely represent each encoder position.
183
+ *
184
+ * @param increments - Total number of increments (counts) per revolution.
185
+ * @returns The encoder resolution in bits.
186
+ */
187
+ export declare function getEncoderResolutionBits(increments: number): number;
@@ -1,6 +1,6 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.getEncoderConfigurationExceptionCase = exports.getCirculoEncoderBatteryModeOptions = exports.getCirculoEncoderBatteryModeDefaultValue = exports.circuloEncoderBatteryModeMap = exports.mapCirculoEncoderRegisterValueToErrors = exports.circuloEncoderRegisterErrors = exports.CirculoEncoderRegisterAddress = void 0;
3
+ exports.getEncoderResolutionBits = exports.getEncoderConfigurationExceptionCase = exports.getCirculoEncoderBatteryModeOptions = exports.getCirculoEncoderBatteryModeDefaultValue = exports.circuloEncoderBatteryModeMap = exports.mapCirculoEncoderRegisterValueToErrors = exports.circuloEncoderRegisterErrors = exports.CirculoEncoderRegisterAddress = void 0;
4
4
  const semver_1 = require("semver");
5
5
  const product_1 = require("./product");
6
6
  /**
@@ -117,6 +117,64 @@ exports.circuloEncoderRegisterErrors = [
117
117
  fullDescription: '',
118
118
  },
119
119
  },
120
+ {
121
+ 1: {
122
+ name: 'STUP_ERR',
123
+ error: 'Startup error',
124
+ description: 'Erroneous startup procedure, e.g., I2C stuck-at, EEPROM read error or invalid CRC checksum stored in the EEPROM.',
125
+ remedy: 'Reboot iC-PVL.',
126
+ fullDescription: 'Erroneous startup procedure, e.g., I2C stuck-at, EEPROM read error or invalid CRC checksum stored in the EEPROM. No position acquisition is performed. Interfaces are blocked. Please revise configuration and checksums or replace EEPROM. Reboot iC-PVL.',
127
+ },
128
+ 2: {
129
+ name: 'CFG_ERR',
130
+ error: 'Internal configuration error',
131
+ description: 'This error is raised when the configuration stored in the internal RAM doesn’t match the CRC checksum.',
132
+ remedy: 'Reboot iC-PVL.',
133
+ fullDescription: 'This error is raised when the configuration stored in the internal RAM doesn’t match the CRC checksum. This can be caused for example by changing the configuration data without updating the checksum accordingly, or an unexpected level flip of one or more bits in the RAM configuration area. Position is invalid. Reboot iC-PVL. It can also be caused by writing to RAM configuration via I2C. CFG_ERR can be cleared by a SCLR command.',
134
+ },
135
+ 4: {
136
+ name: 'CTR_ERR',
137
+ error: 'Internal counter error',
138
+ description: 'The value stored in the internal multiturn counter doesn’t match the CRC checksum.',
139
+ remedy: 'Reboot iC-PVL.',
140
+ fullDescription: 'The value stored in the internal multiturn counter doesn’t match the CRC checksum. This can be caused for example by changing the multiturn counter value without updating the checksum accordingly, or and unexpected level flip of one or more bits in the multiturn counter RAM area. Position is invalid. Reboot iC-PVL. It can also be caused by writing to MT_COUNT via I2C. CTR_ERR can be cleared by a SCLR command.',
141
+ },
142
+ 8: {
143
+ name: 'POS_ERR',
144
+ error: 'Position error',
145
+ description: 'The position encoding observed an unexpected position jump, caused e.g. by excessive speed or excessive acceleration of the magnetic disc or tape.',
146
+ remedy: 'Reboot iC-PVL.',
147
+ fullDescription: 'The position encoding observed an unexpected position jump, caused e.g. by excessive speed or excessive acceleration of the magnetic disc or tape. Alternatively, this error bit is set on weak, disturbed magnetic signals or complete loss of magnet. Position is invalid. Optimize magnet position and cross-check angular velocity/acceleration. Reboot iC-PVL.',
148
+ },
149
+ 16: {
150
+ name: 'BAT_ERR',
151
+ error: 'Battery error',
152
+ description: 'Battery undervoltage according to Elec. Char. No. 404.',
153
+ remedy: 'Reboot iC-PVL.',
154
+ fullDescription: 'Battery undervoltage according to Elec. Char. No. 404. Position is invalid. Change battery. Reboot iC-PVL. Battery monitoring is active during VDD supply.',
155
+ },
156
+ 32: {
157
+ name: 'BAT_WRN',
158
+ error: 'Battery early warning',
159
+ description: 'Battery voltage early warning according to Elec. Char. No. 405.',
160
+ remedy: 'Switch off system, change battery and restart.',
161
+ fullDescription: 'Battery voltage early warning according to Elec. Char. No. 405. Battery may be changed during main supply (VDD) as soon as possible. Alternatively, halt system, read current position and restore it. Switch off system, change battery and restart. Restored position may be set as counter preload. Battery monitoring is active during VDD supply.',
162
+ },
163
+ 64: {
164
+ name: 'PDR',
165
+ error: 'Power down reset detected',
166
+ description: 'A power down reset was performed, caused by undervoltage considerably lower than the battery error threshold.',
167
+ remedy: '',
168
+ fullDescription: 'A power down reset was performed, caused by undervoltage considerably lower than the battery error threshold. Another reason may be due to insufficient stabilizing capacitors at the supply lines VDD and VBAT. If a power down reset is performed, all internal circuitry is initialized to its default state. Counter position is set to zero and the working state is reset to the POWON State. For power down reset, the voltage at VDDS is relevant. Therefore, it is only performed if both, VDD and VBAT are low. The voltage threshold is typically between 1.5 V and 2.5 V.',
169
+ },
170
+ 128: {
171
+ name: 'PRESET',
172
+ error: 'Pin preset detected',
173
+ description: 'This bit is set whenever the chip is coming from a power-down condition or a pin preset has been detected.',
174
+ remedy: '',
175
+ fullDescription: 'This bit is set whenever the chip is coming from a power-down condition or a pin preset has been detected. It may be cleared by issuing a SCLR or RESET command. This can be interpreted as an acknowledgment that the power-down condition or pin preset was intentional. If the bit is set later during field operation, it is most likely unintentional. The cause may have been an external disruption, a short circuit error on the PRE line or a complete loss of power supply (VDD and VBAT). The PRESET bit is also set if the sleep mode has been enabled or an i2C REBOOT has been performed.',
176
+ },
177
+ },
120
178
  ];
121
179
  /**
122
180
  * Maps a status register value to a list of corresponding encoder register errors.
@@ -273,4 +331,18 @@ function getEncoderConfigurationExceptionCase(productId, encoderPort, encoderTyp
273
331
  return;
274
332
  }
275
333
  exports.getEncoderConfigurationExceptionCase = getEncoderConfigurationExceptionCase;
334
+ /**
335
+ * Computes the encoder resolution in bits from the total number of increments per revolution.
336
+ *
337
+ * The resolution in bits is calculated as the ceiling of the base-2 logarithm
338
+ * of the number of increments, which represents the minimum number of bits
339
+ * needed to uniquely represent each encoder position.
340
+ *
341
+ * @param increments - Total number of increments (counts) per revolution.
342
+ * @returns The encoder resolution in bits.
343
+ */
344
+ function getEncoderResolutionBits(increments) {
345
+ return Math.ceil(Math.log2(increments));
346
+ }
347
+ exports.getEncoderResolutionBits = getEncoderResolutionBits;
276
348
  //# sourceMappingURL=encoder.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"encoder.js","sourceRoot":"","sources":["../../../../../libs/motion-master-client/src/lib/encoder.ts"],"names":[],"mappings":";;;AAAA,mCAAmC;AAGnC,uCAMmB;AAgCnB;;;;;GAKG;AACH,IAAY,6BAIX;AAJD,WAAY,6BAA6B;IACvC,yFAAc,CAAA;IACd,yFAAc,CAAA;IACd,0GAAuB,CAAA;AACzB,CAAC,EAJW,6BAA6B,GAA7B,qCAA6B,KAA7B,qCAA6B,QAIxC;AAED;;;;;;;;;;;;G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AAO,OAAO,CAAC;KAChB;IAED,SAAS;IACT,IACE,IAAA,kBAAS,EAAC,eAAe,EAAE,OAAO,CAAC;QACnC,IAAA,mCAAyB,EAAC,SAAS,EAAE,qBAAqB,CAAC;QAC3D,IAAA,6BAAmB,EAAC,WAAW,EAAE,SAAS,CAAC;QAC3C,CAAC,IAAA,+BAAqB,EAAC,WAAW,EAAE,SAAS,CAAC;QAC9C,WAAW,KAAK,CAAC,EACjB;QACA,OAAO,OAAO,CAAC;KAChB;IAED,SAAS;IACT,IACE,IAAA,kBAAS,EAAC,eAAe,EAAE,OAAO,CAAC;QACnC,IAAA,mCAAyB,EAAC,SAAS,EAAE,SAAS,CAAC;QAC/C,IAAA,6BAAmB,EAAC,WAAW,EAAE,SAAS,CAAC;QAC3C,IAAA,+BAAqB,EAAC,WAAW,EAAE,SAAS,CAAC;QAC7C,WAAW,KAAK,CAAC,EACjB;QACA,OAAO,OAAO,CAAC;KAChB;IAED,OAAO;AACT,CAAC;AA1CD,oFA0CC"}
1
+ {"version":3,"file":"encoder.js","sourceRoot":"","sources":["../../../../../libs/motion-master-client/src/lib/encoder.ts"],"names":[],"mappings":";;;AAAA,mCAAmC;AAGnC,uCAMmB;AAgCnB;;;;;GAKG;AACH,IAAY,6BAIX;AAJD,WAAY,6BAA6B;IACvC,yFAAc,CAAA;IACd,yFAAc,CAAA;IACd,0GAAuB,CAAA;AACzB,CAAC,EAJW,6BAA6B,GAA7B,qCAA6B,KAA7B,qCAA6B,QAIxC;AAED;;;;;;;;;;;;GAYG;AACU,QAAA,4BAA4B,GAA8C;IACrF;QACE,CAAC,EAAE;YACD,IAAI,EAAE,QAAQ;YACd,KAAK,EAAE,yCAAyC;YAChD,WAAW,EAAE,2DAA2D;YACxE,MAAM,EAAE,wCAAwC;YAChD,eAAe,EACb,uSAAuS;SAC1S;QACD,CAAC,EAAE;YACD,IAAI,EAAE,QAAQ;YACd,KAAK,EAAE,uCAAuC;YAC9C,WAAW,EAAE,sCAAsC;YACnD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ED,SAAS;IACT,IACE,IAAA,kBAAS,EAAC,eAAe,EAAE,OAAO,CAAC;QACnC,IAAA,mCAAyB,EAAC,SAAS,EAAE,SAAS,CAAC;QAC/C,IAAA,6BAAmB,EAAC,WAAW,EAAE,SAAS,CAAC;QAC3C,IAAA,+BAAqB,EAAC,WAAW,EAAE,SAAS,CAAC;QAC7C,WAAW,KAAK,CAAC,EACjB;QACA,OAAO,OAAO,CAAC;KAChB;IAED,OAAO;AACT,CAAC;AA1CD,oFA0CC;AAED;;;;;;;;;GASG;AACH,SAAgB,wBAAwB,CAAC,UAAkB;IACzD,OAAO,IAAI,CAAC,IAAI,CAAC,IAAI,CAAC,IAAI,CAAC,UAAU,CAAC,CAAC,CAAC;AAC1C,CAAC;AAFD,4DAEC"}
@@ -0,0 +1,90 @@
1
+ /**
2
+ * Represents detailed information for a specific encoder error code.
3
+ */
4
+ export interface IntegroIntegratedEncoderErrorCodeInfo {
5
+ /** The 16-bit numeric error code. */
6
+ errorCode: number;
7
+ /** A short, human-readable name for the error. */
8
+ name: string;
9
+ /** A detailed description explaining the error. */
10
+ description: string;
11
+ /** The category or type of error (e.g., hardware, communication, logic). */
12
+ category: string;
13
+ /** Expected behavior or consequence when this error occurs. */
14
+ behavior: string;
15
+ }
16
+ /**
17
+ * Represents a parsed encoder error register value.
18
+ *
19
+ * Combines the raw register value, extracted debug information,
20
+ * and the associated structured error description.
21
+ */
22
+ export interface IntegroIntegratedEncoderError {
23
+ /** The lower 16 bits of the register containing debug information. */
24
+ debugInfo: number;
25
+ /** The original 32-bit value read from the encoder error register. */
26
+ registerValue: number;
27
+ /** Structured information about the encoder error code. */
28
+ errorInfo: IntegroIntegratedEncoderErrorCodeInfo;
29
+ }
30
+ /**
31
+ * Predefined list of known encoder error codes and their detailed descriptions.
32
+ *
33
+ * Each entry provides structured information about a specific error code, including:
34
+ * - `errorCode`: The numeric 16-bit error code.
35
+ * - `name`: A short, human-readable name of the error.
36
+ * - `description`: Detailed explanation of the error.
37
+ * - `category`: Classification of the error type (e.g., initialization, signal, command).
38
+ * - `behavior`: Expected behavior or consequence when this error occurs.
39
+ *
40
+ * This array is used by functions like `getIntegroIntegratedEncoderErrorDescription` to
41
+ * resolve a numeric error code into a structured, human-readable format.
42
+ */
43
+ export declare const integroIntegratedEncoderErrorCodeDescriptions: IntegroIntegratedEncoderErrorCodeInfo[];
44
+ /**
45
+ * Splits a 32-bit encoder error register value into its two logical components.
46
+ *
47
+ * The encoder returns a 32-bit integer where:
48
+ * - The upper 16 bits represent the `errorCode`.
49
+ * - The lower 16 bits contain `debugInfo` specific to that error.
50
+ *
51
+ * This function extracts both components and returns them as separate properties.
52
+ *
53
+ * @param registerValue - The 32-bit value read from the encoder error register.
54
+ * @returns An object containing:
55
+ * - `errorCode`: The 16-bit error code.
56
+ * - `debugInfo`: The 16-bit debug information associated with the error.
57
+ */
58
+ export declare function splitIntegroIntegratedEncoderErrorValue(registerValue: number): {
59
+ errorCode: number;
60
+ debugInfo: number;
61
+ };
62
+ /**
63
+ * Retrieves a structured description for a specific encoder error code.
64
+ *
65
+ * This function looks up the provided `errorCode` in the predefined list of known
66
+ * encoder error codes and returns the corresponding description object. If the
67
+ * error code is not recognized, a default description is returned.
68
+ *
69
+ * @param errorCode - The 16-bit error code extracted from the encoder register.
70
+ * @returns The error description object matching the given code, or a default
71
+ * description if the code is unknown.
72
+ */
73
+ export declare function getIntegroIntegratedEncoderErrorDescription(errorCode: number): IntegroIntegratedEncoderErrorCodeInfo;
74
+ /**
75
+ * Parses a 32-bit encoder error register value into a structured error object.
76
+ *
77
+ * This utility provides a high-level interpretation of encoder error registers by:
78
+ * 1. Extracting the `errorCode` and `debugInfo` from the raw register value.
79
+ * 2. Resolving a human-readable description for the extracted error code.
80
+ * 3. Returning all relevant information in a structured format.
81
+ *
82
+ * If the extracted `errorCode` is not recognized, the `errorInfo` field will be `undefined`.
83
+ *
84
+ * @param registerValue - The 32-bit integer value read from the encoder error register.
85
+ * @returns An object containing:
86
+ * - `registerValue`: The original raw register value.
87
+ * - `debugInfo`: Additional debug information extracted from the register.
88
+ * - `errorInfo`: Optional detailed description of the error, or `undefined` if unknown.
89
+ */
90
+ export declare function parseIntegroIntegratedEncoderError(registerValue: number): IntegroIntegratedEncoderError;
@@ -0,0 +1,179 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.parseIntegroIntegratedEncoderError = exports.getIntegroIntegratedEncoderErrorDescription = exports.splitIntegroIntegratedEncoderErrorValue = exports.integroIntegratedEncoderErrorCodeDescriptions = void 0;
4
+ /**
5
+ * Predefined list of known encoder error codes and their detailed descriptions.
6
+ *
7
+ * Each entry provides structured information about a specific error code, including:
8
+ * - `errorCode`: The numeric 16-bit error code.
9
+ * - `name`: A short, human-readable name of the error.
10
+ * - `description`: Detailed explanation of the error.
11
+ * - `category`: Classification of the error type (e.g., initialization, signal, command).
12
+ * - `behavior`: Expected behavior or consequence when this error occurs.
13
+ *
14
+ * This array is used by functions like `getIntegroIntegratedEncoderErrorDescription` to
15
+ * resolve a numeric error code into a structured, human-readable format.
16
+ */
17
+ exports.integroIntegratedEncoderErrorCodeDescriptions = [
18
+ {
19
+ errorCode: 0x0000,
20
+ name: 'No Error',
21
+ description: 'No error was detected.',
22
+ category: 'None',
23
+ behavior: 'None',
24
+ },
25
+ {
26
+ errorCode: 0x0001,
27
+ name: 'ADC1 Calibration not finished',
28
+ description: 'ADC1 calibration on initialization was never finished and aborted. Signal processing did not get started.',
29
+ category: 'Initialization error (µC Peripheral)',
30
+ behavior: 'No signal processing is done. No valid position will be output. Error bit set. Error cannot be reset by command.',
31
+ },
32
+ {
33
+ errorCode: 0x0002,
34
+ name: 'ADC2 Calibration not finished',
35
+ description: 'ADC2 calibration on initialization was never finished and aborted. Signal processing did not get started.',
36
+ category: 'Initialization error (µC Peripheral)',
37
+ behavior: 'No signal processing is done. No valid position will be output. Error bit set. Error cannot be reset by command.',
38
+ },
39
+ {
40
+ errorCode: 0x0006,
41
+ name: 'Flash unlock fail',
42
+ description: 'Flash could not be unlocked for writing.',
43
+ category: 'Command execution error',
44
+ behavior: 'Warning bit raised.',
45
+ },
46
+ {
47
+ errorCode: 0x0007,
48
+ name: 'Flash busy',
49
+ description: 'Flash operation could not be executed since flash was already busy.',
50
+ category: 'Command execution error',
51
+ behavior: 'Warning bit raised.',
52
+ },
53
+ {
54
+ errorCode: 0x0008,
55
+ name: 'Flash loop timeout',
56
+ description: 'A flash operation did not finish in its expected time so was aborted.',
57
+ category: 'Command execution error',
58
+ behavior: 'Warning bit raised.',
59
+ },
60
+ {
61
+ errorCode: 0x0009,
62
+ name: 'Reference voltage init fail',
63
+ description: 'The reference voltage buffer could not be initialized. Signal processing did not get started.',
64
+ category: 'Initialization error (µC Peripheral)',
65
+ behavior: 'No signal processing is done. No valid position will be output. Error bit set. Error cannot be reset by command.',
66
+ },
67
+ {
68
+ errorCode: 0x000a,
69
+ name: 'POA nvm read fail',
70
+ description: 'POA startup values could not be read properly.',
71
+ category: 'Initialization error (no valid data or no flash access)',
72
+ behavior: 'Default will be loaded. Warning bit raised.',
73
+ },
74
+ {
75
+ errorCode: 0x000b,
76
+ name: 'POA nvm write fail',
77
+ description: 'POA startup values could not be written.',
78
+ category: 'Command execution error',
79
+ behavior: 'Warning bit raised.',
80
+ },
81
+ {
82
+ errorCode: 0x000c,
83
+ name: 'Signal processing nvm read fail',
84
+ description: 'Signal processing data could not be read properly.',
85
+ category: 'Initialization error (no valid data or no flash access)',
86
+ behavior: 'Default will be loaded.',
87
+ },
88
+ {
89
+ errorCode: 0x000d,
90
+ name: 'Signal processing nvm write fail',
91
+ description: 'Signal processing data could not be written.',
92
+ category: 'Command execution error',
93
+ behavior: 'Warning bit raised.',
94
+ },
95
+ {
96
+ errorCode: 0x000e,
97
+ name: 'Input magnitude too small',
98
+ description: 'Analog signal input magnitude is below the accepted threshold. Process data not valid.',
99
+ category: 'Signal error',
100
+ behavior: 'Error bit raised. PV bit reset.',
101
+ },
102
+ {
103
+ errorCode: 0x000f,
104
+ name: 'Calibration not plausible',
105
+ description: 'Calibration data plausibility check failed.',
106
+ category: 'Signal error',
107
+ behavior: 'Warning bit raised.',
108
+ },
109
+ {
110
+ errorCode: 0x0010,
111
+ name: 'Wiegand pulse missing',
112
+ description: 'A Wiegand pulse was not detected where expected.',
113
+ category: 'Signal error',
114
+ behavior: 'Warning bit raised.',
115
+ },
116
+ ];
117
+ /**
118
+ * Splits a 32-bit encoder error register value into its two logical components.
119
+ *
120
+ * The encoder returns a 32-bit integer where:
121
+ * - The upper 16 bits represent the `errorCode`.
122
+ * - The lower 16 bits contain `debugInfo` specific to that error.
123
+ *
124
+ * This function extracts both components and returns them as separate properties.
125
+ *
126
+ * @param registerValue - The 32-bit value read from the encoder error register.
127
+ * @returns An object containing:
128
+ * - `errorCode`: The 16-bit error code.
129
+ * - `debugInfo`: The 16-bit debug information associated with the error.
130
+ */
131
+ function splitIntegroIntegratedEncoderErrorValue(registerValue) {
132
+ return {
133
+ errorCode: (registerValue >>> 16) & 0xffff,
134
+ debugInfo: registerValue & 0xffff,
135
+ };
136
+ }
137
+ exports.splitIntegroIntegratedEncoderErrorValue = splitIntegroIntegratedEncoderErrorValue;
138
+ /**
139
+ * Retrieves a structured description for a specific encoder error code.
140
+ *
141
+ * This function looks up the provided `errorCode` in the predefined list of known
142
+ * encoder error codes and returns the corresponding description object. If the
143
+ * error code is not recognized, a default description is returned.
144
+ *
145
+ * @param errorCode - The 16-bit error code extracted from the encoder register.
146
+ * @returns The error description object matching the given code, or a default
147
+ * description if the code is unknown.
148
+ */
149
+ function getIntegroIntegratedEncoderErrorDescription(errorCode) {
150
+ var _a;
151
+ return ((_a = exports.integroIntegratedEncoderErrorCodeDescriptions.find((e) => e.errorCode === errorCode)) !== null && _a !== void 0 ? _a : exports.integroIntegratedEncoderErrorCodeDescriptions[0]);
152
+ }
153
+ exports.getIntegroIntegratedEncoderErrorDescription = getIntegroIntegratedEncoderErrorDescription;
154
+ /**
155
+ * Parses a 32-bit encoder error register value into a structured error object.
156
+ *
157
+ * This utility provides a high-level interpretation of encoder error registers by:
158
+ * 1. Extracting the `errorCode` and `debugInfo` from the raw register value.
159
+ * 2. Resolving a human-readable description for the extracted error code.
160
+ * 3. Returning all relevant information in a structured format.
161
+ *
162
+ * If the extracted `errorCode` is not recognized, the `errorInfo` field will be `undefined`.
163
+ *
164
+ * @param registerValue - The 32-bit integer value read from the encoder error register.
165
+ * @returns An object containing:
166
+ * - `registerValue`: The original raw register value.
167
+ * - `debugInfo`: Additional debug information extracted from the register.
168
+ * - `errorInfo`: Optional detailed description of the error, or `undefined` if unknown.
169
+ */
170
+ function parseIntegroIntegratedEncoderError(registerValue) {
171
+ const { errorCode, debugInfo } = splitIntegroIntegratedEncoderErrorValue(registerValue);
172
+ return {
173
+ registerValue,
174
+ debugInfo,
175
+ errorInfo: getIntegroIntegratedEncoderErrorDescription(errorCode),
176
+ };
177
+ }
178
+ exports.parseIntegroIntegratedEncoderError = parseIntegroIntegratedEncoderError;
179
+ //# sourceMappingURL=integro.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"integro.js","sourceRoot":"","sources":["../../../../../libs/motion-master-client/src/lib/integro.ts"],"names":[],"mappings":";;;AAqCA;;;;;;;;;;;;GAYG;AACU,QAAA,6CAA6C,GAA4C;IACpG;QACE,SAAS,EAAE,MAAM;QACjB,IAAI,EAAE,UAAU;QAChB,WAAW,EAAE,wBAAwB;QACrC,QAAQ,EAAE,MAAM;QAChB,QAAQ,EAAE,MAAM;KACjB;IACD;QACE,SAAS,EAAE,MAAM;QACjB,IAAI,EAAE,+BAA+B;QACrC,WAAW,EACT,2GAA2G;QAC7G,QAAQ,EAAE,sCAAsC;QAChD,QAAQ,EACN,kHAAkH;KACrH;IACD;QACE,SAAS,EAAE,MAAM;QACjB,IAAI,EAAE,+BAA+B;QACrC,WAAW,EACT,2GAA2G;QAC7G,QAAQ,EAAE,sCAAsC;QAChD,QAAQ,EACN,kHAAkH;KACrH;IACD;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,cAAc;QACxB,QAAQ,EAAE,iCAAiC;KAC5C;IACD;QACE,SAAS,EAAE,MAAM;QACjB,IAAI,EAAE,2BAA2B;QACjC,WAAW,EAAE,6CAA6C;QAC1D,QAAQ,EAAE,cAAc;QACxB,QAAQ,EAAE,qBAAqB;KAChC;IACD;QACE,SAAS,EAAE,MAAM;QACjB,IAAI,EAAE,uBAAuB;QAC7B,WAAW,EAAE,kDAAkD;QAC/D,QAAQ,EAAE,cAAc;QACxB,QAAQ,EAAE,qBAAqB;KAChC;CACF,CAAC;AAEF;;;;;;;;;;;;;GAaG;AACH,SAAgB,uCAAuC,CAAC,aAAqB;IAI3E,OAAO;QACL,SAAS,EAAE,CAAC,aAAa,KAAK,EAAE,CAAC,GAAG,MAAM;QAC1C,SAAS,EAAE,aAAa,GAAG,MAAM;KAClC,CAAC;AACJ,CAAC;AARD,0FAQC;AAED;;;;;;;;;;GAUG;AACH,SAAgB,2CAA2C,CAAC,SAAiB;;IAC3E,OAAO,CACL,MAAA,qDAA6C,CAAC,IAAI,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC,CAAC,SAAS,KAAK,SAAS,CAAC,mCACpF,qDAA6C,CAAC,CAAC,CAAC,CACjD,CAAC;AACJ,CAAC;AALD,kGAKC;AAED;;;;;;;;;;;;;;;GAeG;AACH,SAAgB,kCAAkC,CAAC,aAAqB;IACtE,MAAM,EAAE,SAAS,EAAE,SAAS,EAAE,GAAG,uCAAuC,CAAC,aAAa,CAAC,CAAC;IAExF,OAAO;QACL,aAAa;QACb,SAAS;QACT,SAAS,EAAE,2CAA2C,CAAC,SAAS,CAAC;KAClE,CAAC;AACJ,CAAC;AARD,gFAQC"}
@@ -16,6 +16,7 @@ import { SmmParameter } from './smm';
16
16
  import { DataType } from 'python-struct';
17
17
  import { CirculoIntegratedEncoderI2CDeviceId } from './circulo';
18
18
  import { EncoderRegisterError } from './encoder';
19
+ import { IntegroIntegratedEncoderError } from './integro';
19
20
  /**
20
21
  * This class contains methods for making requests to Motion Master using the injected request/response socket.
21
22
  *
@@ -1348,6 +1349,23 @@ export declare class MotionMasterReqResClient {
1348
1349
  * The returned number follows this format: 9240828, representing version 9 from August 28, 2024.
1349
1350
  */
1350
1351
  getIntegroEncoderFirmwareVersion(deviceRef: DeviceRef): Observable<KublerEncoderRegisterCommunicationOsCommandResponse>;
1352
+ /**
1353
+ * Reads and parses the error register from an Integro integrated encoder.
1354
+ *
1355
+ * This method sends a command to the specified device to read the encoder error
1356
+ * register (register address 0x62, length 4 bytes) using the Kübler Encoder
1357
+ * Register Communication OS command protocol.
1358
+ *
1359
+ * The raw 32-bit register value returned by the device is automatically parsed
1360
+ * into a structured object containing:
1361
+ * - the extracted 16-bit error code,
1362
+ * - the associated 16-bit debug information,
1363
+ * - an optional human-readable error description if the code is recognized.
1364
+ *
1365
+ * @param deviceRef Reference to the target device from which to read the error register.
1366
+ * @returns An Observable that emits the parsed encoder error details.
1367
+ */
1368
+ readoutIntegroIntegratedEncoderError(deviceRef: DeviceRef): Observable<IntegroIntegratedEncoderError>;
1351
1369
  /**
1352
1370
  * @todo Document this method and consider removing the void return type.
1353
1371
  */
@@ -29,6 +29,7 @@ const fetch_1 = require("./fetch");
29
29
  const circulo_1 = require("./circulo");
30
30
  const encoder_1 = require("./encoder");
31
31
  const pdo_1 = require("./pdo");
32
+ const integro_1 = require("./integro");
32
33
  const { xmlToEsi } = require('ecatmod');
33
34
  /**
34
35
  * This class contains methods for making requests to Motion Master using the injected request/response socket.
@@ -2723,6 +2724,25 @@ class MotionMasterReqResClient {
2723
2724
  getIntegroEncoderFirmwareVersion(deviceRef) {
2724
2725
  return this.runKublerEncoderRegisterCommunicationOsCommand(deviceRef, 0, 4, 4);
2725
2726
  }
2727
+ /**
2728
+ * Reads and parses the error register from an Integro integrated encoder.
2729
+ *
2730
+ * This method sends a command to the specified device to read the encoder error
2731
+ * register (register address 0x62, length 4 bytes) using the Kübler Encoder
2732
+ * Register Communication OS command protocol.
2733
+ *
2734
+ * The raw 32-bit register value returned by the device is automatically parsed
2735
+ * into a structured object containing:
2736
+ * - the extracted 16-bit error code,
2737
+ * - the associated 16-bit debug information,
2738
+ * - an optional human-readable error description if the code is recognized.
2739
+ *
2740
+ * @param deviceRef Reference to the target device from which to read the error register.
2741
+ * @returns An Observable that emits the parsed encoder error details.
2742
+ */
2743
+ readoutIntegroIntegratedEncoderError(deviceRef) {
2744
+ return this.runKublerEncoderRegisterCommunicationOsCommand(deviceRef, 0, 0x62, 4, 0, 5000).pipe((0, operators_1.map)((response) => (0, integro_1.parseIntegroIntegratedEncoderError)(response.kublerRegisterValue)));
2745
+ }
2726
2746
  /**
2727
2747
  * @todo Document this method and consider removing the void return type.
2728
2748
  */
@@ -4242,5 +4262,4 @@ function extractFirmwareProductSupportedOptions(supportedOptionsPromise, firmwar
4242
4262
  return (_b = (_a = supportedOptions[`${major}.${minor}`]) === null || _a === void 0 ? void 0 : _a[`${versionedDeviceProductId}`]) !== null && _b !== void 0 ? _b : [];
4243
4263
  }));
4244
4264
  }
4245
- ;
4246
4265
  //# sourceMappingURL=motion-master-req-res-client.js.map