ads-client 1.14.3 → 2.0.0-beta.2

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.
@@ -0,0 +1,810 @@
1
+ import { PlcPrimitiveType } from "./types/ads-client-types";
2
+ import { AmsAddress } from "./types/ads-protocol-types";
3
+ /**
4
+ * AMS/TCP header length
5
+ */
6
+ export declare const AMS_TCP_HEADER_LENGTH = 6;
7
+ /**
8
+ * AMS header length
9
+ */
10
+ export declare const AMS_HEADER_LENGTH = 32;
11
+ /**
12
+ * AmsNetId length
13
+ */
14
+ export declare const AMS_NET_ID_LENGTH = 6;
15
+ /**
16
+ * ADS index offset length
17
+ */
18
+ export declare const ADS_INDEX_OFFSET_LENGTH = 4;
19
+ /**
20
+ * ADS index group length
21
+ */
22
+ export declare const ADS_INDEX_GROUP_LENGTH = 4;
23
+ /**
24
+ * ADS invoke ID maximum value (32bit unsigned integer)
25
+ */
26
+ export declare const ADS_INVOKE_ID_MAX_VALUE = 4294967295;
27
+ /**
28
+ * Default ADS server TCP port for incoming connections
29
+ */
30
+ export declare const ADS_DEFAULT_TCP_PORT = 48898;
31
+ /**
32
+ * Loopback (localhost) AmsNetId
33
+ */
34
+ export declare const LOOPBACK_AMS_NET_ID = "127.0.0.1.1.1";
35
+ /**
36
+ * AMS header flag (AMS command)
37
+ */
38
+ export declare const AMS_HEADER_FLAG: {
39
+ /** 0x0000 - Used for ADS commands */
40
+ AMS_TCP_PORT_AMS_CMD: number;
41
+ /** 0x0001 - Port close command*/
42
+ AMS_TCP_PORT_CLOSE: number;
43
+ /** 0x1000 - Port connect command */
44
+ AMS_TCP_PORT_CONNECT: number;
45
+ /** 0x1001 - Router notification */
46
+ AMS_TCP_PORT_ROUTER_NOTE: number;
47
+ /** 0x1002 - Requests local AmsNetId */
48
+ GET_LOCAL_NETID: number;
49
+ /** Returns the corresponding key as string by given value (number) */
50
+ toString: (value: number) => string;
51
+ };
52
+ /**
53
+ * Reserved/known ADS ports
54
+ *
55
+ * Source: TwinCAT.Ads.dll By Beckhoff
56
+ */
57
+ export declare const ADS_RESERVED_PORTS: {
58
+ None: number;
59
+ /** AMS Router (Port 1) */
60
+ Router: number;
61
+ /** AMS Debugger (Port 2) */
62
+ Debugger: number;
63
+ /** The TCom Server. Dpc or passive level. */
64
+ R0_TComServer: number;
65
+ /** TCom Server Task. RT context. */
66
+ R0_TComServerTask: number;
67
+ /** TCom Serve Task. Passive level. */
68
+ R0_TComServer_PL: number;
69
+ /** TwinCAT Debugger */
70
+ R0_TcDebugger: number;
71
+ /** TwinCAT Debugger Task */
72
+ R0_TcDebuggerTask: number;
73
+ /** The License Server (Port 30) */
74
+ R0_LicenseServer: number;
75
+ /** Logger (Port 100) */
76
+ Logger: number;
77
+ /** Event Logger (Port 110) */
78
+ EventLog: number;
79
+ /** application for coupler (EK), gateway (EL), etc. */
80
+ DeviceApplication: number;
81
+ /** Event Logger UM */
82
+ EventLog_UM: number;
83
+ /** Event Logger RT */
84
+ EventLog_RT: number;
85
+ /** Event Logger Publisher */
86
+ EventLogPublisher: number;
87
+ /** R0 Realtime (Port 200) */
88
+ R0_Realtime: number;
89
+ /** R0 Trace (Port 290) */
90
+ R0_Trace: number;
91
+ /** R0 IO (Port 300) */
92
+ R0_IO: number;
93
+ /** NC (R0) (Port 500) */
94
+ R0_NC: number;
95
+ /** R0 Satzausführung (Port 501) */
96
+ R0_NCSAF: number;
97
+ /** R0 Satzvorbereitung (Port 511) */
98
+ R0_NCSVB: number;
99
+ /** Preconfigured Nc2-Nc3-Instance */
100
+ R0_NCINSTANCE: number;
101
+ /** R0 ISG (Port 550) */
102
+ R0_ISG: number;
103
+ /** R0 CNC (Port 600) */
104
+ R0_CNC: number;
105
+ /** R0 Line (Port 700) */
106
+ R0_LINE: number;
107
+ /** R0 PLC (Port 800) */
108
+ R0_PLC: number;
109
+ /** Tc2 PLC RuntimeSystem 1 (Port 801) */
110
+ Tc2_Plc1: number;
111
+ /** Tc2 PLC RuntimeSystem 2 (Port 811) */
112
+ Tc2_Plc2: number;
113
+ /** Tc2 PLC RuntimeSystem 3 (Port 821) */
114
+ Tc2_Plc3: number;
115
+ /** Tc2 PLC RuntimeSystem 4 (Port 831) */
116
+ Tc2_Plc4: number;
117
+ /** R0 RTS (Port 850) */
118
+ R0_RTS: number;
119
+ /** Tc3 PLC RuntimeSystem 1 (Port 851) */
120
+ Tc3_Plc1: number;
121
+ /** Tc3 PLC RuntimeSystem 2 (Port 852) */
122
+ Tc3_Plc2: number;
123
+ /** Tc3 PLC RuntimeSystem 3 (Port 853) */
124
+ Tc3_Plc3: number;
125
+ /** Tc3 PLC RuntimeSystem 4 (Port 854) */
126
+ Tc3_Plc4: number;
127
+ /** Tc3 PLC RuntimeSystem 5 (Port 855) */
128
+ Tc3_Plc5: number;
129
+ /** Camshaft Controller (R0) (Port 900) */
130
+ CamshaftController: number;
131
+ /** R0 CAM Tool (Port 950) */
132
+ R0_CAMTOOL: number;
133
+ /** R0 User (Port 2000) */
134
+ R0_USER: number;
135
+ /** (Port 10000) */
136
+ R3_CTRLPROG: number;
137
+ /** System Service (AMSPORT_R3_SYSSERV, 10000) */
138
+ SystemService: number;
139
+ /** (Port 10001) */
140
+ R3_SYSCTRL: number;
141
+ /** Port 10100 */
142
+ R3_SYSSAMPLER: number;
143
+ /** Port 10200 */
144
+ R3_TCPRAWCONN: number;
145
+ /** Port 10201 */
146
+ R3_TCPIPSERVER: number;
147
+ /** Port 10300 */
148
+ R3_SYSMANAGER: number;
149
+ /** Port 10400 */
150
+ R3_SMSSERVER: number;
151
+ /** Port 10500 */
152
+ R3_MODBUSSERVER: number;
153
+ /** Port 10502 */
154
+ R3_AMSLOGGER: number;
155
+ /** Port 10600 */
156
+ R3_XMLDATASERVER: number;
157
+ /** Port 10700 */
158
+ R3_AUTOCONFIG: number;
159
+ /** Port 10800 */
160
+ R3_PLCCONTROL: number;
161
+ /** Port 10900 */
162
+ R3_FTPCLIENT: number;
163
+ /** Port 11000 */
164
+ R3_NCCTRL: number;
165
+ /** Port 11500 */
166
+ R3_NCINTERPRETER: number;
167
+ /** Port 11600 */
168
+ R3_GSTINTERPRETER: number;
169
+ /** Port 12000 */
170
+ R3_STRECKECTRL: number;
171
+ /** Port 13000 */
172
+ R3_CAMCTRL: number;
173
+ /** Port 14000 */
174
+ R3_SCOPE: number;
175
+ /** Port 14100 */
176
+ R3_CONDITIONMON: number;
177
+ /** Port 15000 */
178
+ R3_SINECH1: number;
179
+ /** Port 16000 */
180
+ R3_CONTROLNET: number;
181
+ /** Port 17000 */
182
+ R3_OPCSERVER: number;
183
+ /** Port 17500 */
184
+ R3_OPCCLIENT: number;
185
+ /** Port 18000 */
186
+ R3_MAILSERVER: number;
187
+ /** Port 19000 */
188
+ R3_EL60XX: number;
189
+ /** Port 19100 */
190
+ R3_MANAGEMENT: number;
191
+ /** Port 19200 */
192
+ R3_MIELEHOME: number;
193
+ /** Port 19300 */
194
+ R3_CPLINK3: number;
195
+ /** Port 19500 */
196
+ R3_VNSERVICE: number;
197
+ /** Multiuser (Port 19600) */
198
+ R3_MULTIUSER: number;
199
+ /** Default (AMS router assigns) */
200
+ USEDEFAULT: number;
201
+ };
202
+ /**
203
+ * ADS command
204
+ *
205
+ * Source: TwinCAT.Ads.dll By Beckhoff
206
+ */
207
+ export declare const ADS_COMMAND: {
208
+ /** Invalid */
209
+ Invalid: number;
210
+ /** None / Uninitialized */
211
+ None: number;
212
+ /** ReadDeviceInfo command */
213
+ ReadDeviceInfo: number;
214
+ /** Read Command */
215
+ Read: number;
216
+ /** Write Command */
217
+ Write: number;
218
+ /** ReadState Command */
219
+ ReadState: number;
220
+ /** WriteControl Command */
221
+ WriteControl: number;
222
+ /** AddNotification Command */
223
+ AddNotification: number;
224
+ /** DeleteNotification Command */
225
+ DeleteNotification: number;
226
+ /** Notification event. */
227
+ Notification: number;
228
+ /** ReadWrite Command */
229
+ ReadWrite: number;
230
+ /** Returns the corresponding key as string by given value (number) */
231
+ toString: (value: number) => string;
232
+ };
233
+ /**
234
+ * ADS state flags
235
+ *
236
+ * Source: TwinCAT.Ads.dll By Beckhoff
237
+ */
238
+ export declare const ADS_STATE_FLAGS: {
239
+ Response: number;
240
+ /** (AMSCMDSF_NORETURN) */
241
+ NoReturn: number;
242
+ /** AdsCommand */
243
+ AdsCommand: number;
244
+ /** Internal generated cmds (AMSCMDSF_SYSCMD) */
245
+ SysCommand: number;
246
+ /** High Priority (R0 to R0 checked at task begin, AMSCMDSF_HIGHPRIO) */
247
+ HighPriority: number;
248
+ /** (cbData um 8 Byte vergrößert, AMSCMDSF_TIMESTAMPADDED) */
249
+ TimeStampAdded: number;
250
+ /** (UDP instead of TCP, AMSCMDSF_UDP) */
251
+ Udp: number;
252
+ /** (command during init phase of TwinCAT, AMSCMDSF_INITCMD) */
253
+ InitCmd: number;
254
+ /** (AMSCMDSF_BROADCAST) */
255
+ Broadcast: number;
256
+ /** Returns the flags as comma separated list by given flag value (number) */
257
+ toString: (value: number) => string;
258
+ };
259
+ /**
260
+ * ADS error code
261
+ *
262
+ * Source: Beckhoff InfoSys
263
+ */
264
+ export declare const ADS_ERROR: Record<number, string>;
265
+ /**
266
+ * ADS notification transmission mode
267
+ *
268
+ * Source: TwinCAT.Ads.dll By Beckhoff
269
+ */
270
+ export declare const ADS_TRANS_MODE: {
271
+ None: number;
272
+ ClientCycle: number;
273
+ ClientOnChange: number;
274
+ Cyclic: number;
275
+ OnChange: number;
276
+ CyclicInContext: number;
277
+ OnChangeInContext: number;
278
+ /** Returns the corresponding key as string by given value (number) */
279
+ toString: (value: number) => string;
280
+ };
281
+ /**
282
+ * ADS state
283
+ *
284
+ * Source: TwinCAT.Ads.dll By Beckhoff
285
+ */
286
+ export declare const ADS_STATE: {
287
+ Invalid: number;
288
+ Idle: number;
289
+ Reset: number;
290
+ Initialize: number;
291
+ Start: number;
292
+ Run: number;
293
+ Stop: number;
294
+ SaveConfig: number;
295
+ LoadConfig: number;
296
+ PowerFailure: number;
297
+ PowerGood: number;
298
+ Error: number;
299
+ Shutdown: number;
300
+ Suspend: number;
301
+ Resume: number;
302
+ Config: number;
303
+ Reconfig: number;
304
+ Stopping: number;
305
+ Incompatible: number;
306
+ Exception: number;
307
+ /** Returns the corresponding key as string by given value (number) */
308
+ toString: (value: number) => string;
309
+ };
310
+ /**
311
+ * Reserved ADS index groups
312
+ *
313
+ * Source: TwinCAT.Ads.dll By Beckhoff
314
+ */
315
+ export declare const ADS_RESERVED_INDEX_GROUPS: {
316
+ /** PlcRWIB (0x4000, 16384) */
317
+ PlcRWIB: number;
318
+ /** PlcRWOB (0x4010, 16400) */
319
+ PlcRWOB: number;
320
+ /** PlcRWMB (0x4020, 16416) */
321
+ PlcRWMB: number;
322
+ /** PlcRWRB (0x4030, 16432) */
323
+ PlcRWRB: number;
324
+ /** PlcRWDB (0x4040,16448) */
325
+ PlcRWDB: number;
326
+ /** SymbolTable (0xF000, 61440) */
327
+ SymbolTable: number;
328
+ /** SymbolName (0xF001, 61441) */
329
+ SymbolName: number;
330
+ /** SymbolValue (0xF002, 61442) */
331
+ SymbolValue: number;
332
+ /** SymbolHandleByName (0xF003, 61443) */
333
+ SymbolHandleByName: number;
334
+ /** SymbolValueByName (0xF004, 61444) */
335
+ SymbolValueByName: number;
336
+ /** SymbolValueByHandle (0xF005, 61445) */
337
+ SymbolValueByHandle: number;
338
+ /** SymbolReleaseHandle (0xF006, 61446) */
339
+ SymbolReleaseHandle: number;
340
+ /** SymbolInfoByName (0xF007, 61447) */
341
+ SymbolInfoByName: number;
342
+ /** SymbolVersion (0xF008, 61448) */
343
+ SymbolVersion: number;
344
+ /** SymbolInfoByNameEx (0xF009, 61449) */
345
+ SymbolInfoByNameEx: number;
346
+ /** SymbolDownload (F00A, 61450) */
347
+ SymbolDownload: number;
348
+ /** SymbolUpload (F00B, 61451) */
349
+ SymbolUpload: number;
350
+ /** SymbolUploadInfo (0xF00C, 61452) */
351
+ SymbolUploadInfo: number;
352
+ /** SymbolDownload2 */
353
+ SymbolDownload2: number;
354
+ /** SymbolDataTypeUpload */
355
+ SymbolDataTypeUpload: number;
356
+ /** SymbolUploadInfo2 */
357
+ SymbolUploadInfo2: number;
358
+ /** Notification of named handle (0xF010, 61456) */
359
+ SymbolNote: number;
360
+ /** DataDataTypeInfoByNameEx */
361
+ DataDataTypeInfoByNameEx: number;
362
+ /** read/write input byte(s) (0xF020, 61472) */
363
+ IOImageRWIB: number;
364
+ /** read/write input bit (0xF021, 61473) */
365
+ IOImageRWIX: number;
366
+ /** read/write output byte(s) (0xF030, 61488) */
367
+ IOImageRWOB: number;
368
+ /** read/write output bit (0xF031, 61489) */
369
+ IOImageRWOX: number;
370
+ /** write inputs to null (0xF040, 61504) */
371
+ IOImageClearI: number;
372
+ /** write outputs to null (0xF050, 61520) */
373
+ IOImageClearO: number;
374
+ /** ADS Sum Read Command (ADSIGRP_SUMUP_READ, 0xF080, 61568) */
375
+ SumCommandRead: number;
376
+ /** ADS Sum Write Command (ADSIGRP_SUMUP_WRITE, 0xF081, 61569) */
377
+ SumCommandWrite: number;
378
+ /** ADS sum Read/Write command (ADSIGRP_SUMUP_READWRITE, 0xF082, 61570) */
379
+ SumCommandReadWrite: number;
380
+ /** ADS sum ReadEx command (ADSIGRP_SUMUP_READEX, 0xF083, 61571) */
381
+ /** AdsRW IOffs list size */
382
+ /** W: {list of IGrp, IOffs, Length} */
383
+ /** R: {list of results, Length} followed by {list of data (expepted lengths)} */
384
+ SumCommandReadEx: number;
385
+ /** ADS sum ReadEx2 command (ADSIGRP_SUMUP_READEX2, 0xF084, 61572) */
386
+ /** AdsRW IOffs list size */
387
+ /** W: {list of IGrp, IOffs, Length} */
388
+ /** R: {list of results, Length} followed by {list of data (returned lengths)} */
389
+ SumCommandReadEx2: number;
390
+ /** ADS sum AddDevNote command (ADSIGRP_SUMUP_ADDDEVNOTE, 0xF085, 61573) */
391
+ /** AdsRW IOffs list size */
392
+ /** W: {list of IGrp, IOffs, Attrib} */
393
+ /** R: {list of results, handles} */
394
+ SumCommandAddDevNote: number;
395
+ /** ADS sum DelDevNot command (ADSIGRP_SUMUP_DELDEVNOTE, 0xF086, 61574) */
396
+ /** AdsRW IOffs list size */
397
+ /** W: {list of handles} */
398
+ /** R: {list of results} */
399
+ SumCommandDelDevNote: number;
400
+ /** DeviceData (0xF100,61696) */
401
+ DeviceData: number;
402
+ /** Returns the corresponding key as string by given value (number) */
403
+ toString: (value: number) => string;
404
+ };
405
+ /**
406
+ * ADS symbol flags
407
+ *
408
+ * Source: TwinCAT.Ads.dll By Beckhoff
409
+ */
410
+ export declare const ADS_SYMBOL_FLAGS: {
411
+ None: number;
412
+ /** ADSSYMBOLFLAG_PERSISTENT */
413
+ Persistent: number;
414
+ /** ADSSYMBOLFLAG_BITVALUE */
415
+ BitValue: number;
416
+ /** ADSSYMBOLFLAG_REFERENCETO */
417
+ ReferenceTo: number;
418
+ /** ADSSYMBOLFLAG_TYPEGUID */
419
+ TypeGuid: number;
420
+ /** ADSSYMBOLFLAG_TCCOMIFACEPTR */
421
+ TComInterfacePtr: number;
422
+ /** ADSSYMBOLFLAG_READONLY */
423
+ ReadOnly: number;
424
+ /** ADSSYMBOLFLAG_ITFMETHODACCESS */
425
+ ItfMethodAccess: number;
426
+ /** ADSSYMBOLFLAG_METHODDEREF */
427
+ MethodDeref: number;
428
+ /** ADSSYMBOLFLAG_CONTEXTMASK (4 Bit) */
429
+ ContextMask: number;
430
+ /** ADSSYMBOLFLAG_ATTRIBUTES */
431
+ Attributes: number;
432
+ /** Symbol is static (ADSSYMBOLFLAG_STATIC,0x2000) */
433
+ Static: number;
434
+ /** Persistent data will not restored after reset (cold, ADSSYMBOLFLAG_INITONRESET 0x4000) */
435
+ InitOnReset: number;
436
+ /** Extended Flags in symbol (ADSSYMBOLFLAG_EXTENDEDFLAGS,0x8000) */
437
+ ExtendedFlags: number;
438
+ /** Return given flag value as string array */
439
+ toStringArray: (flags: number) => string[];
440
+ toString: (flag: number) => string;
441
+ };
442
+ /**
443
+ * ADS symbol extended flags
444
+ *
445
+ * Source: TwinCAT.Ads.dll By Beckhoff
446
+ */
447
+ export declare const ADS_SYMBOL_FLAGS_2: {
448
+ None: number;
449
+ /** PLC pointer type (ADSSYMBOLFLAG2_PLCPOINTERTYPE, 0x00000001) */
450
+ PlcPointerType: number;
451
+ /** Ignore symbol while equalizing redundancy projects (ADSSYMBOLFLAG2_RDIGNORE, 0x00000002) */
452
+ RedundancyIgnore: number;
453
+ /** Contains refactoring information (ADSSYMBOLFLAG2_REFACTORINFO, 0x00000004) */
454
+ RefactorInfo: number;
455
+ /** Online change PTR reference type (ADSSYMBOLFLAG2_OCPTRREFTYPE, 0x00000008) */
456
+ OnlineChangePtrRefType: number;
457
+ /** Symbol is a Variant Type (ADSSYMBOLFLAG2_VARIANT, 0x00000010) */
458
+ VariantType: number;
459
+ /** Return given flag value as string array */
460
+ toStringArray: (flags: number) => string[];
461
+ toString: (flag: number) => string;
462
+ };
463
+ /**
464
+ * ADS data type flags
465
+ *
466
+ * Source: TwinCAT.Ads.dll By Beckhoff
467
+ */
468
+ export declare const ADS_DATA_TYPE_FLAGS: {
469
+ /** ADSDATATYPEFLAG_DATATYPE */
470
+ DataType: number;
471
+ /** ADSDATATYPEFLAG_DATAITEM */
472
+ DataItem: number;
473
+ /** ADSDATATYPEFLAG_REFERENCETO */
474
+ ReferenceTo: number;
475
+ /** ADSDATATYPEFLAG_METHODDEREF */
476
+ MethodDeref: number;
477
+ /** ADSDATATYPEFLAG_OVERSAMPLE */
478
+ Oversample: number;
479
+ /** ADSDATATYPEFLAG_BITVALUES */
480
+ BitValues: number;
481
+ /** ADSDATATYPEFLAG_PROPITEM */
482
+ PropItem: number;
483
+ /** ADSDATATYPEFLAG_TYPEGUID */
484
+ TypeGuid: number;
485
+ /** ADSDATATYPEFLAG_PERSISTENT */
486
+ Persistent: number;
487
+ /** ADSDATATYPEFLAG_COPYMASK */
488
+ CopyMask: number;
489
+ /** ADSDATATYPEFLAG_TCCOMIFACEPTR */
490
+ TComInterfacePtr: number;
491
+ /** ADSDATATYPEFLAG_METHODINFOS */
492
+ MethodInfos: number;
493
+ /** ADSDATATYPEFLAG_ATTRIBUTES */
494
+ Attributes: number;
495
+ /** ADSDATATYPEFLAG_ENUMINFOS */
496
+ EnumInfos: number;
497
+ /** this flag is set if the datatype is aligned (ADSDATATYPEFLAG_ALIGNED) */
498
+ Aligned: number;
499
+ /** data item is static - do not use offs (ADSDATATYPEFLAG_STATIC) */
500
+ Static: number;
501
+ /** Has Software Protection Levels for DataTypes. */
502
+ SoftwareProtectionLevels: number;
503
+ /** do not restore persistent data (ADSDATATYPEFLAG_IGNOREPERSIST) */
504
+ IgnorePersist: number;
505
+ /** Any size array (ADSDATATYPEFLAG_ANYSIZEARRAY) */
506
+ AnySizeArray: number;
507
+ /** data type used for persistent variables -&gt; should be saved with persistent data (ADSDATATYPEFLAG_PERSIST_DT,0x00200000) */
508
+ PersistantDatatype: number;
509
+ /** Persistent data will not restored after reset (cold) (ADSDATATYPEFLAG_INITONRESET,0x00400000) */
510
+ InitOnReset: number;
511
+ /** Indicates PLC Pointer types (ADSDATATYPEFLAG_PLCPOINTERTYPE, 0x00800000) */
512
+ PlcPointerType: number;
513
+ /** Refactoring information is added (ADSDATATYPEFLAG_REFACTORINFO, 0x01000000) */
514
+ RefactorInfo: number;
515
+ /** SubItems are hidden / will not be evaluated (ADSDATATYPEFLAG_HIDESUBITEMS, 0x02000000) */
516
+ HideSubItems: number;
517
+ /** The Type description is incomplete (ADSDATATYPEFLAG_INCOMPLETE, 0x04000000) */
518
+ Incomplete: number;
519
+ /** Type contains online change PTR reference (ADSDATATYPEFLAG_OCPTRREFTYPE, 0x08000000) */
520
+ ContainsOnlineChangePtrRef: number;
521
+ /** Deref Type Item (ADSDATATYPEFLAG_DEREFTYPEITEM, 0x10000000) */
522
+ DeRefTypeItem: number;
523
+ /** Extended Enum Infos. Comment and attributes for enum values (ADSDATATYPEFLAG_EXTENUMINFOS, 0x20000000) */
524
+ ExtendedEnumInfos: number;
525
+ /** Extended Flags used/added (ADSDATATYPEFLAG_EXTENDEDFLAGS, 0x80000000) */
526
+ ExtendedFlags: number;
527
+ /** None / No Flag set */
528
+ None: number;
529
+ /** Return given flag value as string array */
530
+ toStringArray: (flags: number) => string[];
531
+ };
532
+ /**
533
+ * ADS data types
534
+ *
535
+ * Source: TwinCAT.Ads.dll By Beckhoff
536
+ */
537
+ export declare const ADS_DATA_TYPES: {
538
+ /** Empty Type*/
539
+ ADST_VOID: number;
540
+ /**Integer 16 Bit*/
541
+ ADST_INT16: number;
542
+ /**Integer 32 Bit*/
543
+ ADST_INT32: number;
544
+ /**Real (32 Bit)*/
545
+ ADST_REAL32: number;
546
+ /**Real 64 Bit*/
547
+ ADST_REAL64: number;
548
+ /**Integer 8 Bit*/
549
+ ADST_INT8: number;
550
+ /**Unsigned integer 8 Bit*/
551
+ ADST_UINT8: number;
552
+ /**Unsigned integer 16 Bit*/
553
+ ADST_UINT16: number;
554
+ /**Unsigned Integer 32 Bit*/
555
+ ADST_UINT32: number;
556
+ /**LONG Integer 64 Bit*/
557
+ ADST_INT64: number;
558
+ /**Unsigned Long integer 64 Bit*/
559
+ ADST_UINT64: number;
560
+ /**STRING*/
561
+ ADST_STRING: number;
562
+ /**WSTRING*/
563
+ ADST_WSTRING: number;
564
+ /**ADS REAL80*/
565
+ ADST_REAL80: number;
566
+ /**ADS BIT*/
567
+ ADST_BIT: number;
568
+ /**Internal Only*/
569
+ ADST_MAXTYPES: number;
570
+ /**Blob*/
571
+ ADST_BIGTYPE: number;
572
+ /** Returns the corresponding key as string by given value (number) */
573
+ toString: (value: number) => string;
574
+ };
575
+ /**
576
+ * ADS RCP method flags
577
+ *
578
+ * Source: TwinCAT.Ads.dll By Beckhoff
579
+ */
580
+ export declare const ADS_RCP_METHOD_FLAGS: {
581
+ /** (ADSMETHODFLAG_PLC_CALLINGCONVENTION, 0x00000001) */
582
+ PlcCallingConvention: number;
583
+ /** (ADSMETHODFLAG_CALL_UNLOCKED, 0x00000002) */
584
+ CallUnlocked: number;
585
+ /** (ADSMETHODFLAG_NOTCALLABLE, 0x00000004) */
586
+ NotCallable: number;
587
+ /** (ADSMETHODFLAG_ATTRIBUTES, 0x00000008) */
588
+ Attributes: number;
589
+ /** Return given flag value as string array */
590
+ toStringArray: (flags: number) => string[];
591
+ };
592
+ /**
593
+ * ADS RCP method parameter flags
594
+ *
595
+ * Source: TwinCAT.Ads.dll By Beckhoff
596
+ */
597
+ export declare const ADS_RCP_METHOD_PARAM_FLAGS: {
598
+ /** Input Parameter (ADSMETHODPARAFLAG_IN) */
599
+ In: number;
600
+ /** Output Parameter (ADSMETHODPARAFLAG_OUT) */
601
+ Out: number;
602
+ /**
603
+ * By reference Parameter (ADSMETHODPARAFLAG_BYREFERENCE)
604
+ * This flag indicates parameters that are transfered as REFERENCE or POINTER Types.
605
+ */
606
+ ByReference: number;
607
+ /** (ADSMETHODPARAFLAG_RPC_OUTPTR, 0x00000008) */
608
+ RpcOutPtr: number;
609
+ /** (ADSMETHODPARAFLAG_RPC_ARRAYDIM_MASK,0x00000030) */
610
+ MaskRpcArrayDim: number;
611
+ /** Attributes (ADSMETHODPARAFLAG_ATTRIBUTES, 0x00000040)*/
612
+ Attributes: number;
613
+ /** Return given flag value as string array */
614
+ toStringArray: (flags: number) => string[];
615
+ };
616
+ /**
617
+ * AMS router state
618
+ */
619
+ export declare const AMS_ROUTER_STATE: {
620
+ /** Router is stopped */
621
+ STOP: number;
622
+ /** Router is started */
623
+ START: number;
624
+ /** Router is remove (unavailable?) */
625
+ REMOVED: number;
626
+ /** Returns the corresponding key as string by given value (number) */
627
+ toString: (value: number) => string;
628
+ };
629
+ /**
630
+ * Base data types
631
+ *
632
+ * Object that handles PLC base data types
633
+ */
634
+ export declare const BASE_DATA_TYPES: {
635
+ /**
636
+ * Returns true if given data type is found and known
637
+ *
638
+ * @param name Data type name
639
+ */
640
+ isKnownType: (name: string) => boolean;
641
+ /**
642
+ * Finds the given data type from array
643
+ *
644
+ * @param name Data type name
645
+ */
646
+ find: (name: string) => {
647
+ name: string[];
648
+ adsDataType: number;
649
+ size: number;
650
+ toBuffer: (value: string, buffer: Buffer) => number;
651
+ fromBuffer: (buffer: Buffer) => string;
652
+ } | {
653
+ name: string[];
654
+ adsDataType: number;
655
+ size: number;
656
+ toBuffer: (value: boolean | number, buffer: Buffer) => number;
657
+ fromBuffer: (buffer: Buffer) => boolean;
658
+ } | {
659
+ name: string[];
660
+ adsDataType: number;
661
+ size: number;
662
+ toBuffer: (value: number, buffer: Buffer) => number;
663
+ fromBuffer: (buffer: Buffer) => number;
664
+ } | {
665
+ name: string[];
666
+ adsDataType: number;
667
+ size: number;
668
+ toBuffer: (value: number | Date, buffer: Buffer) => void;
669
+ fromBuffer: (buffer: Buffer, convertDates: boolean) => number | Date;
670
+ } | {
671
+ name: string[];
672
+ adsDataType: number;
673
+ size: number;
674
+ toBuffer: (value: number | BigInt | Buffer, buffer: Buffer) => void;
675
+ fromBuffer: (buffer: Buffer) => bigint | Buffer;
676
+ } | null;
677
+ /**
678
+ * Writes given value to given or new buffer
679
+ *
680
+ * @param name Data type name
681
+ * @param value Value to write
682
+ * @param buffer Optional - Buffer to write to. If not given, new Buffer is allocated
683
+ */
684
+ toBuffer: (name: string, value: PlcPrimitiveType | Date, buffer?: Buffer) => Buffer;
685
+ /**
686
+ * Reads given data type from given buffer
687
+ *
688
+ * @param {string} name Data type name
689
+ * @param {Buffer} buffer Buffer to read from
690
+ */
691
+ fromBuffer: (name: string, buffer: Buffer, convertDates: boolean) => string | number | bigint | boolean | Buffer | Date;
692
+ /**
693
+ * All base data types and properties
694
+ */
695
+ types: ({
696
+ name: string[];
697
+ adsDataType: number;
698
+ size: number;
699
+ toBuffer: (value: string, buffer: Buffer) => number;
700
+ fromBuffer: (buffer: Buffer) => string;
701
+ } | {
702
+ name: string[];
703
+ adsDataType: number;
704
+ size: number;
705
+ toBuffer: (value: boolean | number, buffer: Buffer) => number;
706
+ fromBuffer: (buffer: Buffer) => boolean;
707
+ } | {
708
+ name: string[];
709
+ adsDataType: number;
710
+ size: number;
711
+ toBuffer: (value: number, buffer: Buffer) => number;
712
+ fromBuffer: (buffer: Buffer) => number;
713
+ } | {
714
+ name: string[];
715
+ adsDataType: number;
716
+ size: number;
717
+ toBuffer: (value: number | Date, buffer: Buffer) => void;
718
+ fromBuffer: (buffer: Buffer, convertDates: boolean) => number | Date;
719
+ } | {
720
+ name: string[];
721
+ adsDataType: number;
722
+ size: number;
723
+ toBuffer: (value: number | BigInt | Buffer, buffer: Buffer) => void;
724
+ fromBuffer: (buffer: Buffer) => bigint | Buffer;
725
+ })[];
726
+ /**
727
+ * Returns true if given data type is found and known
728
+ *
729
+ * @param {string} name Data type name
730
+ */
731
+ isPseudoType: (name: string) => boolean;
732
+ /**
733
+ * Finds the given pseudo data type from array using regular expressions
734
+ *
735
+ * @param {string} name Pseudo data type name
736
+ */
737
+ findPseudoType: (name: string) => {
738
+ name: string[];
739
+ actualTypesBySize: {
740
+ [k: number]: string;
741
+ };
742
+ } | undefined;
743
+ /**
744
+ * Finds the given pseudo data type from array using regular expressions
745
+ *
746
+ * @param name Pseudo data type name (like PVOID)
747
+ */
748
+ getTypeByPseudoType: (name: string, byteSize: number) => string | undefined;
749
+ /**
750
+ * All pseudo data types and their actual types depending on size
751
+ * Example: XINT is 4 bytes @ 32 bit platform -> DINT
752
+ */
753
+ pseudoTypes: {
754
+ name: string[];
755
+ actualTypesBySize: {
756
+ [k: number]: string;
757
+ };
758
+ }[];
759
+ };
760
+ /**
761
+ * Converts array of bytes (or Buffer) to AmsNetId string, such as 192.168.1.10.1.1
762
+ *
763
+ * @param byteArray Array of bytes or Buffer object
764
+ */
765
+ export declare const byteArrayToAmsNetIdStr: (byteArray: Buffer | number[]) => string;
766
+ /**
767
+ * Converts AmsNetId string (such as 192.168.10.1.1) to array of bytes
768
+ *
769
+ * @param str AmsNetId as string
770
+ */
771
+ export declare const amsNetIdStrToByteArray: (str: string) => number[];
772
+ /**
773
+ * Trims the given PLC string until end mark (\0) is found (removes empty bytes from the end)
774
+ *
775
+ * @param str String to trim
776
+ * @returns Trimmed string
777
+ */
778
+ export declare const trimPlcString: (str: string) => string;
779
+ /**
780
+ * Decodes provided Buffer object to plc STRING using cp1252 encoding.
781
+ * Also removes empty bytes from the end.
782
+ * @param data Buffer data that contains plc STRING
783
+ * @returns
784
+ */
785
+ export declare const decodePlcStringBuffer: (data: Buffer) => string;
786
+ /**
787
+ * Encodes provided string to a Buffer object as plc STRING using cp1252 encoding
788
+ * @param str String to encode
789
+ * @returns
790
+ */
791
+ export declare const encodeStringToPlcStringBuffer: (str: string) => Buffer;
792
+ /**
793
+ * Decodes provided Buffer object to plc WSTRING using ucs2 encoding.
794
+ * Also removes empty bytes from the end.
795
+ * @param data Buffer data that contains plc WSTRING
796
+ * @returns
797
+ */
798
+ export declare const decodePlcWstringBuffer: (data: Buffer) => string;
799
+ /**
800
+ * Encodes provided string to a Buffer object as plc WSTRING using ucs2 encoding
801
+ * @param str String to encode
802
+ * @returns
803
+ */
804
+ export declare const encodeStringToPlcWstringBuffer: (str: string) => Buffer;
805
+ /**
806
+ * Converts given AmsAddress as string of type `amsNetId:port`
807
+ * @param address
808
+ * @returns
809
+ */
810
+ export declare const amsAddressToString: (address: AmsAddress) => string;