@@ -9,17 +9,17 @@ import {
9
9
InvertKeyValues ,
10
10
} from '../../../../utils.js' ;
11
11
12
- const Logix5000DataTypeCodes = Object . freeze ( {
12
+ export const Logix5000DataTypeCodes = Object . freeze ( {
13
13
Program : 0x68 ,
14
14
Map : 0x69 ,
15
15
Routine : 0x6D ,
16
16
Task : 0x70 ,
17
17
Cxn : 0x7E ,
18
18
} ) ;
19
19
20
- const Logix5000DatatypeNames = InvertKeyValues ( Logix5000DataTypeCodes ) ;
20
+ export const Logix5000DatatypeNames = InvertKeyValues ( Logix5000DataTypeCodes ) ;
21
21
22
- const Logix5000DataType = Object . freeze ( {
22
+ export const Logix5000DataType = Object . freeze ( {
23
23
Program ( ) {
24
24
return { type : Logix5000DataType . Program , code : Logix5000DataTypeCodes . Program } ;
25
25
} ,
@@ -37,14 +37,14 @@ const Logix5000DataType = Object.freeze({
37
37
} ,
38
38
} ) ;
39
39
40
- const Logix5000ClassCodes = Object . freeze ( {
40
+ export const Logix5000ClassCodes = Object . freeze ( {
41
41
Symbol : 0x6B ,
42
42
Template : 0x6C ,
43
43
Controller : 0xAC ,
44
44
} ) ;
45
45
46
46
/** 1756-PM020, pg. 16 */
47
- const SymbolServiceCodes = Object . freeze ( {
47
+ export const SymbolServiceCodes = Object . freeze ( {
48
48
Read : 0x4C ,
49
49
ReadFragmented : 0x52 ,
50
50
WriteTag : 0x4D ,
@@ -53,9 +53,9 @@ const SymbolServiceCodes = Object.freeze({
53
53
GetInstanceAttributeList : 0x55 ,
54
54
} ) ;
55
55
56
- const SymbolServiceNames = InvertKeyValues ( SymbolServiceCodes ) ;
56
+ export const SymbolServiceNames = InvertKeyValues ( SymbolServiceCodes ) ;
57
57
58
- const SymbolInstanceAttributeCodes = Object . freeze ( {
58
+ export const SymbolInstanceAttributeCodes = Object . freeze ( {
59
59
Name : 0x01 ,
60
60
Type : 0x02 ,
61
61
Bytes : 0x07 ,
@@ -68,7 +68,7 @@ const SymbolInstanceAttributeCodes = Object.freeze({
68
68
Unknown11 : 11 ,
69
69
} ) ;
70
70
71
- const SymbolInstanceAttributeNames = InvertKeyValues ( SymbolInstanceAttributeCodes ) ;
71
+ export const SymbolInstanceAttributeNames = InvertKeyValues ( SymbolInstanceAttributeCodes ) ;
72
72
73
73
/**
74
74
* Possible remaining attributes:
@@ -84,7 +84,7 @@ const SymbolInstanceAttributeNames = InvertKeyValues(SymbolInstanceAttributeCode
84
84
* Defines whether a tag value remains constant. Tags with this attribute
85
85
* set cannot be changed programmatically.)
86
86
*/
87
- const SymbolInstanceAttributeDataTypes = Object . freeze ( {
87
+ export const SymbolInstanceAttributeDataTypes = Object . freeze ( {
88
88
[ SymbolInstanceAttributeCodes . Name ] : DataType . STRING ,
89
89
[ SymbolInstanceAttributeCodes . Type ] : DataType . TRANSFORM (
90
90
DataType . UINT ,
@@ -100,57 +100,57 @@ const SymbolInstanceAttributeDataTypes = Object.freeze({
100
100
[ SymbolInstanceAttributeCodes . Unknown11 ] : DataType . UNKNOWN ( 1 ) ,
101
101
} ) ;
102
102
103
- const TemplateServiceCodes = Object . freeze ( {
103
+ export const TemplateServiceCodes = Object . freeze ( {
104
104
Read : 0x4C ,
105
105
} ) ;
106
106
107
- const TemplateInstanceAttributeCodes = Object . freeze ( {
107
+ export const TemplateInstanceAttributeCodes = Object . freeze ( {
108
108
StructureHandle : 0x01 , /** Calculated CRC value for members of the structure */
109
109
MemberCount : 0x02 , /** Number of members defined in the structure */
110
110
DefinitionSize : 0x04 , /** Size of the template definition structure */
111
111
StructureSize : 0x05 , /** Number of bytes transferred on the wire when the structure is read using the Read Tag service */
112
112
} ) ;
113
113
114
- const TemplateInstanceAttributeDataTypes = Object . freeze ( {
114
+ export const TemplateInstanceAttributeDataTypes = Object . freeze ( {
115
115
[ TemplateInstanceAttributeCodes . StructureHandle ] : DataType . UINT ,
116
116
[ TemplateInstanceAttributeCodes . MemberCount ] : DataType . UINT ,
117
117
[ TemplateInstanceAttributeCodes . DefinitionSize ] : DataType . UDINT ,
118
118
[ TemplateInstanceAttributeCodes . StructureSize ] : DataType . UDINT ,
119
119
} ) ;
120
120
121
- const TemplateClassAttributeCodes = Object . freeze ( {
121
+ export const TemplateClassAttributeCodes = Object . freeze ( {
122
122
Unknown1 : 1 ,
123
123
Unknown2 : 2 ,
124
124
Unknown3 : 3 ,
125
125
Unknown8 : 8 ,
126
126
} ) ;
127
127
128
- const TemplateClassAttributeDataTypes = Object . freeze ( {
128
+ export const TemplateClassAttributeDataTypes = Object . freeze ( {
129
129
[ TemplateClassAttributeCodes . Unknown1 ] : DataType . UNKNOWN ( 2 ) ,
130
130
[ TemplateClassAttributeCodes . Unknown2 ] : DataType . UNKNOWN ( 4 ) ,
131
131
[ TemplateClassAttributeCodes . Unknown3 ] : DataType . UNKNOWN ( 4 ) ,
132
132
[ TemplateClassAttributeCodes . Unknown8 ] : DataType . UNKNOWN ( 4 ) ,
133
133
} ) ;
134
134
135
- const ControllerInstanceAttributeCodes = Object . freeze ( {
135
+ export const ControllerInstanceAttributeCodes = Object . freeze ( {
136
136
Unknown1 : 1 ,
137
137
Unknown2 : 2 ,
138
138
Unknown3 : 3 ,
139
139
Unknown4 : 4 ,
140
140
Unknown10 : 10 ,
141
141
} ) ;
142
142
143
- const ControllerInstanceAttributeNames = InvertKeyValues ( ControllerInstanceAttributeCodes ) ;
143
+ export const ControllerInstanceAttributeNames = InvertKeyValues ( ControllerInstanceAttributeCodes ) ;
144
144
145
- const ControllerInstanceAttributeDataTypes = Object . freeze ( {
145
+ export const ControllerInstanceAttributeDataTypes = Object . freeze ( {
146
146
[ ControllerInstanceAttributeCodes . Unknown1 ] : DataType . UINT ,
147
147
[ ControllerInstanceAttributeCodes . Unknown2 ] : DataType . UINT ,
148
148
[ ControllerInstanceAttributeCodes . Unknown3 ] : DataType . UDINT ,
149
149
[ ControllerInstanceAttributeCodes . Unknown4 ] : DataType . UDINT ,
150
150
[ ControllerInstanceAttributeCodes . Unknown10 ] : DataType . UDINT ,
151
151
} ) ;
152
152
153
- const GenericServiceStatusDescriptions = {
153
+ export const GenericServiceStatusDescriptions = {
154
154
0x04 : 'A syntax error was detected decoding the Request Path' ,
155
155
0x05 : 'Request Path destination unknown' ,
156
156
0x06 : 'Insufficient Packet Space: Not enough room in the response buffer for all the data' ,
@@ -169,7 +169,7 @@ const GenericServiceStatusDescriptions = {
169
169
} ,
170
170
} ;
171
171
172
- class SymbolType {
172
+ export class SymbolType {
173
173
constructor ( code ) {
174
174
this . code = code ;
175
175
this . atomic = getBits ( code , 15 , 16 ) === 0 ;
@@ -203,7 +203,7 @@ class SymbolType {
203
203
}
204
204
}
205
205
206
- class Member {
206
+ export class Member {
207
207
constructor ( typeCode , info , offset , name , host ) {
208
208
this . type = new SymbolType ( typeCode ) ;
209
209
this . info = info ;
@@ -212,28 +212,3 @@ class Member {
212
212
this . host = ! ! host ;
213
213
}
214
214
}
215
-
216
- export default {
217
- Logix5000DataTypeCodes,
218
- Logix5000DatatypeNames,
219
- Logix5000DataType,
220
- Logix5000ClassCodes,
221
- SymbolServiceCodes,
222
- SymbolServiceNames,
223
- SymbolInstanceAttributeCodes,
224
- SymbolInstanceAttributeNames,
225
- SymbolInstanceAttributeDataTypes,
226
- // SymbolServiceErrorDescriptions,
227
- TemplateServiceCodes,
228
- TemplateClassAttributeCodes,
229
- TemplateClassAttributeDataTypes,
230
- TemplateInstanceAttributeCodes,
231
- TemplateInstanceAttributeDataTypes,
232
- // TemplateServiceErrorDescriptions,
233
- GenericServiceStatusDescriptions,
234
- Member,
235
- SymbolType,
236
- ControllerInstanceAttributeCodes,
237
- ControllerInstanceAttributeDataTypes,
238
- ControllerInstanceAttributeNames,
239
- } ;
0 commit comments