motion-master-client 0.0.177 → 0.0.178
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/index.d.ts +2 -0
- package/src/index.js +2 -0
- package/src/index.js.map +1 -1
- package/src/lib/ethercat.d.ts +59 -0
- package/src/lib/ethercat.js +113 -0
- package/src/lib/ethercat.js.map +1 -0
- package/src/lib/ethernet.d.ts +183 -0
- package/src/lib/ethernet.js +410 -0
- package/src/lib/ethernet.js.map +1 -0
package/package.json
CHANGED
package/src/index.d.ts
CHANGED
|
@@ -5,6 +5,8 @@ export * from './lib/device';
|
|
|
5
5
|
export * from './lib/device-log-line';
|
|
6
6
|
export * from './lib/device-parameter';
|
|
7
7
|
export * from './lib/encoder';
|
|
8
|
+
export * from './lib/ethercat';
|
|
9
|
+
export * from './lib/ethernet';
|
|
8
10
|
export * from './lib/firmware';
|
|
9
11
|
export * from './lib/hardware-description';
|
|
10
12
|
export * from './lib/homing';
|
package/src/index.js
CHANGED
|
@@ -8,6 +8,8 @@ tslib_1.__exportStar(require("./lib/device"), exports);
|
|
|
8
8
|
tslib_1.__exportStar(require("./lib/device-log-line"), exports);
|
|
9
9
|
tslib_1.__exportStar(require("./lib/device-parameter"), exports);
|
|
10
10
|
tslib_1.__exportStar(require("./lib/encoder"), exports);
|
|
11
|
+
tslib_1.__exportStar(require("./lib/ethercat"), exports);
|
|
12
|
+
tslib_1.__exportStar(require("./lib/ethernet"), exports);
|
|
11
13
|
tslib_1.__exportStar(require("./lib/firmware"), exports);
|
|
12
14
|
tslib_1.__exportStar(require("./lib/hardware-description"), exports);
|
|
13
15
|
tslib_1.__exportStar(require("./lib/homing"), exports);
|
package/src/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../libs/motion-master-client/src/index.ts"],"names":[],"mappings":";;;AAAA,uDAA6B;AAC7B,4DAAkC;AAClC,gEAAsC;AACtC,uDAA6B;AAC7B,gEAAsC;AACtC,iEAAuC;AACvC,wDAA8B;AAC9B,yDAA+B;AAC/B,qEAA2C;AAC3C,uDAA6B;AAC7B,gEAAsC;AACtC,4EAAkD;AAClD,kEAAwC;AACxC,iEAAuC;AACvC,gEAAsC;AACtC,qEAA2C;AAC3C,6EAAmD;AACnD,6EAAmD;AACnD,iFAAuD;AACvD,oFAA0D;AAC1D,6EAAmD;AACnD,6EAAmD;AACnD,iFAAuD;AACvD,oFAA0D;AAC1D,0DAAgC;AAChC,wDAA8B;AAC9B,2DAAiC;AACjC,0DAAgC;AAChC,wDAA8B;AAC9B,wEAA8C;AAC9C,oDAA0B;AAC1B,gEAAsC;AACtC,sDAA4B;AAC5B,qDAA2B;AAC3B,qDAA2B;AAC3B,kFAAwD"}
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../libs/motion-master-client/src/index.ts"],"names":[],"mappings":";;;AAAA,uDAA6B;AAC7B,4DAAkC;AAClC,gEAAsC;AACtC,uDAA6B;AAC7B,gEAAsC;AACtC,iEAAuC;AACvC,wDAA8B;AAC9B,yDAA+B;AAC/B,yDAA+B;AAC/B,yDAA+B;AAC/B,qEAA2C;AAC3C,uDAA6B;AAC7B,gEAAsC;AACtC,4EAAkD;AAClD,kEAAwC;AACxC,iEAAuC;AACvC,gEAAsC;AACtC,qEAA2C;AAC3C,6EAAmD;AACnD,6EAAmD;AACnD,iFAAuD;AACvD,oFAA0D;AAC1D,6EAAmD;AACnD,6EAAmD;AACnD,iFAAuD;AACvD,oFAA0D;AAC1D,0DAAgC;AAChC,wDAA8B;AAC9B,2DAAiC;AACjC,0DAAgC;AAChC,wDAA8B;AAC9B,wEAA8C;AAC9C,oDAA0B;AAC1B,gEAAsC;AACtC,sDAA4B;AAC5B,qDAA2B;AAC3B,qDAA2B;AAC3B,kFAAwD"}
|
|
@@ -0,0 +1,59 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Represents a base data type, as defined in ETG.1020 Protocol Enhancements (24 Base Data Types).
|
|
3
|
+
*/
|
|
4
|
+
export interface BaseDataType {
|
|
5
|
+
/** The unique index identifying the data type. */
|
|
6
|
+
index: number;
|
|
7
|
+
/** The name of the data type. */
|
|
8
|
+
name: string;
|
|
9
|
+
/** The base data type category (e.g., "BIT", "SINT"). */
|
|
10
|
+
baseDataType: string;
|
|
11
|
+
/** The size of the data type in bits. */
|
|
12
|
+
bitSize: number;
|
|
13
|
+
/** An optional description providing additional details about the data type. */
|
|
14
|
+
description?: string;
|
|
15
|
+
/** An optional range specifying the minimum and maximum allowable values. */
|
|
16
|
+
range?: [number, number];
|
|
17
|
+
}
|
|
18
|
+
/**
|
|
19
|
+
* List of base data types as defined in ETG.1020 Protocol Enhancements, Table 98.
|
|
20
|
+
*/
|
|
21
|
+
export declare const baseDataTypes: BaseDataType[];
|
|
22
|
+
/**
|
|
23
|
+
* List of base data types with variable length, as specified in ETG.1020 Protocol Enhancements, Table 99.
|
|
24
|
+
*/
|
|
25
|
+
export declare const baseDataTypesWithVariableLength: BaseDataType[];
|
|
26
|
+
/**
|
|
27
|
+
* Combines all base data types, including those from Table 98 and Table 99.
|
|
28
|
+
*/
|
|
29
|
+
export declare const allBaseDataTypes: BaseDataType[];
|
|
30
|
+
/**
|
|
31
|
+
* Finds a base data type that matches the specified index.
|
|
32
|
+
* @param index - The index to search for.
|
|
33
|
+
* @returns The matching base data type, or undefined if not found.
|
|
34
|
+
*/
|
|
35
|
+
export declare function findBaseDataTypeByIndex(index: number): BaseDataType | undefined;
|
|
36
|
+
/**
|
|
37
|
+
* Enum for object code definitions, based on ETG.1000.6 EtherCAT Specification - Part 6, Table 62.
|
|
38
|
+
*/
|
|
39
|
+
export declare enum ObjectCodeDefinition {
|
|
40
|
+
DOMAIN = 2,
|
|
41
|
+
DEFTYPE = 5,
|
|
42
|
+
DEFSTRUCT = 6,
|
|
43
|
+
VAR = 7,
|
|
44
|
+
ARRAY = 8,
|
|
45
|
+
RECORD = 9
|
|
46
|
+
}
|
|
47
|
+
/**
|
|
48
|
+
* Represents the EtherCAT State Machine (ESM) states.
|
|
49
|
+
* These states define the different phases in the EtherCAT communication process,
|
|
50
|
+
* determining the level of access and functionality available at each stage.
|
|
51
|
+
*/
|
|
52
|
+
export declare enum EthercatState {
|
|
53
|
+
NONE = 0,
|
|
54
|
+
INIT = 1,
|
|
55
|
+
PREOP = 2,
|
|
56
|
+
BOOT = 3,
|
|
57
|
+
SAFEOP = 4,
|
|
58
|
+
OP = 8
|
|
59
|
+
}
|
|
@@ -0,0 +1,113 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.EthercatState = exports.ObjectCodeDefinition = exports.findBaseDataTypeByIndex = exports.allBaseDataTypes = exports.baseDataTypesWithVariableLength = exports.baseDataTypes = void 0;
|
|
4
|
+
/**
|
|
5
|
+
* List of base data types as defined in ETG.1020 Protocol Enhancements, Table 98.
|
|
6
|
+
*/
|
|
7
|
+
exports.baseDataTypes = [
|
|
8
|
+
{ index: 0x0001, name: 'BOOLEAN', baseDataType: 'BOOL\nBIT', bitSize: 1, description: '\'0\': FALSE\n\'1\': TRUE' },
|
|
9
|
+
{ index: 0x001E, name: 'BYTE', baseDataType: 'BYTE', bitSize: 8, description: 'Unsigned Byte, Octet' },
|
|
10
|
+
{ index: 0x001F, name: 'WORD', baseDataType: 'WORD', bitSize: 16, description: 'Two Octet' },
|
|
11
|
+
{ index: 0x0020, name: 'DWORD', baseDataType: 'DWORD', bitSize: 32, description: 'Four Octet' },
|
|
12
|
+
// Bit String
|
|
13
|
+
{ index: 0x0030, name: 'BIT1', baseDataType: 'BIT1', bitSize: 1, description: 'Can be used as UNSIGNED1' },
|
|
14
|
+
{ index: 0x0031, name: 'BIT2', baseDataType: 'BIT2', bitSize: 2, description: 'Can be used as UNSIGNED2' },
|
|
15
|
+
{ index: 0x0032, name: 'BIT3', baseDataType: 'BIT3', bitSize: 3, description: 'Can be used as UNSIGNED3' },
|
|
16
|
+
{ index: 0x0033, name: 'BIT4', baseDataType: 'BIT4', bitSize: 4, description: 'Can be used as UNSIGNED4' },
|
|
17
|
+
{ index: 0x0034, name: 'BIT5', baseDataType: 'BIT5', bitSize: 5, description: 'Can be used as UNSIGNED5' },
|
|
18
|
+
{ index: 0x0035, name: 'BIT6', baseDataType: 'BIT6', bitSize: 6, description: 'Can be used as UNSIGNED6' },
|
|
19
|
+
{ index: 0x0036, name: 'BIT7', baseDataType: 'BIT7', bitSize: 7, description: 'Can be used as UNSIGNED7' },
|
|
20
|
+
{ index: 0x0037, name: 'BIT8', baseDataType: 'BIT8', bitSize: 8, description: 'Can be used as UNSIGNED8' },
|
|
21
|
+
{ index: 0x0038, name: 'BIT9', baseDataType: 'BIT9', bitSize: 9, description: 'Can be used as UNSIGNED9' },
|
|
22
|
+
{ index: 0x0039, name: 'BIT10', baseDataType: 'BIT10', bitSize: 10, description: 'Can be used as UNSIGNED10' },
|
|
23
|
+
{ index: 0x003A, name: 'BIT11', baseDataType: 'BIT11', bitSize: 11, description: 'Can be used as UNSIGNED11' },
|
|
24
|
+
{ index: 0x003B, name: 'BIT12', baseDataType: 'BIT12', bitSize: 12, description: 'Can be used as UNSIGNED12' },
|
|
25
|
+
{ index: 0x003C, name: 'BIT13', baseDataType: 'BIT13', bitSize: 13, description: 'Can be used as UNSIGNED13' },
|
|
26
|
+
{ index: 0x003D, name: 'BIT14', baseDataType: 'BIT14', bitSize: 14, description: 'Can be used as UNSIGNED14' },
|
|
27
|
+
{ index: 0x003E, name: 'BIT15', baseDataType: 'BIT15', bitSize: 15, description: 'Can be used as UNSIGNED15' },
|
|
28
|
+
{ index: 0x003F, name: 'BIT16', baseDataType: 'BIT16', bitSize: 16, description: 'Can be used as UNSIGNED16' },
|
|
29
|
+
{ index: 0x002D, name: 'BITARR8', baseDataType: 'BITARR8', bitSize: 8, description: '8 individual Bits' },
|
|
30
|
+
{ index: 0x002E, name: 'BITARR16', baseDataType: 'BITARR16', bitSize: 16, description: '16 individual Bits' },
|
|
31
|
+
{ index: 0x002F, name: 'BITARR32', baseDataType: 'BITARR32', bitSize: 32, description: '32 individual Bits' },
|
|
32
|
+
// Signed Integer
|
|
33
|
+
{ index: 0x0002, name: 'INTEGER8', baseDataType: 'SINT', bitSize: 8, description: 'Short Integer', range: [-128, 127] },
|
|
34
|
+
{ index: 0x0003, name: 'INTEGER16', baseDataType: 'INT', bitSize: 16, description: 'Integer', range: [-32768, 32767] },
|
|
35
|
+
{ index: 0x0010, name: 'INTEGER24', baseDataType: 'INT24', bitSize: 24, range: [-8388608, 8388607] },
|
|
36
|
+
{ index: 0x0004, name: 'INTEGER32', baseDataType: 'DINT', bitSize: 32, description: 'Double Integer', range: [-2147483648, 2147483647] },
|
|
37
|
+
{ index: 0x0012, name: 'INTEGER40', baseDataType: 'INT40', bitSize: 40 },
|
|
38
|
+
{ index: 0x0013, name: 'INTEGER48', baseDataType: 'INT48', bitSize: 48 },
|
|
39
|
+
{ index: 0x0014, name: 'INTEGER56', baseDataType: 'INT56', bitSize: 56 },
|
|
40
|
+
{ index: 0x0015, name: 'INTEGER64', baseDataType: 'LINT', bitSize: 64, description: 'Long Integer' },
|
|
41
|
+
// Unsigned Integer
|
|
42
|
+
{ index: 0x0005, name: 'UNSIGNED8', baseDataType: 'USINT', bitSize: 8, description: 'Unsigned Short Integer', range: [0, 255] },
|
|
43
|
+
{ index: 0x0006, name: 'UNSIGNED16', baseDataType: 'UINT', bitSize: 16, description: 'Unsigned Integer / Word', range: [0, 65535] },
|
|
44
|
+
{ index: 0x0016, name: 'UNSIGNED24', baseDataType: 'UINT24', bitSize: 24 },
|
|
45
|
+
{ index: 0x0007, name: 'UNSIGNED32', baseDataType: 'UDINT', bitSize: 32, description: 'Unsigned Double Integer', range: [0, 4294967295] },
|
|
46
|
+
{ index: 0x0018, name: 'UNSIGNED40', baseDataType: 'UINT40', bitSize: 40 },
|
|
47
|
+
{ index: 0x0019, name: 'UNSIGNED48', baseDataType: 'UINT48', bitSize: 48 },
|
|
48
|
+
{ index: 0x001A, name: 'UNSIGNED56', baseDataType: 'UINT56', bitSize: 56 },
|
|
49
|
+
{ index: 0x001B, name: 'UNSIGNED64', baseDataType: 'ULINT', bitSize: 64, description: 'Unsigned Long Integer' },
|
|
50
|
+
// Floating
|
|
51
|
+
{ index: 0x0008, name: 'REAL32', baseDataType: 'REAL', bitSize: 32, description: 'Floating point' },
|
|
52
|
+
{ index: 0x0011, name: 'REAL64', baseDataType: 'LREAL', bitSize: 64, description: 'Long float' },
|
|
53
|
+
// GUID
|
|
54
|
+
{ index: 0x001D, name: 'GUID', baseDataType: 'GUID', bitSize: 128, description: 'Globally unique identifier with a length of 128 Bit' },
|
|
55
|
+
];
|
|
56
|
+
/**
|
|
57
|
+
* List of base data types with variable length, as specified in ETG.1020 Protocol Enhancements, Table 99.
|
|
58
|
+
*/
|
|
59
|
+
exports.baseDataTypesWithVariableLength = [
|
|
60
|
+
// Strings
|
|
61
|
+
{ index: 0x0009, name: 'VISIBLE_STRING', baseDataType: 'STRING(n)', bitSize: 0, description: 'VisibleString\n(1 octet per character)' },
|
|
62
|
+
// Octet field
|
|
63
|
+
{ index: 0x000A, name: 'OCTET_STRING', baseDataType: 'ARRAY[0..n] OF BYTE', bitSize: 0, description: 'Sequence of octets (data type BYTE)' },
|
|
64
|
+
{ index: 0x000B, name: 'UNICODE_STRING', baseDataType: 'ARRAY[0..n] OF UINT', bitSize: 0, description: 'Sequence of UINT' },
|
|
65
|
+
{ index: 0x0260, name: 'ARRAY_OF_INT', baseDataType: 'ARRAY[0..n] OF INT', bitSize: 0, description: 'Sequence of INT' },
|
|
66
|
+
{ index: 0x0261, name: 'ARRAY_OF_SINT', baseDataType: 'ARRAY[0..n] OF SINT', bitSize: 0, description: 'Sequence of SINT' },
|
|
67
|
+
{ index: 0x0262, name: 'ARRAY_OF_DINT', baseDataType: 'ARRAY[0..n] OF DINT', bitSize: 0, description: 'Sequence of DINT' },
|
|
68
|
+
{ index: 0x0263, name: 'ARRAY_OF_UDINT', baseDataType: 'ARRAY[0..n] OF UDINT', bitSize: 0, description: 'Sequence of UDINT' },
|
|
69
|
+
];
|
|
70
|
+
/**
|
|
71
|
+
* Combines all base data types, including those from Table 98 and Table 99.
|
|
72
|
+
*/
|
|
73
|
+
exports.allBaseDataTypes = [
|
|
74
|
+
...exports.baseDataTypes,
|
|
75
|
+
...exports.baseDataTypesWithVariableLength,
|
|
76
|
+
];
|
|
77
|
+
/**
|
|
78
|
+
* Finds a base data type that matches the specified index.
|
|
79
|
+
* @param index - The index to search for.
|
|
80
|
+
* @returns The matching base data type, or undefined if not found.
|
|
81
|
+
*/
|
|
82
|
+
function findBaseDataTypeByIndex(index) {
|
|
83
|
+
return exports.allBaseDataTypes.find((baseDataType) => baseDataType.index === index);
|
|
84
|
+
}
|
|
85
|
+
exports.findBaseDataTypeByIndex = findBaseDataTypeByIndex;
|
|
86
|
+
;
|
|
87
|
+
/**
|
|
88
|
+
* Enum for object code definitions, based on ETG.1000.6 EtherCAT Specification - Part 6, Table 62.
|
|
89
|
+
*/
|
|
90
|
+
var ObjectCodeDefinition;
|
|
91
|
+
(function (ObjectCodeDefinition) {
|
|
92
|
+
ObjectCodeDefinition[ObjectCodeDefinition["DOMAIN"] = 2] = "DOMAIN";
|
|
93
|
+
ObjectCodeDefinition[ObjectCodeDefinition["DEFTYPE"] = 5] = "DEFTYPE";
|
|
94
|
+
ObjectCodeDefinition[ObjectCodeDefinition["DEFSTRUCT"] = 6] = "DEFSTRUCT";
|
|
95
|
+
ObjectCodeDefinition[ObjectCodeDefinition["VAR"] = 7] = "VAR";
|
|
96
|
+
ObjectCodeDefinition[ObjectCodeDefinition["ARRAY"] = 8] = "ARRAY";
|
|
97
|
+
ObjectCodeDefinition[ObjectCodeDefinition["RECORD"] = 9] = "RECORD";
|
|
98
|
+
})(ObjectCodeDefinition = exports.ObjectCodeDefinition || (exports.ObjectCodeDefinition = {}));
|
|
99
|
+
/**
|
|
100
|
+
* Represents the EtherCAT State Machine (ESM) states.
|
|
101
|
+
* These states define the different phases in the EtherCAT communication process,
|
|
102
|
+
* determining the level of access and functionality available at each stage.
|
|
103
|
+
*/
|
|
104
|
+
var EthercatState;
|
|
105
|
+
(function (EthercatState) {
|
|
106
|
+
EthercatState[EthercatState["NONE"] = 0] = "NONE";
|
|
107
|
+
EthercatState[EthercatState["INIT"] = 1] = "INIT";
|
|
108
|
+
EthercatState[EthercatState["PREOP"] = 2] = "PREOP";
|
|
109
|
+
EthercatState[EthercatState["BOOT"] = 3] = "BOOT";
|
|
110
|
+
EthercatState[EthercatState["SAFEOP"] = 4] = "SAFEOP";
|
|
111
|
+
EthercatState[EthercatState["OP"] = 8] = "OP";
|
|
112
|
+
})(EthercatState = exports.EthercatState || (exports.EthercatState = {}));
|
|
113
|
+
//# sourceMappingURL=ethercat.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"ethercat.js","sourceRoot":"","sources":["../../../../../libs/motion-master-client/src/lib/ethercat.ts"],"names":[],"mappings":";;;AAuBA;;GAEG;AACU,QAAA,aAAa,GAAmB;IAC3C,EAAE,KAAK,EAAE,MAAM,EAAE,IAAI,EAAE,SAAS,EAAE,YAAY,EAAE,WAAW,EAAE,OAAO,EAAE,CAAC,EAAE,WAAW,EAAE,2BAA2B,EAAE;IACnH,EAAE,KAAK,EAAE,MAAM,EAAE,IAAI,EAAE,MAAM,EAAE,YAAY,EAAE,MAAM,EAAE,OAAO,EAAE,CAAC,EAAE,WAAW,EAAE,sBAAsB,EAAE;IACtG,EAAE,KAAK,EAAE,MAAM,EAAE,IAAI,EAAE,MAAM,EAAE,YAAY,EAAE,MAAM,EAAE,OAAO,EAAE,EAAE,EAAE,WAAW,EAAE,WAAW,EAAE;IAC5F,EAAE,KAAK,EAAE,MAAM,EAAE,IAAI,EAAE,OAAO,EAAE,YAAY,EAAE,OAAO,EAAE,OAAO,EAAE,EAAE,EAAE,WAAW,EAAE,YA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AAM,EAAE,IAAI,EAAE,eAAe,EAAE,YAAY,EAAE,qBAAqB,EAAE,OAAO,EAAE,CAAC,EAAE,WAAW,EAAE,kBAAkB,EAAE;IAC1H,EAAE,KAAK,EAAE,MAAM,EAAE,IAAI,EAAE,gBAAgB,EAAE,YAAY,EAAE,sBAAsB,EAAE,OAAO,EAAE,CAAC,EAAE,WAAW,EAAE,mBAAmB,EAAE;CAC9H,CAAC;AAEF;;GAEG;AACU,QAAA,gBAAgB,GAAmB;IAC9C,GAAG,qBAAa;IAChB,GAAG,uCAA+B;CACnC,CAAC;AAEF;;;;GAIG;AACH,SAAgB,uBAAuB,CAAC,KAAa;IACnD,OAAO,wBAAgB,CAAC,IAAI,CAAC,CAAC,YAAY,EAAE,EAAE,CAAC,YAAY,CAAC,KAAK,KAAK,KAAK,CAAC,CAAC;AAC/E,CAAC;AAFD,0DAEC;AAAA,CAAC;AAEF;;GAEG;AACH,IAAY,oBAOX;AAPD,WAAY,oBAAoB;IAC9B,mEAAe,CAAA;IACf,qEAAgB,CAAA;IAChB,yEAAkB,CAAA;IAClB,6DAAY,CAAA;IACZ,iEAAc,CAAA;IACd,mEAAe,CAAA;AACjB,CAAC,EAPW,oBAAoB,GAApB,4BAAoB,KAApB,4BAAoB,QAO/B;AAED;;;;GAIG;AACH,IAAY,aAOX;AAPD,WAAY,aAAa;IACvB,iDAAQ,CAAA;IACR,iDAAQ,CAAA;IACR,mDAAS,CAAA;IACT,iDAAQ,CAAA;IACR,qDAAU,CAAA;IACV,6CAAM,CAAA;AACR,CAAC,EAPW,aAAa,GAAb,qBAAa,KAAb,qBAAa,QAOxB"}
|
|
@@ -0,0 +1,183 @@
|
|
|
1
|
+
import { BaseDataType } from "./ethercat";
|
|
2
|
+
import { ParameterValueType } from "./types";
|
|
3
|
+
import { EthercatState } from "./ethercat";
|
|
4
|
+
/**
|
|
5
|
+
* Represents a parsed parameter object returned from the /odb endpoint.
|
|
6
|
+
*/
|
|
7
|
+
export interface EthernetDeviceParameter {
|
|
8
|
+
/**
|
|
9
|
+
* The index of the parameter, represented as a number in hexadecimal format.
|
|
10
|
+
*/
|
|
11
|
+
index: number;
|
|
12
|
+
/**
|
|
13
|
+
* The subindex of the parameter, indicating its specific instance within the object.
|
|
14
|
+
*/
|
|
15
|
+
subindex: number;
|
|
16
|
+
/**
|
|
17
|
+
* The name of the parameter, providing a descriptive label.
|
|
18
|
+
*/
|
|
19
|
+
name: string;
|
|
20
|
+
/**
|
|
21
|
+
* The object type code that represents the category of the parameter (e.g., "VAR", "ARRAY", "RECORD").
|
|
22
|
+
* For more information, refer to {@link ObjectCodeDefinition}.
|
|
23
|
+
*/
|
|
24
|
+
objectCode: number;
|
|
25
|
+
/**
|
|
26
|
+
* The value type code indicating the data type or encoding of the parameter's value.
|
|
27
|
+
* For more information, refer to {@link allBaseDataTypes}.
|
|
28
|
+
*/
|
|
29
|
+
valueType: number;
|
|
30
|
+
/**
|
|
31
|
+
* Flags representing additional attributes or configuration settings for the parameter, used for various operational purposes.
|
|
32
|
+
* For more information, refer to {@link https://github.com/synapticon/somanet_software/blob/develop/arm_application/Components/cifXApplicationStackDefinitions/Includes/ECS_API/Ecs_Defines.h#L90}
|
|
33
|
+
*/
|
|
34
|
+
flags: number;
|
|
35
|
+
}
|
|
36
|
+
/**
|
|
37
|
+
* Represents a single PDO (Process Data Object) entry.
|
|
38
|
+
* The index, subindex, and bit length are derived from the actual value of the PDO object, such as 0x1600:01.
|
|
39
|
+
* The data type is included to ensure correct interpretation when receiving or sending PDO entry values.
|
|
40
|
+
*/
|
|
41
|
+
export interface EthernetPdoEntry {
|
|
42
|
+
index: number;
|
|
43
|
+
subindex: number;
|
|
44
|
+
bitLen: number;
|
|
45
|
+
dataType: BaseDataType;
|
|
46
|
+
}
|
|
47
|
+
/**
|
|
48
|
+
* Represents a single Ethernet device.
|
|
49
|
+
* Each Ethernet device hosts a web server, and the base URL uniquely identifies the device.
|
|
50
|
+
*/
|
|
51
|
+
export declare class EthernetDevice {
|
|
52
|
+
readonly baseUrl: string;
|
|
53
|
+
/**
|
|
54
|
+
* A collection of previously retrieved device parameters.
|
|
55
|
+
* These cached parameters assist in determining the correct data type and decoding parameter values during upload.
|
|
56
|
+
* They are also used to identify the list of PDO entries and their configurations.
|
|
57
|
+
*/
|
|
58
|
+
parameters?: EthernetDeviceParameter[];
|
|
59
|
+
/**
|
|
60
|
+
* Cached RxPDO entries.
|
|
61
|
+
*/
|
|
62
|
+
rxPdoEntries?: EthernetPdoEntry[];
|
|
63
|
+
/**
|
|
64
|
+
* Cached TxPDO entries.
|
|
65
|
+
*/
|
|
66
|
+
txPdoEntries?: EthernetPdoEntry[];
|
|
67
|
+
/**
|
|
68
|
+
* Default headers for all requests to the Integro web server.
|
|
69
|
+
*/
|
|
70
|
+
private readonly headers;
|
|
71
|
+
/**
|
|
72
|
+
* Creates an instance of the class with the specified base URL.
|
|
73
|
+
*
|
|
74
|
+
* @param baseUrl - The base URL for accessing the device API.
|
|
75
|
+
*/
|
|
76
|
+
constructor(baseUrl: string);
|
|
77
|
+
/**
|
|
78
|
+
* Parses a single entry (array of strings) representing information about a parameter from the ODB endpoint.
|
|
79
|
+
* For example, the following entry corresponds to "0x2111:1" (Encoder 1 feedback - Raw position):
|
|
80
|
+
* [
|
|
81
|
+
* "2111", // Index in hexadecimal format
|
|
82
|
+
* "1", // Subindex in decimal format
|
|
83
|
+
* "Raw position", // Parameter name
|
|
84
|
+
* "0", // Object code
|
|
85
|
+
* "7", // Value type
|
|
86
|
+
* "87" // Flags
|
|
87
|
+
* ]
|
|
88
|
+
*
|
|
89
|
+
* @param entry - An array of strings containing the parameter information.
|
|
90
|
+
* @returns An object of type EthernetDeviceParameter containing the parsed values.
|
|
91
|
+
*/
|
|
92
|
+
parseEthernetDeviceParameterEntry(entry: string[]): EthernetDeviceParameter;
|
|
93
|
+
/**
|
|
94
|
+
* Retrieves the list of available parameters on the device.
|
|
95
|
+
*
|
|
96
|
+
* @param uid - An optional unique identifier for the request.
|
|
97
|
+
* @returns A promise that resolves to the list of available parameters.
|
|
98
|
+
*/
|
|
99
|
+
getParameters(uid?: string): Promise<EthernetDeviceParameter[]>;
|
|
100
|
+
/**
|
|
101
|
+
* Retrieves the previously fetched device parameters.
|
|
102
|
+
* Makes a request to the Ethernet device only if the parameters are not already cached.
|
|
103
|
+
*
|
|
104
|
+
* @returns A promise that resolves with the cached parameters.
|
|
105
|
+
*/
|
|
106
|
+
getCachedParameters(): Promise<EthernetDeviceParameter[]>;
|
|
107
|
+
getCachedPdoEntries(key: keyof Pick<EthernetDevice, 'rxPdoEntries' | 'txPdoEntries'>, matchPdoTypeByIndex: (index: number) => boolean): Promise<EthernetPdoEntry[]>;
|
|
108
|
+
/**
|
|
109
|
+
* Uploads a single parameter value from the device.
|
|
110
|
+
*
|
|
111
|
+
* @param index - The index of the parameter to upload.
|
|
112
|
+
* @param subindex - The subindex of the parameter to upload.
|
|
113
|
+
* @param uid - An optional unique identifier for the request.
|
|
114
|
+
* @returns - A promise that resolves with the uploaded parameter value.
|
|
115
|
+
*/
|
|
116
|
+
upload(index: number, subindex: number, uid?: string): Promise<ParameterValueType>;
|
|
117
|
+
/**
|
|
118
|
+
* Downloads the value for a specific parameter to the device.
|
|
119
|
+
*
|
|
120
|
+
* @param index - The index of the parameter to be downloaded.
|
|
121
|
+
* @param subindex - The subindex of the parameter to be downloaded.
|
|
122
|
+
* @param value - The value to set for the parameter.
|
|
123
|
+
* @param uid - An optional unique identifier for the request.
|
|
124
|
+
* @returns A promise that resolves when the download is complete.
|
|
125
|
+
*/
|
|
126
|
+
download(index: number, subindex: number, value: ParameterValueType, uid?: string): Promise<void>;
|
|
127
|
+
/**
|
|
128
|
+
* Represents the EtherCAT state {@link EthercatState} of the device.
|
|
129
|
+
*
|
|
130
|
+
* @param uid - An optional unique identifier for the request.
|
|
131
|
+
* @returns {Promise<number>} A promise that resolves to the current state as a number.
|
|
132
|
+
*/
|
|
133
|
+
getState(uid?: string): Promise<number>;
|
|
134
|
+
/**
|
|
135
|
+
* Sets the state {@link EthercatState} of the device.
|
|
136
|
+
*
|
|
137
|
+
* @param state - The target state to set for the device, based on the {@link EthercatState} enumeration.
|
|
138
|
+
* @param uid - An optional unique identifier for the request.
|
|
139
|
+
* @returns A promise that resolves when the state has been successfully set.
|
|
140
|
+
*/
|
|
141
|
+
setState(state: EthercatState, uid?: string): Promise<void>;
|
|
142
|
+
/**
|
|
143
|
+
* Resets or restarts both NetX firmware components: COM and CORE.
|
|
144
|
+
* This operation is typically performed after completing a firmware installation.
|
|
145
|
+
*
|
|
146
|
+
* Note that the device will respond before the actual restart occurs,
|
|
147
|
+
* so please allow a few seconds for the restart to complete.
|
|
148
|
+
*
|
|
149
|
+
* @param {boolean} [clearCachedParameters=true] - Indicates whether to clear cached parameters during the reset.
|
|
150
|
+
* @returns A promise that resolves when the reset request is complete.
|
|
151
|
+
*/
|
|
152
|
+
reset(clearCachedParameters?: boolean): Promise<void>;
|
|
153
|
+
/**
|
|
154
|
+
* Reads a file from the specified device.
|
|
155
|
+
*
|
|
156
|
+
* @todo Implement the function to fetch the file data from the device.
|
|
157
|
+
* @param filename - The name of the file to be read.
|
|
158
|
+
* @param uid - An optional unique identifier for the request.
|
|
159
|
+
* @returns A promise that resolves to a Uint8Array containing the file data.
|
|
160
|
+
*/
|
|
161
|
+
readFile(filename: string, uid?: string): Promise<Uint8Array>;
|
|
162
|
+
/**
|
|
163
|
+
* Writes the specified file content to the device.
|
|
164
|
+
*
|
|
165
|
+
* @todo Implement the function to write the file content to the device.
|
|
166
|
+
* @param filename - The name of the file to be created or overwritten on the device.
|
|
167
|
+
* @param content - The file content to be written, provided as a Uint8Array.
|
|
168
|
+
* @param uid - An optional unique identifier for the request.
|
|
169
|
+
* @returns A promise that resolves when the file has been successfully written.
|
|
170
|
+
*/
|
|
171
|
+
writeFile(filename: string, content: Uint8Array, uid?: string): Promise<void>;
|
|
172
|
+
sendPdo(): Promise<void>;
|
|
173
|
+
/**
|
|
174
|
+
* Receives PDO values from the device.
|
|
175
|
+
*
|
|
176
|
+
* The device sends an array of bytes, and this function processes the parameters, their data types,
|
|
177
|
+
* and the PDO entries to convert the byte array into an array of received PDO entry values.
|
|
178
|
+
*
|
|
179
|
+
* @param uid - An optional unique identifier for the request.
|
|
180
|
+
* @returns An array of received PDO entry values.
|
|
181
|
+
*/
|
|
182
|
+
receivePdo(uid?: string): Promise<number[]>;
|
|
183
|
+
}
|
|
@@ -0,0 +1,410 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.EthernetDevice = void 0;
|
|
4
|
+
const tslib_1 = require("tslib");
|
|
5
|
+
const uuid_1 = require("uuid");
|
|
6
|
+
const ethercat_1 = require("./ethercat");
|
|
7
|
+
const parameter_1 = require("./parameter");
|
|
8
|
+
const device_parameter_1 = require("./device-parameter");
|
|
9
|
+
/**
|
|
10
|
+
* Represents a single Ethernet device.
|
|
11
|
+
* Each Ethernet device hosts a web server, and the base URL uniquely identifies the device.
|
|
12
|
+
*/
|
|
13
|
+
class EthernetDevice {
|
|
14
|
+
/**
|
|
15
|
+
* Creates an instance of the class with the specified base URL.
|
|
16
|
+
*
|
|
17
|
+
* @param baseUrl - The base URL for accessing the device API.
|
|
18
|
+
*/
|
|
19
|
+
constructor(baseUrl) {
|
|
20
|
+
this.baseUrl = baseUrl;
|
|
21
|
+
/**
|
|
22
|
+
* Default headers for all requests to the Integro web server.
|
|
23
|
+
*/
|
|
24
|
+
this.headers = {
|
|
25
|
+
'Accept': 'application/json',
|
|
26
|
+
'Content-Type': 'application/json',
|
|
27
|
+
};
|
|
28
|
+
}
|
|
29
|
+
/**
|
|
30
|
+
* Parses a single entry (array of strings) representing information about a parameter from the ODB endpoint.
|
|
31
|
+
* For example, the following entry corresponds to "0x2111:1" (Encoder 1 feedback - Raw position):
|
|
32
|
+
* [
|
|
33
|
+
* "2111", // Index in hexadecimal format
|
|
34
|
+
* "1", // Subindex in decimal format
|
|
35
|
+
* "Raw position", // Parameter name
|
|
36
|
+
* "0", // Object code
|
|
37
|
+
* "7", // Value type
|
|
38
|
+
* "87" // Flags
|
|
39
|
+
* ]
|
|
40
|
+
*
|
|
41
|
+
* @param entry - An array of strings containing the parameter information.
|
|
42
|
+
* @returns An object of type EthernetDeviceParameter containing the parsed values.
|
|
43
|
+
*/
|
|
44
|
+
parseEthernetDeviceParameterEntry(entry) {
|
|
45
|
+
const index = parseInt(entry[0], 16);
|
|
46
|
+
const subindex = parseInt(entry[1], 16);
|
|
47
|
+
const name = entry[2];
|
|
48
|
+
const objectCode = parseInt(entry[3], 16);
|
|
49
|
+
const valueType = parseInt(entry[4], 16);
|
|
50
|
+
const flags = parseInt(entry[5], 16);
|
|
51
|
+
return { index, subindex, name, objectCode, valueType, flags };
|
|
52
|
+
}
|
|
53
|
+
/**
|
|
54
|
+
* Retrieves the list of available parameters on the device.
|
|
55
|
+
*
|
|
56
|
+
* @param uid - An optional unique identifier for the request.
|
|
57
|
+
* @returns A promise that resolves to the list of available parameters.
|
|
58
|
+
*/
|
|
59
|
+
getParameters(uid) {
|
|
60
|
+
return tslib_1.__awaiter(this, void 0, void 0, function* () {
|
|
61
|
+
const url = new URL('odl', this.baseUrl);
|
|
62
|
+
url.searchParams.set('uid', uid !== null && uid !== void 0 ? uid : (0, uuid_1.v4)());
|
|
63
|
+
const response = yield fetch(url, { headers: this.headers });
|
|
64
|
+
if (!response.ok) {
|
|
65
|
+
throw new Error(`Failed to retrieve the parameter list from ${url}`);
|
|
66
|
+
}
|
|
67
|
+
const { data } = yield response.json();
|
|
68
|
+
const parameters = data.map((entry) => this.parseEthernetDeviceParameterEntry(entry));
|
|
69
|
+
return parameters;
|
|
70
|
+
});
|
|
71
|
+
}
|
|
72
|
+
/**
|
|
73
|
+
* Retrieves the previously fetched device parameters.
|
|
74
|
+
* Makes a request to the Ethernet device only if the parameters are not already cached.
|
|
75
|
+
*
|
|
76
|
+
* @returns A promise that resolves with the cached parameters.
|
|
77
|
+
*/
|
|
78
|
+
getCachedParameters() {
|
|
79
|
+
var _a;
|
|
80
|
+
return tslib_1.__awaiter(this, void 0, void 0, function* () {
|
|
81
|
+
if (this.parameters) {
|
|
82
|
+
return this.parameters;
|
|
83
|
+
}
|
|
84
|
+
this.parameters = yield this.getParameters();
|
|
85
|
+
return (_a = this.parameters) !== null && _a !== void 0 ? _a : [];
|
|
86
|
+
});
|
|
87
|
+
}
|
|
88
|
+
getCachedPdoEntries(key, matchPdoTypeByIndex) {
|
|
89
|
+
var _a;
|
|
90
|
+
return tslib_1.__awaiter(this, void 0, void 0, function* () {
|
|
91
|
+
if (this[key]) {
|
|
92
|
+
return (_a = this[key]) !== null && _a !== void 0 ? _a : [];
|
|
93
|
+
}
|
|
94
|
+
const allParameters = yield this.getCachedParameters();
|
|
95
|
+
const pdoParameters = allParameters.filter(({ index, subindex }) => matchPdoTypeByIndex(index) && subindex !== 0);
|
|
96
|
+
const promises = pdoParameters.map((p) => tslib_1.__awaiter(this, void 0, void 0, function* () { return yield this.upload(p.index, p.subindex); }));
|
|
97
|
+
if (promises) {
|
|
98
|
+
const values = yield Promise.all(promises);
|
|
99
|
+
const entries = values.map(value => {
|
|
100
|
+
var _a;
|
|
101
|
+
const [index, subindex, bitLen] = (0, device_parameter_1.parsePdoSubItemValue)(value);
|
|
102
|
+
const parameter = allParameters.find(p => p.index === index && p.subindex === subindex);
|
|
103
|
+
const dataType = (0, ethercat_1.findBaseDataTypeByIndex)((_a = parameter === null || parameter === void 0 ? void 0 : parameter.valueType) !== null && _a !== void 0 ? _a : 0); // Ignoring potentially undefined base data type.
|
|
104
|
+
return { index, subindex, bitLen, dataType };
|
|
105
|
+
});
|
|
106
|
+
this[key] = entries;
|
|
107
|
+
return entries;
|
|
108
|
+
}
|
|
109
|
+
return [];
|
|
110
|
+
});
|
|
111
|
+
}
|
|
112
|
+
/**
|
|
113
|
+
* Uploads a single parameter value from the device.
|
|
114
|
+
*
|
|
115
|
+
* @param index - The index of the parameter to upload.
|
|
116
|
+
* @param subindex - The subindex of the parameter to upload.
|
|
117
|
+
* @param uid - An optional unique identifier for the request.
|
|
118
|
+
* @returns - A promise that resolves with the uploaded parameter value.
|
|
119
|
+
*/
|
|
120
|
+
upload(index, subindex, uid) {
|
|
121
|
+
return tslib_1.__awaiter(this, void 0, void 0, function* () {
|
|
122
|
+
const url = new URL('sdo', this.baseUrl);
|
|
123
|
+
url.searchParams.set('uid', uid !== null && uid !== void 0 ? uid : (0, uuid_1.v4)());
|
|
124
|
+
url.searchParams.set('idx', index.toString(16));
|
|
125
|
+
url.searchParams.set('sub', subindex.toString());
|
|
126
|
+
const response = yield fetch(url, { headers: this.headers });
|
|
127
|
+
if (!response.ok) {
|
|
128
|
+
throw new Error(`Failed to upload the parameter value from ${url}`);
|
|
129
|
+
}
|
|
130
|
+
const { data } = yield response.json();
|
|
131
|
+
const elements = JSON.parse(data);
|
|
132
|
+
const parameters = yield this.getCachedParameters();
|
|
133
|
+
if (parameters) {
|
|
134
|
+
const parameter = parameters.find(p => p.index === index && p.subindex === subindex);
|
|
135
|
+
if (parameter) {
|
|
136
|
+
const dataType = (0, ethercat_1.findBaseDataTypeByIndex)(parameter.valueType);
|
|
137
|
+
if (dataType) {
|
|
138
|
+
const typedArray = new Uint8Array(elements);
|
|
139
|
+
const dataView = new DataView(typedArray.buffer);
|
|
140
|
+
if (dataType.name === 'BOOLEAN') {
|
|
141
|
+
return dataView.getUint8(0);
|
|
142
|
+
}
|
|
143
|
+
else if (dataType.name === 'INTEGER8') {
|
|
144
|
+
return dataView.getInt8(0);
|
|
145
|
+
}
|
|
146
|
+
else if (dataType.name === 'INTEGER16') {
|
|
147
|
+
return dataView.getInt16(0, true);
|
|
148
|
+
}
|
|
149
|
+
else if (dataType.name === 'INTEGER32') {
|
|
150
|
+
return dataView.getInt32(0, true);
|
|
151
|
+
}
|
|
152
|
+
else if (dataType.name === 'UNSIGNED8') {
|
|
153
|
+
return dataView.getUint8(0);
|
|
154
|
+
}
|
|
155
|
+
else if (dataType.name === 'UNSIGNED16') {
|
|
156
|
+
return dataView.getUint16(0, true);
|
|
157
|
+
}
|
|
158
|
+
else if (dataType.name === 'UNSIGNED32') {
|
|
159
|
+
return dataView.getUint32(0, true);
|
|
160
|
+
}
|
|
161
|
+
else if (dataType.name === 'REAL32') {
|
|
162
|
+
return dataView.getFloat32(0, true);
|
|
163
|
+
}
|
|
164
|
+
else if (dataType.name === 'VISIBLE_STRING') {
|
|
165
|
+
const decoder = new TextDecoder('utf-8');
|
|
166
|
+
const result = decoder.decode(dataView);
|
|
167
|
+
const text = result.replace(/[^\x20-\x7E]/g, ''); // Remove non-printable characters; retain only printable ASCII characters.
|
|
168
|
+
return text;
|
|
169
|
+
}
|
|
170
|
+
}
|
|
171
|
+
}
|
|
172
|
+
}
|
|
173
|
+
return elements;
|
|
174
|
+
});
|
|
175
|
+
}
|
|
176
|
+
/**
|
|
177
|
+
* Downloads the value for a specific parameter to the device.
|
|
178
|
+
*
|
|
179
|
+
* @param index - The index of the parameter to be downloaded.
|
|
180
|
+
* @param subindex - The subindex of the parameter to be downloaded.
|
|
181
|
+
* @param value - The value to set for the parameter.
|
|
182
|
+
* @param uid - An optional unique identifier for the request.
|
|
183
|
+
* @returns A promise that resolves when the download is complete.
|
|
184
|
+
*/
|
|
185
|
+
download(index, subindex, value, uid) {
|
|
186
|
+
return tslib_1.__awaiter(this, void 0, void 0, function* () {
|
|
187
|
+
const url = new URL('sdo', this.baseUrl);
|
|
188
|
+
let elements;
|
|
189
|
+
if (typeof value === 'string') {
|
|
190
|
+
const uint8Array = new Uint8Array(value.length);
|
|
191
|
+
for (let i = 0; i < value.length; i++) {
|
|
192
|
+
uint8Array[i] = value.charCodeAt(i);
|
|
193
|
+
}
|
|
194
|
+
elements = [...uint8Array];
|
|
195
|
+
}
|
|
196
|
+
else if (typeof value === 'number') {
|
|
197
|
+
const buffer = new ArrayBuffer(4);
|
|
198
|
+
const dataView = new DataView(buffer);
|
|
199
|
+
dataView.setUint32(0, value, true);
|
|
200
|
+
const uint8Array = new Uint8Array(buffer);
|
|
201
|
+
elements = [...uint8Array];
|
|
202
|
+
}
|
|
203
|
+
else if (value instanceof Uint8Array) {
|
|
204
|
+
elements = [...value];
|
|
205
|
+
}
|
|
206
|
+
else if (Array.isArray(value)) {
|
|
207
|
+
elements = value.slice();
|
|
208
|
+
}
|
|
209
|
+
if (!elements) {
|
|
210
|
+
throw new Error(`Failed to create an array of numbers from the provided value: ${value}.`);
|
|
211
|
+
}
|
|
212
|
+
const bodyData = {
|
|
213
|
+
uid: uid !== null && uid !== void 0 ? uid : (0, uuid_1.v4)(),
|
|
214
|
+
idx: index.toString(16),
|
|
215
|
+
sub: subindex.toString(16),
|
|
216
|
+
data: JSON.stringify(elements),
|
|
217
|
+
};
|
|
218
|
+
const response = yield fetch(url, { headers: this.headers, method: 'PUT', body: JSON.stringify(bodyData) });
|
|
219
|
+
if (!response.ok) {
|
|
220
|
+
throw new Error(`Failed to download the parameter value to ${url}`);
|
|
221
|
+
}
|
|
222
|
+
return;
|
|
223
|
+
});
|
|
224
|
+
}
|
|
225
|
+
/**
|
|
226
|
+
* Represents the EtherCAT state {@link EthercatState} of the device.
|
|
227
|
+
*
|
|
228
|
+
* @param uid - An optional unique identifier for the request.
|
|
229
|
+
* @returns {Promise<number>} A promise that resolves to the current state as a number.
|
|
230
|
+
*/
|
|
231
|
+
getState(uid) {
|
|
232
|
+
return tslib_1.__awaiter(this, void 0, void 0, function* () {
|
|
233
|
+
const url = new URL('mode', this.baseUrl);
|
|
234
|
+
url.searchParams.set('uid', uid !== null && uid !== void 0 ? uid : (0, uuid_1.v4)());
|
|
235
|
+
const response = yield fetch(url, { headers: this.headers });
|
|
236
|
+
if (!response.ok) {
|
|
237
|
+
throw new Error(`Failed to retrieve the state (mode) from ${url}.`);
|
|
238
|
+
}
|
|
239
|
+
const { data } = yield response.json();
|
|
240
|
+
const elements = JSON.parse(data);
|
|
241
|
+
return elements[0];
|
|
242
|
+
});
|
|
243
|
+
}
|
|
244
|
+
/**
|
|
245
|
+
* Sets the state {@link EthercatState} of the device.
|
|
246
|
+
*
|
|
247
|
+
* @param state - The target state to set for the device, based on the {@link EthercatState} enumeration.
|
|
248
|
+
* @param uid - An optional unique identifier for the request.
|
|
249
|
+
* @returns A promise that resolves when the state has been successfully set.
|
|
250
|
+
*/
|
|
251
|
+
setState(state, uid) {
|
|
252
|
+
return tslib_1.__awaiter(this, void 0, void 0, function* () {
|
|
253
|
+
const url = new URL('mode', this.baseUrl);
|
|
254
|
+
const elements = [state];
|
|
255
|
+
const bodyData = {
|
|
256
|
+
uid: uid !== null && uid !== void 0 ? uid : (0, uuid_1.v4)(),
|
|
257
|
+
data: JSON.stringify(elements),
|
|
258
|
+
};
|
|
259
|
+
const response = yield fetch(url, { headers: this.headers, method: 'PUT', body: JSON.stringify(bodyData) });
|
|
260
|
+
if (!response.ok) {
|
|
261
|
+
throw new Error(`Failed to set the state (mode) for ${url}`);
|
|
262
|
+
}
|
|
263
|
+
return;
|
|
264
|
+
});
|
|
265
|
+
}
|
|
266
|
+
/**
|
|
267
|
+
* Resets or restarts both NetX firmware components: COM and CORE.
|
|
268
|
+
* This operation is typically performed after completing a firmware installation.
|
|
269
|
+
*
|
|
270
|
+
* Note that the device will respond before the actual restart occurs,
|
|
271
|
+
* so please allow a few seconds for the restart to complete.
|
|
272
|
+
*
|
|
273
|
+
* @param {boolean} [clearCachedParameters=true] - Indicates whether to clear cached parameters during the reset.
|
|
274
|
+
* @returns A promise that resolves when the reset request is complete.
|
|
275
|
+
*/
|
|
276
|
+
reset(clearCachedParameters = true) {
|
|
277
|
+
return tslib_1.__awaiter(this, void 0, void 0, function* () {
|
|
278
|
+
const url = new URL(this.baseUrl);
|
|
279
|
+
const boundary = "-----------------------------148898471934663038094292100363";
|
|
280
|
+
const formData = [
|
|
281
|
+
`${boundary}`,
|
|
282
|
+
'Content-Disposition: form-data; name="uploadfile"',
|
|
283
|
+
'',
|
|
284
|
+
'upload_file',
|
|
285
|
+
`${boundary}`,
|
|
286
|
+
'Content-Disposition: form-data; name="resetdev"',
|
|
287
|
+
'',
|
|
288
|
+
'device_reset',
|
|
289
|
+
`${boundary}--`
|
|
290
|
+
].join('\r\n');
|
|
291
|
+
const response = yield fetch(url, {
|
|
292
|
+
method: 'POST',
|
|
293
|
+
body: formData,
|
|
294
|
+
headers: {
|
|
295
|
+
'Content-Type': `multipart/form-data; boundary=${boundary}`
|
|
296
|
+
},
|
|
297
|
+
});
|
|
298
|
+
if (!response.ok) {
|
|
299
|
+
throw new Error(`Failed to reset the device.`);
|
|
300
|
+
}
|
|
301
|
+
if (clearCachedParameters) {
|
|
302
|
+
this.parameters = undefined;
|
|
303
|
+
this.rxPdoEntries = undefined;
|
|
304
|
+
this.txPdoEntries = undefined;
|
|
305
|
+
}
|
|
306
|
+
return;
|
|
307
|
+
});
|
|
308
|
+
}
|
|
309
|
+
/**
|
|
310
|
+
* Reads a file from the specified device.
|
|
311
|
+
*
|
|
312
|
+
* @todo Implement the function to fetch the file data from the device.
|
|
313
|
+
* @param filename - The name of the file to be read.
|
|
314
|
+
* @param uid - An optional unique identifier for the request.
|
|
315
|
+
* @returns A promise that resolves to a Uint8Array containing the file data.
|
|
316
|
+
*/
|
|
317
|
+
readFile(filename, uid) {
|
|
318
|
+
return tslib_1.__awaiter(this, void 0, void 0, function* () {
|
|
319
|
+
console.log(filename, uid);
|
|
320
|
+
return new Uint8Array();
|
|
321
|
+
});
|
|
322
|
+
}
|
|
323
|
+
/**
|
|
324
|
+
* Writes the specified file content to the device.
|
|
325
|
+
*
|
|
326
|
+
* @todo Implement the function to write the file content to the device.
|
|
327
|
+
* @param filename - The name of the file to be created or overwritten on the device.
|
|
328
|
+
* @param content - The file content to be written, provided as a Uint8Array.
|
|
329
|
+
* @param uid - An optional unique identifier for the request.
|
|
330
|
+
* @returns A promise that resolves when the file has been successfully written.
|
|
331
|
+
*/
|
|
332
|
+
writeFile(filename, content, uid) {
|
|
333
|
+
return tslib_1.__awaiter(this, void 0, void 0, function* () {
|
|
334
|
+
console.log(filename, content, uid);
|
|
335
|
+
return;
|
|
336
|
+
});
|
|
337
|
+
}
|
|
338
|
+
sendPdo() {
|
|
339
|
+
return tslib_1.__awaiter(this, void 0, void 0, function* () {
|
|
340
|
+
const pdoEntries = yield this.getCachedPdoEntries('rxPdoEntries', parameter_1.isRxPdoIndex);
|
|
341
|
+
console.log(pdoEntries);
|
|
342
|
+
return;
|
|
343
|
+
});
|
|
344
|
+
}
|
|
345
|
+
/**
|
|
346
|
+
* Receives PDO values from the device.
|
|
347
|
+
*
|
|
348
|
+
* The device sends an array of bytes, and this function processes the parameters, their data types,
|
|
349
|
+
* and the PDO entries to convert the byte array into an array of received PDO entry values.
|
|
350
|
+
*
|
|
351
|
+
* @param uid - An optional unique identifier for the request.
|
|
352
|
+
* @returns An array of received PDO entry values.
|
|
353
|
+
*/
|
|
354
|
+
receivePdo(uid) {
|
|
355
|
+
return tslib_1.__awaiter(this, void 0, void 0, function* () {
|
|
356
|
+
const url = new URL('pdo', this.baseUrl);
|
|
357
|
+
url.searchParams.set('uid', uid !== null && uid !== void 0 ? uid : (0, uuid_1.v4)());
|
|
358
|
+
const response = yield fetch(url, { headers: this.headers });
|
|
359
|
+
if (!response.ok) {
|
|
360
|
+
throw new Error(`Failed to receive PDO from ${url}.`);
|
|
361
|
+
}
|
|
362
|
+
const pdoEntries = yield this.getCachedPdoEntries('txPdoEntries', parameter_1.isTxPdoIndex);
|
|
363
|
+
const { data } = yield response.json();
|
|
364
|
+
const elements = JSON.parse(data);
|
|
365
|
+
const uint8Array = new Uint8Array(elements);
|
|
366
|
+
const dataView = new DataView(uint8Array.buffer);
|
|
367
|
+
const values = [];
|
|
368
|
+
let offset = 0;
|
|
369
|
+
pdoEntries.forEach(({ dataType }) => {
|
|
370
|
+
let value = 0;
|
|
371
|
+
if (dataType.name === 'BOOLEAN') {
|
|
372
|
+
value = dataView.getUint8(offset);
|
|
373
|
+
offset += 1;
|
|
374
|
+
}
|
|
375
|
+
else if (dataType.name === 'INTEGER8') {
|
|
376
|
+
value = dataView.getInt8(offset);
|
|
377
|
+
offset += 1;
|
|
378
|
+
}
|
|
379
|
+
else if (dataType.name === 'INTEGER16') {
|
|
380
|
+
value = dataView.getInt16(offset, false);
|
|
381
|
+
offset += 2;
|
|
382
|
+
}
|
|
383
|
+
else if (dataType.name === 'INTEGER32') {
|
|
384
|
+
value = dataView.getInt32(offset, false);
|
|
385
|
+
offset += 4;
|
|
386
|
+
}
|
|
387
|
+
else if (dataType.name === 'UNSIGNED8') {
|
|
388
|
+
value = dataView.getUint8(offset);
|
|
389
|
+
offset += 1;
|
|
390
|
+
}
|
|
391
|
+
else if (dataType.name === 'UNSIGNED16') {
|
|
392
|
+
value = dataView.getUint16(offset, false);
|
|
393
|
+
offset += 2;
|
|
394
|
+
}
|
|
395
|
+
else if (dataType.name === 'UNSIGNED32') {
|
|
396
|
+
value = dataView.getUint32(offset, false);
|
|
397
|
+
offset += 4;
|
|
398
|
+
}
|
|
399
|
+
else if (dataType.name === 'REAL32') {
|
|
400
|
+
value = dataView.getFloat32(offset, false);
|
|
401
|
+
offset += 4;
|
|
402
|
+
}
|
|
403
|
+
values.push(value);
|
|
404
|
+
});
|
|
405
|
+
return values;
|
|
406
|
+
});
|
|
407
|
+
}
|
|
408
|
+
}
|
|
409
|
+
exports.EthernetDevice = EthernetDevice;
|
|
410
|
+
//# sourceMappingURL=ethernet.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"ethernet.js","sourceRoot":"","sources":["../../../../../libs/motion-master-client/src/lib/ethernet.ts"],"names":[],"mappings":";;;;AAAA,+BAA0B;AAC1B,yCAAmE;AAGnE,2CAAyD;AACzD,yDAA0D;AAoD1D;;;GAGG;AACH,MAAa,cAAc;IA2BzB;;;;OAIG;IACH,YAA4B,OAAe;QAAf,YAAO,GAAP,OAAO,CAAQ;QAb3C;;WAEG;QACc,YAAO,GAAG;YACzB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