aioads 0.1.0.dev1__tar.gz → 0.1.0.dev3__tar.gz
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.
- {aioads-0.1.0.dev1 → aioads-0.1.0.dev3}/.gitignore +0 -0
- {aioads-0.1.0.dev1 → aioads-0.1.0.dev3}/.vscode/settings.json +0 -0
- aioads-0.1.0.dev3/LICENSE +21 -0
- {aioads-0.1.0.dev1 → aioads-0.1.0.dev3}/PKG-INFO +26 -67
- {aioads-0.1.0.dev1 → aioads-0.1.0.dev3}/README.md +20 -65
- {aioads-0.1.0.dev1 → aioads-0.1.0.dev3}/aioads/ads_client.py +0 -0
- {aioads-0.1.0.dev1 → aioads-0.1.0.dev3}/aioads/ads_error_codes.py +0 -0
- {aioads-0.1.0.dev1 → aioads-0.1.0.dev3}/aioads/ads_notifications.py +0 -0
- {aioads-0.1.0.dev1 → aioads-0.1.0.dev3}/aioads/ads_symbol_cache.py +0 -0
- {aioads-0.1.0.dev1 → aioads-0.1.0.dev3}/aioads/ads_symbol_parser.py +2 -0
- {aioads-0.1.0.dev1 → aioads-0.1.0.dev3}/aioads/ams_address.py +0 -0
- {aioads-0.1.0.dev1 → aioads-0.1.0.dev3}/aioads/ams_header.py +0 -0
- {aioads-0.1.0.dev1 → aioads-0.1.0.dev3}/aioads/ams_tcp_header.py +0 -0
- {aioads-0.1.0.dev1 → aioads-0.1.0.dev3}/aioads/commands/ads_add_notification.py +0 -0
- {aioads-0.1.0.dev1 → aioads-0.1.0.dev3}/aioads/commands/ads_command.py +0 -0
- {aioads-0.1.0.dev1 → aioads-0.1.0.dev3}/aioads/commands/ads_delete_notification.py +0 -0
- {aioads-0.1.0.dev1 → aioads-0.1.0.dev3}/aioads/commands/ads_read.py +0 -0
- {aioads-0.1.0.dev1 → aioads-0.1.0.dev3}/aioads/commands/ads_read_device_info.py +0 -0
- {aioads-0.1.0.dev1 → aioads-0.1.0.dev3}/aioads/commands/ads_read_state.py +0 -0
- {aioads-0.1.0.dev1 → aioads-0.1.0.dev3}/aioads/commands/ads_read_write.py +0 -0
- {aioads-0.1.0.dev1 → aioads-0.1.0.dev3}/aioads/commands/ads_write.py +0 -0
- {aioads-0.1.0.dev1 → aioads-0.1.0.dev3}/aioads/commands/ads_write_state.py +0 -0
- {aioads-0.1.0.dev1 → aioads-0.1.0.dev3}/aioads/commands/errors.py +0 -0
- {aioads-0.1.0.dev1 → aioads-0.1.0.dev3}/aioads/errors.py +0 -0
- {aioads-0.1.0.dev1 → aioads-0.1.0.dev3}/aioads/functions/ads_enable_route.py +0 -0
- {aioads-0.1.0.dev1 → aioads-0.1.0.dev3}/aioads/functions/ads_function.py +0 -0
- {aioads-0.1.0.dev1 → aioads-0.1.0.dev3}/aioads/functions/ads_sum_read.py +0 -0
- {aioads-0.1.0.dev1 → aioads-0.1.0.dev3}/aioads/functions/ads_sum_read_write.py +0 -0
- {aioads-0.1.0.dev1 → aioads-0.1.0.dev3}/aioads/functions/ads_symbol_datatype_by_name.py +0 -0
- {aioads-0.1.0.dev1 → aioads-0.1.0.dev3}/aioads/functions/ads_symbol_datatype_upload.py +0 -0
- {aioads-0.1.0.dev1 → aioads-0.1.0.dev3}/aioads/functions/ads_symbol_info_by_name_ex.py +0 -0
- {aioads-0.1.0.dev1 → aioads-0.1.0.dev3}/aioads/functions/ads_symbol_table_version.py +0 -0
- {aioads-0.1.0.dev1 → aioads-0.1.0.dev3}/aioads/functions/ads_symbol_upload.py +0 -0
- {aioads-0.1.0.dev1 → aioads-0.1.0.dev3}/aioads/functions/ads_symbol_upload_info.py +0 -0
- {aioads-0.1.0.dev1 → aioads-0.1.0.dev3}/aioads/stream.py +0 -0
- {aioads-0.1.0.dev1 → aioads-0.1.0.dev3}/aioads/transport.py +363 -89
- {aioads-0.1.0.dev1 → aioads-0.1.0.dev3}/aioads/utils/local_ip.py +0 -0
- {aioads-0.1.0.dev1 → aioads-0.1.0.dev3}/docs/transmission_mode.md +0 -0
- {aioads-0.1.0.dev1 → aioads-0.1.0.dev3}/examples/read_cmd_reuse_mqtt.py +2 -2
- {aioads-0.1.0.dev1 → aioads-0.1.0.dev3}/examples/read_cycles.py +0 -0
- {aioads-0.1.0.dev1 → aioads-0.1.0.dev3}/examples/read_cycles_mqtt.py +2 -2
- {aioads-0.1.0.dev1 → aioads-0.1.0.dev3}/examples/read_multiple.py +0 -0
- {aioads-0.1.0.dev1 → aioads-0.1.0.dev3}/examples/read_multiple_mqtt.py +2 -2
- {aioads-0.1.0.dev1 → aioads-0.1.0.dev3}/examples/read_single.py +0 -0
- {aioads-0.1.0.dev1 → aioads-0.1.0.dev3}/pdm.lock +96 -85
- {aioads-0.1.0.dev1 → aioads-0.1.0.dev3}/pyproject.toml +6 -2
- {aioads-0.1.0.dev1 → aioads-0.1.0.dev3}/tests/__init__.py +0 -0
- aioads-0.1.0.dev1/docs/secure_ads.md +0 -489
|
File without changes
|
|
File without changes
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
MIT License
|
|
2
|
+
|
|
3
|
+
Copyright (c) 2026 MkKiefer
|
|
4
|
+
|
|
5
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
6
|
+
of this software and associated documentation files (the "Software"), to deal
|
|
7
|
+
in the Software without restriction, including without limitation the rights
|
|
8
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
9
|
+
copies of the Software, and to permit persons to whom the Software is
|
|
10
|
+
furnished to do so, subject to the following conditions:
|
|
11
|
+
|
|
12
|
+
The above copyright notice and this permission notice shall be included in all
|
|
13
|
+
copies or substantial portions of the Software.
|
|
14
|
+
|
|
15
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
16
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
17
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
18
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
19
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
20
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
21
|
+
SOFTWARE.
|
|
@@ -1,11 +1,15 @@
|
|
|
1
1
|
Metadata-Version: 2.4
|
|
2
2
|
Name: aioads
|
|
3
|
-
Version: 0.1.0.
|
|
3
|
+
Version: 0.1.0.dev3
|
|
4
4
|
Summary: An asynchronous Python library for communicating with Beckhoff TwinCAT PLCs
|
|
5
5
|
Author-email: MkKiefer <102972583+MkKiefer@users.noreply.github.com>
|
|
6
6
|
License: MIT
|
|
7
|
+
License-File: LICENSE
|
|
7
8
|
Requires-Python: >=3.12
|
|
8
|
-
|
|
9
|
+
Provides-Extra: aiomqtt
|
|
10
|
+
Requires-Dist: aiomqtt>=v3.0.0-alpha.1; extra == 'aiomqtt'
|
|
11
|
+
Provides-Extra: gmqtt
|
|
12
|
+
Requires-Dist: gmqtt>=0.7.0; extra == 'gmqtt'
|
|
9
13
|
Description-Content-Type: text/markdown
|
|
10
14
|
|
|
11
15
|
# AIOADS - Asynchronous ADS Library for Python
|
|
@@ -26,9 +30,18 @@ An asynchronous Python library for communicating with Beckhoff TwinCAT PLCs usin
|
|
|
26
30
|
## Installation
|
|
27
31
|
|
|
28
32
|
```bash
|
|
33
|
+
# Ads TCP
|
|
29
34
|
pdm add aioads
|
|
30
|
-
|
|
31
35
|
pip install aioads
|
|
36
|
+
|
|
37
|
+
# ADS over MQTT (gmqtt)
|
|
38
|
+
pdm add aioads[gmqtt]
|
|
39
|
+
pip install aioads[gmqtt]
|
|
40
|
+
|
|
41
|
+
# Ads over MQTT (aiomqtt)
|
|
42
|
+
pdm add aioads[aiomqtt]
|
|
43
|
+
pip install aioads[aiomqtt]
|
|
44
|
+
|
|
32
45
|
```
|
|
33
46
|
|
|
34
47
|
## Quick Start
|
|
@@ -194,11 +207,11 @@ async def main():
|
|
|
194
207
|
|
|
195
208
|
The library supports all major ADS commands:
|
|
196
209
|
|
|
197
|
-
- **Read/Write Operations**: Single and batch
|
|
210
|
+
- **Read/Write Operations**: Single and batch
|
|
198
211
|
- **Device Information**: State, version, and device info
|
|
199
212
|
- **Symbol Management**: Symbol table upload and parsing
|
|
200
213
|
- **Data Types**: Complete data type information and parsing
|
|
201
|
-
- **Notifications**: Change and cyclic notifications
|
|
214
|
+
- **Notifications**: Change and cyclic notifications (Still in preview)
|
|
202
215
|
- **Sum Commands**: Efficient bulk operations
|
|
203
216
|
|
|
204
217
|
### Data Types
|
|
@@ -210,75 +223,23 @@ Full support for TwinCAT data types:
|
|
|
210
223
|
- **Complex Types**: Custom user-defined types
|
|
211
224
|
- **Arrays**: Multi-dimensional arrays with proper indexing
|
|
212
225
|
|
|
213
|
-
### Notification Modes
|
|
214
|
-
|
|
215
|
-
Multiple notification transmission modes supported:
|
|
216
|
-
|
|
217
|
-
| Mode | Description | Use Case |
|
|
218
|
-
| ------------------- | --------------------------- | ----------------------- |
|
|
219
|
-
| `ClientCycle` | Client-triggered periodic | Reduced server load |
|
|
220
|
-
| `ClientOnChange` | Client-triggered on change | Reduced server load |
|
|
221
|
-
| `Cyclic` | Server-side periodic | Real-time performance |
|
|
222
|
-
| `OnChange` | Server-side on change | Immediate notifications |
|
|
223
|
-
| `CyclicInContext` | Task-synchronized periodic | Task coordination |
|
|
224
|
-
| `OnChangeInContext` | Task-synchronized on change | Task coordination |
|
|
225
|
-
|
|
226
|
-
## Project Structure
|
|
227
|
-
|
|
228
|
-
```
|
|
229
|
-
aioads/
|
|
230
|
-
├── ads_client.py # Main client interface
|
|
231
|
-
├── tcp_transport.py # TCP transport layer
|
|
232
|
-
├── ads_symbol_cache.py # Symbol caching system
|
|
233
|
-
├── ads_symbol_parser.py # Symbol data parsing
|
|
234
|
-
├── ams_address.py # AMS addressing
|
|
235
|
-
├── ams_header.py # AMS protocol headers
|
|
236
|
-
├── commands/ # ADS command implementations
|
|
237
|
-
│ ├── ads_read.py
|
|
238
|
-
│ ├── ads_write.py
|
|
239
|
-
│ ├── ads_read_state.py
|
|
240
|
-
│ └── ...
|
|
241
|
-
├── functions/ # ADS function implementations
|
|
242
|
-
│ ├── ads_sum_read.py
|
|
243
|
-
│ ├── ads_symbol_upload.py
|
|
244
|
-
│ └── ...
|
|
245
|
-
└── utils/ # Utility functions
|
|
246
|
-
└── async_zip.py
|
|
247
|
-
```
|
|
248
|
-
|
|
249
|
-
## Examples
|
|
250
|
-
|
|
251
|
-
Check the `examples/` directory for complete usage examples:
|
|
252
|
-
|
|
253
|
-
- `read_cycles.py` - Basic single symbol reading
|
|
254
|
-
- `read_multiple.py` - Batch reading
|
|
255
226
|
|
|
256
227
|
## Requirements
|
|
257
228
|
|
|
258
229
|
- Python 3.11+
|
|
259
230
|
- asyncio
|
|
260
|
-
-
|
|
261
|
-
|
|
262
|
-
## Performance
|
|
231
|
+
- aiomqtt (optional)
|
|
263
232
|
|
|
264
|
-
The library is optimized for high-performance scenarios:
|
|
265
233
|
|
|
266
|
-
|
|
267
|
-
- **Smart Caching**: Symbol information cached to avoid repeated lookups
|
|
268
|
-
- **Async Architecture**: Non-blocking I/O for maximum throughput
|
|
234
|
+
## Disclaimer
|
|
269
235
|
|
|
270
|
-
|
|
271
|
-
|
|
272
|
-
- Batch reads (100+ symbols): ~10-50ms
|
|
236
|
+
This project is an independent, open‑source implementation of the ADS (Automation Device Specification) protocol. It is not affiliated with, endorsed by, or supported by Beckhoff Automation GmbH & Co. KG, the developer of TwinCAT and the ADS protocol.
|
|
237
|
+
All trademarks and product names are the property of their respective owners.
|
|
273
238
|
|
|
274
239
|
## License
|
|
275
240
|
|
|
276
241
|
This project is licensed under the MIT License - see the LICENSE file for details.
|
|
277
242
|
|
|
278
|
-
## Contributing
|
|
279
|
-
|
|
280
|
-
Contributions are welcome! Please feel free to submit a Pull Request.
|
|
281
|
-
|
|
282
243
|
## Troubleshooting
|
|
283
244
|
|
|
284
245
|
### Connection Issues
|
|
@@ -291,12 +252,10 @@ Contributions are welcome! Please feel free to submit a Pull Request.
|
|
|
291
252
|
|
|
292
253
|
1. **PLC State**: Ensure PLC is in RUN mode for symbol access
|
|
293
254
|
|
|
294
|
-
### Performance Issues
|
|
295
255
|
|
|
296
|
-
|
|
297
|
-
2. **Caching**: Pre-load symbol info with `read_symbol_infos_by_names()`
|
|
298
|
-
3. **Concurrent Tasks**: Be mindful of PLC load with multiple tasks
|
|
256
|
+
## Contributing guidelines
|
|
299
257
|
|
|
300
|
-
|
|
258
|
+
AIOADS is a personal hobby project, developed and maintained in my spare time.
|
|
259
|
+
While I aim to keep it functional and improve it over time, it may not always receive frequent updates, and features or bug fixes might take a while.
|
|
301
260
|
|
|
302
|
-
|
|
261
|
+
If you rely on this library in production environments, consider reviewing the code, contributing improvements, or opening issues so the community can help keep it healthy.
|
|
@@ -16,9 +16,18 @@ An asynchronous Python library for communicating with Beckhoff TwinCAT PLCs usin
|
|
|
16
16
|
## Installation
|
|
17
17
|
|
|
18
18
|
```bash
|
|
19
|
+
# Ads TCP
|
|
19
20
|
pdm add aioads
|
|
20
|
-
|
|
21
21
|
pip install aioads
|
|
22
|
+
|
|
23
|
+
# ADS over MQTT (gmqtt)
|
|
24
|
+
pdm add aioads[gmqtt]
|
|
25
|
+
pip install aioads[gmqtt]
|
|
26
|
+
|
|
27
|
+
# Ads over MQTT (aiomqtt)
|
|
28
|
+
pdm add aioads[aiomqtt]
|
|
29
|
+
pip install aioads[aiomqtt]
|
|
30
|
+
|
|
22
31
|
```
|
|
23
32
|
|
|
24
33
|
## Quick Start
|
|
@@ -184,11 +193,11 @@ async def main():
|
|
|
184
193
|
|
|
185
194
|
The library supports all major ADS commands:
|
|
186
195
|
|
|
187
|
-
- **Read/Write Operations**: Single and batch
|
|
196
|
+
- **Read/Write Operations**: Single and batch
|
|
188
197
|
- **Device Information**: State, version, and device info
|
|
189
198
|
- **Symbol Management**: Symbol table upload and parsing
|
|
190
199
|
- **Data Types**: Complete data type information and parsing
|
|
191
|
-
- **Notifications**: Change and cyclic notifications
|
|
200
|
+
- **Notifications**: Change and cyclic notifications (Still in preview)
|
|
192
201
|
- **Sum Commands**: Efficient bulk operations
|
|
193
202
|
|
|
194
203
|
### Data Types
|
|
@@ -200,75 +209,23 @@ Full support for TwinCAT data types:
|
|
|
200
209
|
- **Complex Types**: Custom user-defined types
|
|
201
210
|
- **Arrays**: Multi-dimensional arrays with proper indexing
|
|
202
211
|
|
|
203
|
-
### Notification Modes
|
|
204
|
-
|
|
205
|
-
Multiple notification transmission modes supported:
|
|
206
|
-
|
|
207
|
-
| Mode | Description | Use Case |
|
|
208
|
-
| ------------------- | --------------------------- | ----------------------- |
|
|
209
|
-
| `ClientCycle` | Client-triggered periodic | Reduced server load |
|
|
210
|
-
| `ClientOnChange` | Client-triggered on change | Reduced server load |
|
|
211
|
-
| `Cyclic` | Server-side periodic | Real-time performance |
|
|
212
|
-
| `OnChange` | Server-side on change | Immediate notifications |
|
|
213
|
-
| `CyclicInContext` | Task-synchronized periodic | Task coordination |
|
|
214
|
-
| `OnChangeInContext` | Task-synchronized on change | Task coordination |
|
|
215
|
-
|
|
216
|
-
## Project Structure
|
|
217
|
-
|
|
218
|
-
```
|
|
219
|
-
aioads/
|
|
220
|
-
├── ads_client.py # Main client interface
|
|
221
|
-
├── tcp_transport.py # TCP transport layer
|
|
222
|
-
├── ads_symbol_cache.py # Symbol caching system
|
|
223
|
-
├── ads_symbol_parser.py # Symbol data parsing
|
|
224
|
-
├── ams_address.py # AMS addressing
|
|
225
|
-
├── ams_header.py # AMS protocol headers
|
|
226
|
-
├── commands/ # ADS command implementations
|
|
227
|
-
│ ├── ads_read.py
|
|
228
|
-
│ ├── ads_write.py
|
|
229
|
-
│ ├── ads_read_state.py
|
|
230
|
-
│ └── ...
|
|
231
|
-
├── functions/ # ADS function implementations
|
|
232
|
-
│ ├── ads_sum_read.py
|
|
233
|
-
│ ├── ads_symbol_upload.py
|
|
234
|
-
│ └── ...
|
|
235
|
-
└── utils/ # Utility functions
|
|
236
|
-
└── async_zip.py
|
|
237
|
-
```
|
|
238
|
-
|
|
239
|
-
## Examples
|
|
240
|
-
|
|
241
|
-
Check the `examples/` directory for complete usage examples:
|
|
242
|
-
|
|
243
|
-
- `read_cycles.py` - Basic single symbol reading
|
|
244
|
-
- `read_multiple.py` - Batch reading
|
|
245
212
|
|
|
246
213
|
## Requirements
|
|
247
214
|
|
|
248
215
|
- Python 3.11+
|
|
249
216
|
- asyncio
|
|
250
|
-
-
|
|
251
|
-
|
|
252
|
-
## Performance
|
|
217
|
+
- aiomqtt (optional)
|
|
253
218
|
|
|
254
|
-
The library is optimized for high-performance scenarios:
|
|
255
219
|
|
|
256
|
-
|
|
257
|
-
- **Smart Caching**: Symbol information cached to avoid repeated lookups
|
|
258
|
-
- **Async Architecture**: Non-blocking I/O for maximum throughput
|
|
220
|
+
## Disclaimer
|
|
259
221
|
|
|
260
|
-
|
|
261
|
-
|
|
262
|
-
- Batch reads (100+ symbols): ~10-50ms
|
|
222
|
+
This project is an independent, open‑source implementation of the ADS (Automation Device Specification) protocol. It is not affiliated with, endorsed by, or supported by Beckhoff Automation GmbH & Co. KG, the developer of TwinCAT and the ADS protocol.
|
|
223
|
+
All trademarks and product names are the property of their respective owners.
|
|
263
224
|
|
|
264
225
|
## License
|
|
265
226
|
|
|
266
227
|
This project is licensed under the MIT License - see the LICENSE file for details.
|
|
267
228
|
|
|
268
|
-
## Contributing
|
|
269
|
-
|
|
270
|
-
Contributions are welcome! Please feel free to submit a Pull Request.
|
|
271
|
-
|
|
272
229
|
## Troubleshooting
|
|
273
230
|
|
|
274
231
|
### Connection Issues
|
|
@@ -281,12 +238,10 @@ Contributions are welcome! Please feel free to submit a Pull Request.
|
|
|
281
238
|
|
|
282
239
|
1. **PLC State**: Ensure PLC is in RUN mode for symbol access
|
|
283
240
|
|
|
284
|
-
### Performance Issues
|
|
285
241
|
|
|
286
|
-
|
|
287
|
-
2. **Caching**: Pre-load symbol info with `read_symbol_infos_by_names()`
|
|
288
|
-
3. **Concurrent Tasks**: Be mindful of PLC load with multiple tasks
|
|
242
|
+
## Contributing guidelines
|
|
289
243
|
|
|
290
|
-
|
|
244
|
+
AIOADS is a personal hobby project, developed and maintained in my spare time.
|
|
245
|
+
While I aim to keep it functional and improve it over time, it may not always receive frequent updates, and features or bug fixes might take a while.
|
|
291
246
|
|
|
292
|
-
|
|
247
|
+
If you rely on this library in production environments, consider reviewing the code, contributing improvements, or opening issues so the community can help keep it healthy.
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
@@ -67,6 +67,8 @@ class PrimitiveTypeParser(ISymbolParser):
|
|
|
67
67
|
|
|
68
68
|
def parse(self, data_type: AdsSymbolDataType, type_name: str, raw_data: AdsStream) -> Any:
|
|
69
69
|
"""Parse a primitive data type."""
|
|
70
|
+
if data_type == AdsSymbolDataType.VOID:
|
|
71
|
+
return None
|
|
70
72
|
if data_type == AdsSymbolDataType.STRING:
|
|
71
73
|
return self._parse_string(type_name, raw_data)
|
|
72
74
|
if data_type == AdsSymbolDataType.WSTRING:
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|