motion-master-client 0.0.77 → 0.0.86
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/README.md +227 -138
- package/package.json +1 -1
- package/src/cli.d.ts +1 -1
- package/src/cli.js +160 -160
- package/src/index.d.ts +30 -28
- package/src/index.js +33 -31
- package/src/index.js.map +1 -1
- package/src/lib/cia402.d.ts +184 -182
- package/src/lib/cia402.js +393 -391
- package/src/lib/cia402.js.map +1 -1
- package/src/lib/config-file.d.ts +13 -13
- package/src/lib/config-file.js +49 -49
- package/src/lib/data-monitoring.d.ts +12 -12
- package/src/lib/data-monitoring.js +33 -33
- package/src/lib/device-log-line.d.ts +5 -5
- package/src/lib/device-log-line.js +2 -2
- package/src/lib/device-parameter.d.ts +56 -56
- package/src/lib/device-parameter.js +38 -38
- package/src/lib/device.d.ts +46 -9
- package/src/lib/device.js +166 -2
- package/src/lib/device.js.map +1 -1
- package/src/lib/encoder-register.d.ts +16 -16
- package/src/lib/encoder-register.js +116 -116
- package/src/lib/hardware-description.d.ts +46 -46
- package/src/lib/hardware-description.js +109 -109
- package/src/lib/integro-encoder-calibration.d.ts +31 -0
- package/src/lib/integro-encoder-calibration.js +196 -0
- package/src/lib/integro-encoder-calibration.js.map +1 -0
- package/src/lib/logger.d.ts +1 -1
- package/src/lib/logger.js +7 -7
- package/src/lib/monitoring-config.d.ts +31 -31
- package/src/lib/monitoring-config.js +2 -2
- package/src/lib/monitoring-entry.d.ts +9 -9
- package/src/lib/monitoring-entry.js +2 -2
- package/src/lib/motion-master-client.d.ts +77 -77
- package/src/lib/motion-master-client.js +196 -196
- package/src/lib/motion-master-pub-sub-client.d.ts +17 -17
- package/src/lib/motion-master-pub-sub-client.js +72 -72
- package/src/lib/motion-master-pub-sub-client.js.map +1 -1
- package/src/lib/motion-master-pub-sub-socket.d.ts +42 -42
- package/src/lib/motion-master-pub-sub-socket.js +2 -2
- package/src/lib/motion-master-pub-sub-web-socket.d.ts +18 -18
- package/src/lib/motion-master-pub-sub-web-socket.js +65 -65
- package/src/lib/motion-master-pub-sub-worker-socket.d.ts +18 -18
- package/src/lib/motion-master-pub-sub-worker-socket.js +47 -47
- package/src/lib/motion-master-req-res-client.d.ts +1104 -1062
- package/src/lib/motion-master-req-res-client.js +2137 -1997
- package/src/lib/motion-master-req-res-client.js.map +1 -1
- package/src/lib/motion-master-req-res-socket.d.ts +60 -60
- package/src/lib/motion-master-req-res-socket.js +2 -2
- package/src/lib/motion-master-req-res-web-socket.d.ts +28 -28
- package/src/lib/motion-master-req-res-web-socket.js +97 -97
- package/src/lib/motion-master-req-res-worker-socket.d.ts +24 -24
- package/src/lib/motion-master-req-res-worker-socket.js +71 -71
- package/src/lib/motion-master.proto.d.ts +5183 -5183
- package/src/lib/motion-master.proto.js +53218 -53218
- package/src/lib/operators.d.ts +20 -20
- package/src/lib/operators.js +82 -83
- package/src/lib/operators.js.map +1 -1
- package/src/lib/options.d.ts +10 -10
- package/src/lib/options.js +13 -13
- package/src/lib/os-command.d.ts +387 -173
- package/src/lib/os-command.js +555 -269
- package/src/lib/os-command.js.map +1 -1
- package/src/lib/parameter.d.ts +156 -138
- package/src/lib/parameter.js +377 -152
- package/src/lib/parameter.js.map +1 -1
- package/src/lib/product-id-range.d.ts +7 -7
- package/src/lib/product-id-range.js +11 -11
- package/src/lib/request-status-resolver.d.ts +4 -4
- package/src/lib/request-status-resolver.js +344 -344
- package/src/lib/somanet-product.d.ts +37 -0
- package/src/lib/somanet-product.js +126 -0
- package/src/lib/somanet-product.js.map +1 -0
- package/src/lib/system-log-line.d.ts +9 -9
- package/src/lib/system-log-line.js +2 -2
- package/src/lib/types.d.ts +141 -141
- package/src/lib/types.js +28 -28
- package/src/lib/urls.d.ts +3 -3
- package/src/lib/urls.js +9 -9
- package/src/lib/util.d.ts +21 -45
- package/src/lib/util.js +113 -379
- package/src/lib/util.js.map +1 -1
- package/src/lib/web-socket-connection-close-codes.d.ts +8 -8
- package/src/lib/web-socket-connection-close-codes.js +88 -88
package/src/lib/device.js
CHANGED
|
@@ -1,3 +1,167 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.convertFeedConstantAffectedVelocityValue = exports.convertFeedConstantAffectedPositionValue = exports.convertSiUnitVelocityAffectedValue = exports.siUnitVelocityScales = exports.parseDeviceLogContent = exports.parseDeviceLog = exports.isValidDeviceRefObj = exports.isValidDeviceRef = exports.isDeviceRef = exports.makeDeviceRefObj = exports.ensureDeviceRef = exports.getDeviceRefFromDeviceRefObj = void 0;
|
|
4
|
+
function getDeviceRefFromDeviceRefObj(deviceRefObj) {
|
|
5
|
+
for (const [_, value] of Object.entries(deviceRefObj)) {
|
|
6
|
+
if (value !== undefined) {
|
|
7
|
+
return value;
|
|
8
|
+
}
|
|
9
|
+
}
|
|
10
|
+
return null;
|
|
11
|
+
}
|
|
12
|
+
exports.getDeviceRefFromDeviceRefObj = getDeviceRefFromDeviceRefObj;
|
|
13
|
+
function ensureDeviceRef(deviceRef) {
|
|
14
|
+
const n = Number(deviceRef);
|
|
15
|
+
return isNaN(n) ? deviceRef : n;
|
|
16
|
+
}
|
|
17
|
+
exports.ensureDeviceRef = ensureDeviceRef;
|
|
18
|
+
function makeDeviceRefObj(deviceRef) {
|
|
19
|
+
deviceRef = ensureDeviceRef(deviceRef);
|
|
20
|
+
if (typeof deviceRef === 'number') {
|
|
21
|
+
if (deviceRef <= 0xFFFF) {
|
|
22
|
+
return { devicePosition: deviceRef };
|
|
23
|
+
}
|
|
24
|
+
else {
|
|
25
|
+
return { deviceAddress: deviceRef };
|
|
26
|
+
}
|
|
27
|
+
}
|
|
28
|
+
else {
|
|
29
|
+
return { deviceSerialNumber: deviceRef };
|
|
30
|
+
}
|
|
31
|
+
}
|
|
32
|
+
exports.makeDeviceRefObj = makeDeviceRefObj;
|
|
33
|
+
function isDeviceRef(deviceRef) {
|
|
34
|
+
return (typeof deviceRef === 'number' && deviceRef >= 0) || typeof deviceRef === 'string';
|
|
35
|
+
}
|
|
36
|
+
exports.isDeviceRef = isDeviceRef;
|
|
37
|
+
function isValidDeviceRef(deviceRef) {
|
|
38
|
+
return deviceRef !== undefined && isDeviceRef(deviceRef);
|
|
39
|
+
}
|
|
40
|
+
exports.isValidDeviceRef = isValidDeviceRef;
|
|
41
|
+
function isValidDeviceRefObj(obj) {
|
|
42
|
+
return Number.isFinite(Number(obj.deviceAddress))
|
|
43
|
+
|| (typeof obj.devicePosition === 'number' && obj.devicePosition >= 0)
|
|
44
|
+
|| typeof obj.deviceSerialNumber === 'string';
|
|
45
|
+
}
|
|
46
|
+
exports.isValidDeviceRefObj = isValidDeviceRefObj;
|
|
47
|
+
function parseDeviceLog(line) {
|
|
48
|
+
const re = /^(\d{2}:\d{2}:\d{2}\.\d+)\s(.*)\|(.*)$/gm;
|
|
49
|
+
const result = re.exec(line);
|
|
50
|
+
if (result) {
|
|
51
|
+
return {
|
|
52
|
+
time: result[1].trim(),
|
|
53
|
+
level: result[2].trim(),
|
|
54
|
+
message: result[3].trim(),
|
|
55
|
+
};
|
|
56
|
+
}
|
|
57
|
+
return;
|
|
58
|
+
}
|
|
59
|
+
exports.parseDeviceLog = parseDeviceLog;
|
|
60
|
+
function parseDeviceLogContent(content) {
|
|
61
|
+
return content.split('\n')
|
|
62
|
+
.map((v) => parseDeviceLog(v))
|
|
63
|
+
.filter((l) => l !== undefined);
|
|
64
|
+
}
|
|
65
|
+
exports.parseDeviceLogContent = parseDeviceLogContent;
|
|
66
|
+
/**
|
|
67
|
+
* These are the user-defined velocity units and scales.
|
|
68
|
+
* For more information, see the description of 0x60A9:00 SI unit velocity object.
|
|
69
|
+
*/
|
|
70
|
+
exports.siUnitVelocityScales = {
|
|
71
|
+
0x00B44700: {
|
|
72
|
+
scale: 1,
|
|
73
|
+
unit: 'RPM',
|
|
74
|
+
type: 'minute',
|
|
75
|
+
},
|
|
76
|
+
0xFFB44700: {
|
|
77
|
+
scale: 0.1,
|
|
78
|
+
unit: 'dRPM',
|
|
79
|
+
type: 'minute',
|
|
80
|
+
},
|
|
81
|
+
0xFEB44700: {
|
|
82
|
+
scale: 0.01,
|
|
83
|
+
unit: 'cRPM',
|
|
84
|
+
type: 'minute',
|
|
85
|
+
},
|
|
86
|
+
0xFDB44700: {
|
|
87
|
+
scale: 0.001,
|
|
88
|
+
unit: 'mRPM',
|
|
89
|
+
type: 'minute',
|
|
90
|
+
},
|
|
91
|
+
0x00B40300: {
|
|
92
|
+
scale: 1,
|
|
93
|
+
unit: 'RPS',
|
|
94
|
+
type: 'second',
|
|
95
|
+
},
|
|
96
|
+
0xFFB40300: {
|
|
97
|
+
scale: 0.1,
|
|
98
|
+
unit: 'dRPS',
|
|
99
|
+
type: 'second',
|
|
100
|
+
},
|
|
101
|
+
0xFEB40300: {
|
|
102
|
+
scale: 0.01,
|
|
103
|
+
unit: 'cRPS',
|
|
104
|
+
type: 'second',
|
|
105
|
+
},
|
|
106
|
+
0xFDB40300: {
|
|
107
|
+
scale: 0.001,
|
|
108
|
+
unit: 'mRPS',
|
|
109
|
+
type: 'second',
|
|
110
|
+
},
|
|
111
|
+
};
|
|
112
|
+
/**
|
|
113
|
+
* Use this function when SI unit velocity changes to update the affected parameters.
|
|
114
|
+
* @example When changing from RPM to mRPM, a value of 2,500 will convert to 2,500,000.
|
|
115
|
+
*/
|
|
116
|
+
function convertSiUnitVelocityAffectedValue(value, oldSiUnitVelocity, newSiUnitVelocity) {
|
|
117
|
+
const oldScale = exports.siUnitVelocityScales[oldSiUnitVelocity];
|
|
118
|
+
const newScale = exports.siUnitVelocityScales[newSiUnitVelocity];
|
|
119
|
+
if (oldScale.type === newScale.type) {
|
|
120
|
+
return Math.round(oldScale.scale / newScale.scale * value);
|
|
121
|
+
}
|
|
122
|
+
else if (oldScale.type === 'minute' && newScale.type === 'second') {
|
|
123
|
+
return Math.round(oldScale.scale / newScale.scale * value / 60);
|
|
124
|
+
}
|
|
125
|
+
else if (oldScale.type === 'second' && newScale.type === 'minute') {
|
|
126
|
+
return Math.round(oldScale.scale / newScale.scale * value * 60);
|
|
127
|
+
}
|
|
128
|
+
return;
|
|
129
|
+
}
|
|
130
|
+
exports.convertSiUnitVelocityAffectedValue = convertSiUnitVelocityAffectedValue;
|
|
131
|
+
/**
|
|
132
|
+
* Use this function when the Feed constant changes to update the position affected parameters.
|
|
133
|
+
* Depending on whether the Feed constant gets disabled, enabled, or its value changes, the function will perform conversion, inversion, or scaling.
|
|
134
|
+
*/
|
|
135
|
+
function convertFeedConstantAffectedPositionValue(value, oldFeedConstant, newFeedConstant, resolution) {
|
|
136
|
+
let out = value;
|
|
137
|
+
if (oldFeedConstant === 0xFFFFFFFF && (newFeedConstant > 0 && newFeedConstant < 0xFFFFFFFF)) { // conversion
|
|
138
|
+
out = Math.round(value * newFeedConstant / resolution);
|
|
139
|
+
}
|
|
140
|
+
else if ((oldFeedConstant > 0 && oldFeedConstant < 0xFFFFFFFF) && (newFeedConstant > 0 && newFeedConstant < 0xFFFFFFFF)) { // scaling
|
|
141
|
+
out = Math.round(newFeedConstant / oldFeedConstant * value);
|
|
142
|
+
}
|
|
143
|
+
else if ((oldFeedConstant > 0 && oldFeedConstant < 0xFFFFFFFF) && newFeedConstant === 0xFFFFFFFF) { // inversion
|
|
144
|
+
out = Math.round(value / oldFeedConstant * resolution);
|
|
145
|
+
}
|
|
146
|
+
return out;
|
|
147
|
+
}
|
|
148
|
+
exports.convertFeedConstantAffectedPositionValue = convertFeedConstantAffectedPositionValue;
|
|
149
|
+
/**
|
|
150
|
+
* Use this function when the Feed constant changes to update the velocity affected parameters.
|
|
151
|
+
* Depending on whether the Feed constant gets disabled, enabled, or its value changes, the function will perform conversion, inversion, or scaling.
|
|
152
|
+
*/
|
|
153
|
+
function convertFeedConstantAffectedVelocityValue(value, oldFeedConstant, newFeedConstant) {
|
|
154
|
+
let out = value;
|
|
155
|
+
if (oldFeedConstant === 0xFFFFFFFF && (newFeedConstant > 0 && newFeedConstant < 0xFFFFFFFF)) { // conversion
|
|
156
|
+
out = Math.round(value * newFeedConstant);
|
|
157
|
+
}
|
|
158
|
+
else if ((oldFeedConstant > 0 && oldFeedConstant < 0xFFFFFFFF) && (newFeedConstant > 0 && newFeedConstant < 0xFFFFFFFF)) { // scaling
|
|
159
|
+
out = Math.round(newFeedConstant / oldFeedConstant * value);
|
|
160
|
+
}
|
|
161
|
+
else if ((oldFeedConstant > 0 && oldFeedConstant < 0xFFFFFFFF) && newFeedConstant === 0xFFFFFFFF) { // inversion
|
|
162
|
+
out = Math.round(value / oldFeedConstant);
|
|
163
|
+
}
|
|
164
|
+
return out;
|
|
165
|
+
}
|
|
166
|
+
exports.convertFeedConstantAffectedVelocityValue = convertFeedConstantAffectedVelocityValue;
|
|
3
167
|
//# sourceMappingURL=device.js.map
|
package/src/lib/device.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"device.js","sourceRoot":"","sources":["../../../../../libs/motion-master-client/src/lib/device.ts"],"names":[],"mappings":""}
|
|
1
|
+
{"version":3,"file":"device.js","sourceRoot":"","sources":["../../../../../libs/motion-master-client/src/lib/device.ts"],"names":[],"mappings":";;;AAaA,SAAgB,4BAA4B,CAAC,YAA0B;IACrE,KAAK,MAAM,CAAC,CAAC,EAAE,KAAK,CAAC,IAAI,MAAM,CAAC,OAAO,CAAC,YAAY,CAAC,EAAE;QACrD,IAAI,KAAK,KAAK,SAAS,EAAE;YACvB,OAAO,KAAK,CAAC;SACd;KACF;IACD,OAAO,IAAI,CAAC;AACd,CAAC;AAPD,oEAOC;AAED,SAAgB,eAAe,CAAC,SAAoB;IAClD,MAAM,CAAC,GAAG,MAAM,CAAC,SAAS,CAAC,CAAC;IAC5B,OAAO,KAAK,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,SAAS,CAAC,CAAC,CAAC,CAAC,CAAC;AAClC,CAAC;AA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,
|
|
4
|
-
OUT_ZERO_OUT_MSB = 17
|
|
5
|
-
}
|
|
6
|
-
export interface EncoderRegisterError {
|
|
7
|
-
name: string;
|
|
8
|
-
error: string;
|
|
9
|
-
description: string;
|
|
10
|
-
remedy: string;
|
|
11
|
-
fullDescription: string;
|
|
12
|
-
}
|
|
13
|
-
export declare const encoderRegisterErrors: {
|
|
14
|
-
[key: number]: EncoderRegisterError;
|
|
15
|
-
}[];
|
|
16
|
-
export declare function mapEncoderRegisterValueToErrors(registerValue: number, statusIndex: 0 | 1): EncoderRegisterError[];
|
|
1
|
+
export declare enum EncoderRegisterAddress {
|
|
2
|
+
STATUS0 = 118,
|
|
3
|
+
STATUS1 = 119,
|
|
4
|
+
OUT_ZERO_OUT_MSB = 17
|
|
5
|
+
}
|
|
6
|
+
export interface EncoderRegisterError {
|
|
7
|
+
name: string;
|
|
8
|
+
error: string;
|
|
9
|
+
description: string;
|
|
10
|
+
remedy: string;
|
|
11
|
+
fullDescription: string;
|
|
12
|
+
}
|
|
13
|
+
export declare const encoderRegisterErrors: {
|
|
14
|
+
[key: number]: EncoderRegisterError;
|
|
15
|
+
}[];
|
|
16
|
+
export declare function mapEncoderRegisterValueToErrors(registerValue: number, statusIndex: 0 | 1): EncoderRegisterError[];
|
|
@@ -1,117 +1,117 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.mapEncoderRegisterValueToErrors = exports.encoderRegisterErrors = exports.EncoderRegisterAddress = void 0;
|
|
4
|
-
var EncoderRegisterAddress;
|
|
5
|
-
(function (EncoderRegisterAddress) {
|
|
6
|
-
EncoderRegisterAddress[EncoderRegisterAddress["STATUS0"] = 118] = "STATUS0";
|
|
7
|
-
EncoderRegisterAddress[EncoderRegisterAddress["STATUS1"] = 119] = "STATUS1";
|
|
8
|
-
EncoderRegisterAddress[EncoderRegisterAddress["OUT_ZERO_OUT_MSB"] = 17] = "OUT_ZERO_OUT_MSB";
|
|
9
|
-
})(EncoderRegisterAddress = exports.EncoderRegisterAddress || (exports.EncoderRegisterAddress = {}));
|
|
10
|
-
;
|
|
11
|
-
;
|
|
12
|
-
exports.encoderRegisterErrors = [
|
|
13
|
-
{
|
|
14
|
-
1: {
|
|
15
|
-
name: "AM_MIN",
|
|
16
|
-
error: "Signal error: poor level (master track)",
|
|
17
|
-
description: "Magnetic field strength is too low for encoder operation.",
|
|
18
|
-
remedy: "Check positioning of the encoder ring.",
|
|
19
|
-
fullDescription: "An encoder magnetic ring is too far from the encoder chip or isn't detected. Check the mechanical assembly. In some rare cases can be provoked by demagnetized ring or field strength drop due to high temperatures. A magnetic ring is too far from the encoder chip. Check the mechanical assembly."
|
|
20
|
-
},
|
|
21
|
-
2: {
|
|
22
|
-
name: "AM_MAX",
|
|
23
|
-
error: "Signal error: clipping (master track)",
|
|
24
|
-
description: "Magnetic field strength is too high.",
|
|
25
|
-
remedy: "Check mechanical assembly and external fields.",
|
|
26
|
-
fullDescription: "The outer track of the encoder chip detects too strong a field. Typically, it can't be generated by the magnetic ring itself at normal conditions. Please check the influence of external fields, especially brakes. A magnetic ring is too close to the encoder chip. Check the mechanical assembly."
|
|
27
|
-
},
|
|
28
|
-
4: {
|
|
29
|
-
name: "AN_MIN",
|
|
30
|
-
error: "Signal error: poor level (nonius track)",
|
|
31
|
-
description: "Magnetic field strength is too low for encoder operation.",
|
|
32
|
-
remedy: "Check positioning of the encoder ring.",
|
|
33
|
-
fullDescription: "An encoder magnetic ring is too far from the encoder chip or isn't detected. Check the mechanical assembly. In some rare cases can be provoked by demagnetized ring or field strength drop due to high temperatures."
|
|
34
|
-
},
|
|
35
|
-
8: {
|
|
36
|
-
name: "AN_MAX",
|
|
37
|
-
error: "Signal error: clipping (nonius track)",
|
|
38
|
-
description: "Magnetic field strength is too high.",
|
|
39
|
-
remedy: "Check mechanical assembly and external fields.",
|
|
40
|
-
fullDescription: "The inner track of the encoder chip detects too strong a field. Typically, it can't be generated by the magnetic ring itself at normal conditions. Please check the influence of external fields, especially brakes."
|
|
41
|
-
},
|
|
42
|
-
16: {
|
|
43
|
-
name: "STUP",
|
|
44
|
-
error: "Startup iC-MU",
|
|
45
|
-
description: "Encoder startup error. Can appear during Multiturn configuration.",
|
|
46
|
-
remedy: "Power cycle the drive.",
|
|
47
|
-
fullDescription: "Encoder initialization error. The typical reason is: not saved Multiturn Counter configuration. Connect the multiturn battery, check the battery voltage, configure the multiturn bits in OBLAC Drives, configure internal encoder and save changes. Power cycle the drive. If the error is always present, contact support."
|
|
48
|
-
},
|
|
49
|
-
},
|
|
50
|
-
{
|
|
51
|
-
2: {
|
|
52
|
-
name: "FRQ_CNV",
|
|
53
|
-
error: "Excessive signal frequency for internal 12 Bit converter",
|
|
54
|
-
description: "Encoder maximum speed was exceeded.",
|
|
55
|
-
remedy: "",
|
|
56
|
-
fullDescription: "Encoder maximum speed was exceeded. Circulo 7 - 12000 RPM or Circulo 9 - 6000 RPM"
|
|
57
|
-
},
|
|
58
|
-
4: {
|
|
59
|
-
name: "FRQ_ABZ",
|
|
60
|
-
error: "Excessive signal frequency for ABZ-converter",
|
|
61
|
-
description: "Encoder maximum speed was exceeded.",
|
|
62
|
-
remedy: "",
|
|
63
|
-
fullDescription: "Encoder maximum speed was exceeded. Circulo 7 - 12000 RPM or Circulo 9 - 6000 RPM"
|
|
64
|
-
},
|
|
65
|
-
8: {
|
|
66
|
-
name: "NON_CTR",
|
|
67
|
-
error: "Period counter consistency error: counted period <-> calculated Nonius position",
|
|
68
|
-
description: "Internal Encoder calibration parameters are outdated or non-existing.",
|
|
69
|
-
remedy: "Please calibrate the internal encoder.",
|
|
70
|
-
fullDescription: "The absolute position value can't be computed reliably at the current position. This can be caused by: encoder wasn't calibrated, change of encoder mechanics, severe thermal expansion or magnetic target damage. Run diagnostics and repeat the calibration procedure. If this error prevents you from performing calibration - disable it or contact support."
|
|
71
|
-
},
|
|
72
|
-
16: {
|
|
73
|
-
name: "MT_CTR",
|
|
74
|
-
error: "Multiturn data consistency error: counted multiturn <-> external MT data",
|
|
75
|
-
description: "Multiturn Counter synchronization error.",
|
|
76
|
-
remedy: "Check MT configuration, connect a battery. Power cycle the drive.",
|
|
77
|
-
fullDescription: "Can happen because of not saved Multiturn Counter configuration. Connect the multiturn battery, check the battery voltage, configure the multiturn bits in OBLAC Drives, configure internal encoder and save changes. If the error is still present, please contact support."
|
|
78
|
-
},
|
|
79
|
-
32: {
|
|
80
|
-
name: "MT_ERR",
|
|
81
|
-
error: "Multiturn communication error: MTD line not 1 when trying to read MT data, MTD line is not 0 right after the last clock pulse, or SSI error bit active on MT interface",
|
|
82
|
-
description: "Multiturn Counter communication error.",
|
|
83
|
-
remedy: "Check MT configuration, connect a battery. Power cycle the drive.",
|
|
84
|
-
fullDescription: "The Multiturn counter is in error state. Connect the multiturn battery, check the battery voltage, configure the multiturn bits in OBLAC Drives, configure internal encoder and save changes. Power cycle the drive. If the error is still present, please contact support."
|
|
85
|
-
},
|
|
86
|
-
64: {
|
|
87
|
-
name: "EPR_ERR",
|
|
88
|
-
error: "I2C communication error: No EEPROM or I2C communication error",
|
|
89
|
-
description: "Encoder EEPROM memory communication error.",
|
|
90
|
-
remedy: "Power Cycle the drive.",
|
|
91
|
-
fullDescription: "Communication with the EEPROM memory of the chip is distorted. Power Cycle the drive. If this can't be reset, there is a hardware problem. Please contact support."
|
|
92
|
-
},
|
|
93
|
-
128: {
|
|
94
|
-
name: "",
|
|
95
|
-
error: "Invalid check sum internal RAM",
|
|
96
|
-
description: "Invalid check sum internal RAM",
|
|
97
|
-
remedy: "",
|
|
98
|
-
fullDescription: ""
|
|
99
|
-
},
|
|
100
|
-
}
|
|
101
|
-
];
|
|
102
|
-
function mapEncoderRegisterValueToErrors(registerValue, statusIndex) {
|
|
103
|
-
const errors = [];
|
|
104
|
-
let i = 1;
|
|
105
|
-
while (i < 256) {
|
|
106
|
-
if ((registerValue & i) === i) {
|
|
107
|
-
const error = exports.encoderRegisterErrors[statusIndex][i];
|
|
108
|
-
if (error) {
|
|
109
|
-
errors.push(error);
|
|
110
|
-
}
|
|
111
|
-
}
|
|
112
|
-
i *= 2;
|
|
113
|
-
}
|
|
114
|
-
return errors;
|
|
115
|
-
}
|
|
116
|
-
exports.mapEncoderRegisterValueToErrors = mapEncoderRegisterValueToErrors;
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.mapEncoderRegisterValueToErrors = exports.encoderRegisterErrors = exports.EncoderRegisterAddress = void 0;
|
|
4
|
+
var EncoderRegisterAddress;
|
|
5
|
+
(function (EncoderRegisterAddress) {
|
|
6
|
+
EncoderRegisterAddress[EncoderRegisterAddress["STATUS0"] = 118] = "STATUS0";
|
|
7
|
+
EncoderRegisterAddress[EncoderRegisterAddress["STATUS1"] = 119] = "STATUS1";
|
|
8
|
+
EncoderRegisterAddress[EncoderRegisterAddress["OUT_ZERO_OUT_MSB"] = 17] = "OUT_ZERO_OUT_MSB";
|
|
9
|
+
})(EncoderRegisterAddress = exports.EncoderRegisterAddress || (exports.EncoderRegisterAddress = {}));
|
|
10
|
+
;
|
|
11
|
+
;
|
|
12
|
+
exports.encoderRegisterErrors = [
|
|
13
|
+
{
|
|
14
|
+
1: {
|
|
15
|
+
name: "AM_MIN",
|
|
16
|
+
error: "Signal error: poor level (master track)",
|
|
17
|
+
description: "Magnetic field strength is too low for encoder operation.",
|
|
18
|
+
remedy: "Check positioning of the encoder ring.",
|
|
19
|
+
fullDescription: "An encoder magnetic ring is too far from the encoder chip or isn't detected. Check the mechanical assembly. In some rare cases can be provoked by demagnetized ring or field strength drop due to high temperatures. A magnetic ring is too far from the encoder chip. Check the mechanical assembly."
|
|
20
|
+
},
|
|
21
|
+
2: {
|
|
22
|
+
name: "AM_MAX",
|
|
23
|
+
error: "Signal error: clipping (master track)",
|
|
24
|
+
description: "Magnetic field strength is too high.",
|
|
25
|
+
remedy: "Check mechanical assembly and external fields.",
|
|
26
|
+
fullDescription: "The outer track of the encoder chip detects too strong a field. Typically, it can't be generated by the magnetic ring itself at normal conditions. Please check the influence of external fields, especially brakes. A magnetic ring is too close to the encoder chip. Check the mechanical assembly."
|
|
27
|
+
},
|
|
28
|
+
4: {
|
|
29
|
+
name: "AN_MIN",
|
|
30
|
+
error: "Signal error: poor level (nonius track)",
|
|
31
|
+
description: "Magnetic field strength is too low for encoder operation.",
|
|
32
|
+
remedy: "Check positioning of the encoder ring.",
|
|
33
|
+
fullDescription: "An encoder magnetic ring is too far from the encoder chip or isn't detected. Check the mechanical assembly. In some rare cases can be provoked by demagnetized ring or field strength drop due to high temperatures."
|
|
34
|
+
},
|
|
35
|
+
8: {
|
|
36
|
+
name: "AN_MAX",
|
|
37
|
+
error: "Signal error: clipping (nonius track)",
|
|
38
|
+
description: "Magnetic field strength is too high.",
|
|
39
|
+
remedy: "Check mechanical assembly and external fields.",
|
|
40
|
+
fullDescription: "The inner track of the encoder chip detects too strong a field. Typically, it can't be generated by the magnetic ring itself at normal conditions. Please check the influence of external fields, especially brakes."
|
|
41
|
+
},
|
|
42
|
+
16: {
|
|
43
|
+
name: "STUP",
|
|
44
|
+
error: "Startup iC-MU",
|
|
45
|
+
description: "Encoder startup error. Can appear during Multiturn configuration.",
|
|
46
|
+
remedy: "Power cycle the drive.",
|
|
47
|
+
fullDescription: "Encoder initialization error. The typical reason is: not saved Multiturn Counter configuration. Connect the multiturn battery, check the battery voltage, configure the multiturn bits in OBLAC Drives, configure internal encoder and save changes. Power cycle the drive. If the error is always present, contact support."
|
|
48
|
+
},
|
|
49
|
+
},
|
|
50
|
+
{
|
|
51
|
+
2: {
|
|
52
|
+
name: "FRQ_CNV",
|
|
53
|
+
error: "Excessive signal frequency for internal 12 Bit converter",
|
|
54
|
+
description: "Encoder maximum speed was exceeded.",
|
|
55
|
+
remedy: "",
|
|
56
|
+
fullDescription: "Encoder maximum speed was exceeded. Circulo 7 - 12000 RPM or Circulo 9 - 6000 RPM"
|
|
57
|
+
},
|
|
58
|
+
4: {
|
|
59
|
+
name: "FRQ_ABZ",
|
|
60
|
+
error: "Excessive signal frequency for ABZ-converter",
|
|
61
|
+
description: "Encoder maximum speed was exceeded.",
|
|
62
|
+
remedy: "",
|
|
63
|
+
fullDescription: "Encoder maximum speed was exceeded. Circulo 7 - 12000 RPM or Circulo 9 - 6000 RPM"
|
|
64
|
+
},
|
|
65
|
+
8: {
|
|
66
|
+
name: "NON_CTR",
|
|
67
|
+
error: "Period counter consistency error: counted period <-> calculated Nonius position",
|
|
68
|
+
description: "Internal Encoder calibration parameters are outdated or non-existing.",
|
|
69
|
+
remedy: "Please calibrate the internal encoder.",
|
|
70
|
+
fullDescription: "The absolute position value can't be computed reliably at the current position. This can be caused by: encoder wasn't calibrated, change of encoder mechanics, severe thermal expansion or magnetic target damage. Run diagnostics and repeat the calibration procedure. If this error prevents you from performing calibration - disable it or contact support."
|
|
71
|
+
},
|
|
72
|
+
16: {
|
|
73
|
+
name: "MT_CTR",
|
|
74
|
+
error: "Multiturn data consistency error: counted multiturn <-> external MT data",
|
|
75
|
+
description: "Multiturn Counter synchronization error.",
|
|
76
|
+
remedy: "Check MT configuration, connect a battery. Power cycle the drive.",
|
|
77
|
+
fullDescription: "Can happen because of not saved Multiturn Counter configuration. Connect the multiturn battery, check the battery voltage, configure the multiturn bits in OBLAC Drives, configure internal encoder and save changes. If the error is still present, please contact support."
|
|
78
|
+
},
|
|
79
|
+
32: {
|
|
80
|
+
name: "MT_ERR",
|
|
81
|
+
error: "Multiturn communication error: MTD line not 1 when trying to read MT data, MTD line is not 0 right after the last clock pulse, or SSI error bit active on MT interface",
|
|
82
|
+
description: "Multiturn Counter communication error.",
|
|
83
|
+
remedy: "Check MT configuration, connect a battery. Power cycle the drive.",
|
|
84
|
+
fullDescription: "The Multiturn counter is in error state. Connect the multiturn battery, check the battery voltage, configure the multiturn bits in OBLAC Drives, configure internal encoder and save changes. Power cycle the drive. If the error is still present, please contact support."
|
|
85
|
+
},
|
|
86
|
+
64: {
|
|
87
|
+
name: "EPR_ERR",
|
|
88
|
+
error: "I2C communication error: No EEPROM or I2C communication error",
|
|
89
|
+
description: "Encoder EEPROM memory communication error.",
|
|
90
|
+
remedy: "Power Cycle the drive.",
|
|
91
|
+
fullDescription: "Communication with the EEPROM memory of the chip is distorted. Power Cycle the drive. If this can't be reset, there is a hardware problem. Please contact support."
|
|
92
|
+
},
|
|
93
|
+
128: {
|
|
94
|
+
name: "",
|
|
95
|
+
error: "Invalid check sum internal RAM",
|
|
96
|
+
description: "Invalid check sum internal RAM",
|
|
97
|
+
remedy: "",
|
|
98
|
+
fullDescription: ""
|
|
99
|
+
},
|
|
100
|
+
}
|
|
101
|
+
];
|
|
102
|
+
function mapEncoderRegisterValueToErrors(registerValue, statusIndex) {
|
|
103
|
+
const errors = [];
|
|
104
|
+
let i = 1;
|
|
105
|
+
while (i < 256) {
|
|
106
|
+
if ((registerValue & i) === i) {
|
|
107
|
+
const error = exports.encoderRegisterErrors[statusIndex][i];
|
|
108
|
+
if (error) {
|
|
109
|
+
errors.push(error);
|
|
110
|
+
}
|
|
111
|
+
}
|
|
112
|
+
i *= 2;
|
|
113
|
+
}
|
|
114
|
+
return errors;
|
|
115
|
+
}
|
|
116
|
+
exports.mapEncoderRegisterValueToErrors = mapEncoderRegisterValueToErrors;
|
|
117
117
|
//# sourceMappingURL=encoder-register.js.map
|
|
@@ -1,46 +1,46 @@
|
|
|
1
|
-
export interface HardwareComponent {
|
|
2
|
-
name: string;
|
|
3
|
-
version: string;
|
|
4
|
-
serialNumber: string;
|
|
5
|
-
}
|
|
6
|
-
export type AssemblyComponent = HardwareComponent;
|
|
7
|
-
export type DeviceComponent = HardwareComponent;
|
|
8
|
-
export interface Assembly {
|
|
9
|
-
name: string;
|
|
10
|
-
id: string;
|
|
11
|
-
version: string;
|
|
12
|
-
serialNumber: string;
|
|
13
|
-
components: AssemblyComponent[];
|
|
14
|
-
}
|
|
15
|
-
export interface HardwareDevice {
|
|
16
|
-
name: string;
|
|
17
|
-
id: string;
|
|
18
|
-
version: string;
|
|
19
|
-
keyId: string;
|
|
20
|
-
serialNumber: string;
|
|
21
|
-
macAddress: string;
|
|
22
|
-
components: DeviceComponent[];
|
|
23
|
-
}
|
|
24
|
-
/**
|
|
25
|
-
* @link https://docs.google.com/document/d/1N00-ZjxHkjoWNIsnoTtza9CUHrxm8-e54298DXLuD94
|
|
26
|
-
*/
|
|
27
|
-
export interface HardwareDescription {
|
|
28
|
-
fileVersion: string;
|
|
29
|
-
assembly?: Assembly;
|
|
30
|
-
device: HardwareDevice;
|
|
31
|
-
}
|
|
32
|
-
export declare function getIdFromHardwareDescription(hd: HardwareDescription): string;
|
|
33
|
-
export declare function getApiIdentifierFromHardwareDescription(hd: HardwareDescription, skipKeyId?: boolean): string;
|
|
34
|
-
export declare function getNameFromHardwareDescription(hd: HardwareDescription): string;
|
|
35
|
-
export declare function getSerialNumberFromHardwareDescription(hd: HardwareDescription): string;
|
|
36
|
-
export declare function getAllComponentsFromHardwareDescription(hd: HardwareDescription): HardwareComponent[];
|
|
37
|
-
export declare function hardwareComponentsMatch(a: HardwareComponent[], b: HardwareComponent[]): boolean;
|
|
38
|
-
export declare function isHardwareDescriptionCompatibleWithPackageFilename(hardwareDescription: HardwareDescription, packageFilename: string): boolean;
|
|
39
|
-
export declare function getHardwareComponentsFromPackageFilename(packageFilename: string): HardwareComponent[];
|
|
40
|
-
export declare function getVersionFromPackageFilename(packageFilename: string): string | undefined;
|
|
41
|
-
export declare function getApiIdentifierFromPackageFilename(packageFilename: string): string | undefined;
|
|
42
|
-
/**
|
|
43
|
-
* This template is to be used in cases where hardware description file is not available on a device.
|
|
44
|
-
* It is imperative to replace the serial number with a unique identifier.
|
|
45
|
-
*/
|
|
46
|
-
export declare const dummyHardwareDescriptionFileContentTemplate: HardwareDescription;
|
|
1
|
+
export interface HardwareComponent {
|
|
2
|
+
name: string;
|
|
3
|
+
version: string;
|
|
4
|
+
serialNumber: string;
|
|
5
|
+
}
|
|
6
|
+
export type AssemblyComponent = HardwareComponent;
|
|
7
|
+
export type DeviceComponent = HardwareComponent;
|
|
8
|
+
export interface Assembly {
|
|
9
|
+
name: string;
|
|
10
|
+
id: string;
|
|
11
|
+
version: string;
|
|
12
|
+
serialNumber: string;
|
|
13
|
+
components: AssemblyComponent[];
|
|
14
|
+
}
|
|
15
|
+
export interface HardwareDevice {
|
|
16
|
+
name: string;
|
|
17
|
+
id: string;
|
|
18
|
+
version: string;
|
|
19
|
+
keyId: string;
|
|
20
|
+
serialNumber: string;
|
|
21
|
+
macAddress: string;
|
|
22
|
+
components: DeviceComponent[];
|
|
23
|
+
}
|
|
24
|
+
/**
|
|
25
|
+
* @link https://docs.google.com/document/d/1N00-ZjxHkjoWNIsnoTtza9CUHrxm8-e54298DXLuD94
|
|
26
|
+
*/
|
|
27
|
+
export interface HardwareDescription {
|
|
28
|
+
fileVersion: string;
|
|
29
|
+
assembly?: Assembly;
|
|
30
|
+
device: HardwareDevice;
|
|
31
|
+
}
|
|
32
|
+
export declare function getIdFromHardwareDescription(hd: HardwareDescription): string;
|
|
33
|
+
export declare function getApiIdentifierFromHardwareDescription(hd: HardwareDescription, skipKeyId?: boolean): string;
|
|
34
|
+
export declare function getNameFromHardwareDescription(hd: HardwareDescription): string;
|
|
35
|
+
export declare function getSerialNumberFromHardwareDescription(hd: HardwareDescription): string;
|
|
36
|
+
export declare function getAllComponentsFromHardwareDescription(hd: HardwareDescription): HardwareComponent[];
|
|
37
|
+
export declare function hardwareComponentsMatch(a: HardwareComponent[], b: HardwareComponent[]): boolean;
|
|
38
|
+
export declare function isHardwareDescriptionCompatibleWithPackageFilename(hardwareDescription: HardwareDescription, packageFilename: string): boolean;
|
|
39
|
+
export declare function getHardwareComponentsFromPackageFilename(packageFilename: string): HardwareComponent[];
|
|
40
|
+
export declare function getVersionFromPackageFilename(packageFilename: string): string | undefined;
|
|
41
|
+
export declare function getApiIdentifierFromPackageFilename(packageFilename: string): string | undefined;
|
|
42
|
+
/**
|
|
43
|
+
* This template is to be used in cases where hardware description file is not available on a device.
|
|
44
|
+
* It is imperative to replace the serial number with a unique identifier.
|
|
45
|
+
*/
|
|
46
|
+
export declare const dummyHardwareDescriptionFileContentTemplate: HardwareDescription;
|