pyads-agile Features
This page summarizes the main additions and integrations maintained in the
pyads-agile repository beyond baseline upstream compatibility.
RPC and typing enhancements
Native RPC proxy calls via
pyads.Connection.get_object().Typed RPC interface declarations with
pyads.ads_path(), using PLC type annotations for IntelliSense and signature inference.Manual override support for inferred parameter/return types when needed.
Async runtime and safety
pyads.AsyncConnectionwith a dedicated worker thread per connection.In-order serialized ADS call execution to avoid race conditions on mutable connection state.
submit_*methods returningasyncio.Futureand awaitable async method variants for core operations.
Async wrappers for core ADS APIs
The async layer mirrors the core sync APIs, including:
read,write,read_writeread_by_name,write_by_nameread_structure_by_name,write_structure_by_namesum_read/sum_writeread_state,read_device_info,write_controlget_local_address,get_handle,release_handle,set_timeout
Async RPC and stepchain integration
Async typed RPC proxies via
pyads.AsyncConnection.get_async_object().Async interface decorator for type-safe future-returning methods:
pyads.ads_async_path().Stepchain-aware async interfaces via
pyads.StepChainRpcInterfaceandpyads.stepchain_start().pyads.StepChainOperationwith:acceptedphase (RPC returned)donephase (completion detected via configured status symbols)awaitable operation behavior returning the latest ADS status snapshot (
await op==await op.done)generic transport type extraction via
StepChainOperation[PLCTYPE_*]
Auto-generated request IDs for stepchain methods when the request id argument is omitted.
Default stepchain naming aligned with common TwinCAT conventions:
stStepStatus,udiRequestId,xBusy,xDone,xError,diErrorCode.Built-in stepchain status helper methods on
StepChainRpcInterfaceproxies:status_symbol(),get_status_structure_def(), andread_status().Stepchain completion backends selectable per interface:
completion="poll"orcompletion="notify".
Testing and quality additions
Fake-backend async integration tests (testserver target).
Real-target async integration tests for Beckhoff runtime environments.
Dedicated tests for typed RPC inference, async serialization behavior, and stepchain completion/error paths.