ads/
index.rs

1//! Well-known ADS index groups.
2//!
3//! These are defined
4//! [here](https://infosys.beckhoff.com/content/1033/tc3_ads_intro/117241867.html?id=1944752650545554679)
5//! and [here](https://github.com/Beckhoff/ADS/blob/master/AdsLib/standalone/AdsDef.h).
6
7// Unfortunately, not all those constants are documented.
8#![allow(missing_docs)]
9
10/// PLC: Read/write PLC memory (%M fields).
11pub const PLC_RW_M: u32 = 0x4020;
12/// PLC: Read/write PLC memory as bits (%MX fields).  Offset is (byte*8 + bit) address.
13pub const PLC_RW_MX: u32 = 0x4021;
14/// PLC: Read byte length of %M area (only offset 0).
15pub const PLC_SIZE_M: u32 = 0x4025;
16/// PLC: Read/write retain data area.
17pub const PLC_RW_RB: u32 = 0x4030;
18/// PLC: Read byte length of the retain data area (only offset 0).
19pub const PLC_SIZE_RB: u32 = 0x4035;
20/// PLC: Read/write data area.
21pub const PLC_RW_DB: u32 = 0x4040;
22/// PLC: Read byte length of data area (only offset 0).
23pub const PLC_SIZE_DB: u32 = 0x4045;
24
25/// Get u32 handle to the name in the write data.  Index offset is 0.
26/// Use with a `write_read` transaction.
27pub const GET_SYMHANDLE_BYNAME: u32 = 0xF003;
28/// Read/write data for a symbol by handle.
29/// Use the handle as the index offset.
30pub const RW_SYMVAL_BYHANDLE: u32 = 0xF005;
31/// Release a symbol handle.  Index offset is 0.
32pub const RELEASE_SYMHANDLE: u32 = 0xF006;
33
34// undocumented; from AdsDef.h
35pub const SYMTAB: u32 = 0xF000;
36pub const SYMNAME: u32 = 0xF001;
37pub const SYMVAL: u32 = 0xF002;
38pub const GET_SYMVAL_BYNAME: u32 = 0xF004;
39pub const GET_SYMINFO_BYNAME: u32 = 0xF007;
40pub const GET_SYMVERSION: u32 = 0xF008;
41pub const GET_SYMINFO_BYNAME_EX: u32 = 0xF009;
42pub const SYM_DOWNLOAD: u32 = 0xF00A;
43pub const SYM_UPLOAD: u32 = 0xF00B;
44pub const SYM_UPLOAD_INFO: u32 = 0xF00C;
45pub const SYM_DOWNLOAD2: u32 = 0xF00D;
46pub const SYM_DT_UPLOAD: u32 = 0xF00E;
47pub const SYM_UPLOAD_INFO2: u32 = 0xF00F;
48pub const SYM_NOTE: u32 = 0xF010;
49
50/// Read/write process image of physical inputs (%I fields).
51pub const IO_RW_I: u32 = 0xF020;
52/// Read/write process image of physical inputs as bits (%IX fields).
53pub const IO_RW_IX: u32 = 0xF021;
54/// Read byte length of the physical inputs (only offset 0).
55pub const IO_SIZE_I: u32 = 0xF025;
56
57/// Read/write process image of physical outputs (%Q fields).
58pub const IO_RW_Q: u32 = 0xF030;
59/// Read/write process image of physical outputs as bits (%QX fields).
60pub const IO_RW_QX: u32 = 0xF031;
61/// Read byte length of the physical outputs (only offset 0).
62pub const IO_SIZE_Q: u32 = 0xF035;
63
64pub const IO_CLEAR_I: u32 = 0xF040;
65pub const IO_CLEAR_O: u32 = 0xF050;
66pub const IO_RW_IOB: u32 = 0xF060;
67
68/// Combine multiple index group/offset reads.
69/// See Beckhoff docs for the format of the data.
70pub const SUMUP_READ: u32 = 0xF080;
71/// Combine multiple index group/offset writes.
72/// See Beckhoff docs for the format of the data.
73pub const SUMUP_WRITE: u32 = 0xF081;
74/// Combine multiple index group/offset write+reads.
75/// See Beckhoff docs for the format of the data.
76pub const SUMUP_READWRITE: u32 = 0xF082;
77/// Combine multiple index group/offset reads.
78/// See Beckhoff docs for the format of the data.
79pub const SUMUP_READ_EX: u32 = 0xF083;
80/// Combine multiple index group/offset reads.
81/// See Beckhoff docs for the format of the data.
82pub const SUMUP_READ_EX_2: u32 = 0xF084;
83/// Combine multiple device notification adds.
84/// See Beckhoff docs for the format of the data.
85pub const SUMUP_ADDDEVNOTE: u32 = 0xF085;
86/// Combine multiple device notification deletes.
87/// See Beckhoff docs for the format of the data.
88pub const SUMUP_DELDEVNOTE: u32 = 0xF086;
89
90pub const DEVICE_DATA: u32 = 0xF100;
91
92/// File service: open a file.
93pub const FILE_OPEN: u32 = 120;
94/// File service: close an open file.
95pub const FILE_CLOSE: u32 = 121;
96/// File service: read from an open file.
97pub const FILE_READ: u32 = 122;
98/// File service: write to an open file.
99pub const FILE_WRITE: u32 = 123;
100/// File service: delete a file.
101pub const FILE_DELETE: u32 = 131;
102/// File service: browse files.
103pub const FILE_BROWSE: u32 = 133;
104
105/// Index group for target desc query.
106pub const TARGET_DESC: u32 = 0x2bc;
107
108/// Index group for license queries.
109pub const LICENSE: u32 = 0x0101_0004;
110pub const LICENSE_MODULES: u32 = 0x0101_0006;
111
112// Diverse officially undocumented ports, used with the system service.
113pub const WIN_REGISTRY: u32 = 200;
114pub const EXECUTE: u32 = 500;
115pub const TC_TARGET_XML: u32 = 700;
116pub const ROUTE_ADD: u32 = 801;
117pub const ROUTE_REMOVE: u32 = 802;
118pub const ROUTE_LIST: u32 = 803;