Skip to main content

Agile-maintained Python wrapper for the TwinCAT ADS library, based on pyads

Project description

pyads-agile

pyads-agile is a Python wrapper for the Beckhoff TwinCAT ADS library.

This distribution is maintained by Agile Automation Technologies GmbH and is based on the excellent upstream pyads project created by Stefan Lehmann: https://github.com/stlehmann/pyads

pyads-agile intentionally stays drop-in compatible with pyads. The public API, module name (import pyads), and supported interpreter/OS matrix mirror upstream, so existing applications can switch distributions without code changes. Current validated support target is Python 3.13 (CI runs on 3.13).

Attribution

  • Original project: pyads by Stefan Lehmann
  • Fork maintainer: Filippo Boido filippo.boido@agileautomation.eu (Agile Automation Technologies GmbH)
  • License: MIT
  • This repository keeps upstream credit and license notices as required

See ACKNOWLEDGMENTS.md for details.

Installation

Install the distribution:

pip install pyads-agile

Import stays compatible:

import pyads

Versioning

pyads-agile uses its own independent Semantic Versioning (MAJOR.MINOR.PATCH). It does not mirror upstream pyads version numbers.

Scope

This package provides Python APIs for communicating with TwinCAT devices using:

  • TcAdsDll.dll on Windows
  • adslib.so on Linux

Agile-specific enhancements

Beyond compatibility, this fork currently focuses on improved RPC ergonomics:

  • Convenient RPC object proxies. Connection.get_object() exposes TwinCAT function blocks as Python objects and lets you configure return and parameter types per method:

    TwinCAT requirement: each callable method must be annotated in PLC code with {attribute 'TcRpcEnable'} directly above the method declaration.

    rpc = plc.get_object(
        "GVL.fbTestRemoteMethodCall",
        method_return_types={"m_iSimpleCall": pyads.PLCTYPE_INT},
    )
    result = rpc.m_iSimpleCall()
    
  • Multi-parameter RPC calls with native syntax. Configure method signatures once and then call methods like normal Python methods:

    rpc = plc.get_object(
        "GVL.fbTestRemoteMethodCall",
        method_return_types={"m_iSum": pyads.PLCTYPE_INT},
        method_parameters={"m_iSum": [pyads.PLCTYPE_INT, pyads.PLCTYPE_INT]},
    )
    result = rpc.m_iSum(5, 5)
    
  • Typed RPC interfaces for IntelliSense. Decorate a Python class with @pyads.ads_path("GVL.fbTestRemoteMethodCall"), annotate method arguments and return types with TwinCAT PLC types, and pass the class into Connection.get_object. The returned proxy is typed as your class so IDEs can offer completions:

    @pyads.ads_path("GVL.fbTestRemoteMethodCall")
    class FB_TestRemoteMethodCall:
        def m_iSum(
            self,
            a: pyads.PLCTYPE_INT,
            b: pyads.PLCTYPE_INT,
        ) -> pyads.PLCTYPE_INT:
            ...
    
    rpc = plc.get_object(FB_TestRemoteMethodCall)
    result = rpc.m_iSum(5, 5)
    

    You can still use low-level direct calls when needed:

    result = plc.call_rpc_method(
        "GVL.fbTestRemoteMethodCall#m_iSimpleCall",
        return_type=pyads.PLCTYPE_INT,
        write_value=42,
        write_type=pyads.PLCTYPE_INT,
    )
    

Features

  • connect to remote TwinCAT devices
  • create routes on Linux and on remote PLCs
  • support for TwinCAT 2 and TwinCAT 3
  • read and write values by name or by address
  • read and write DUTs (structures)
  • notification callbacks

Basic usage

import pyads

plc = pyads.Connection("127.0.0.1.1.1", pyads.PORT_TC3PLC1)
plc.open()
i = plc.read_by_name("GVL.int_val")
plc.write_by_name("GVL.int_val", i)
plc.close()

Contribution Policy

This repository is maintained on a best-effort basis for internal and product needs.

At this time, we do not accept unsolicited pull requests, and we may not be able to respond to feature requests or general support issues.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

pyads_agile-0.2.0.tar.gz (289.8 kB view details)

Uploaded Source

Built Distributions

If you're not sure about the file name format, learn more about wheel file names.

pyads_agile-0.2.0-py3-none-win_arm64.whl (82.9 kB view details)

Uploaded Python 3Windows ARM64

pyads_agile-0.2.0-py3-none-win_amd64.whl (82.9 kB view details)

Uploaded Python 3Windows x86-64

pyads_agile-0.2.0-py3-none-win32.whl (82.9 kB view details)

Uploaded Python 3Windows x86

pyads_agile-0.2.0-py3-none-manylinux_2_24_x86_64.manylinux_2_28_x86_64.whl (247.5 kB view details)

Uploaded Python 3manylinux: glibc 2.24+ x86-64manylinux: glibc 2.28+ x86-64

pyads_agile-0.2.0-py3-none-manylinux_2_24_aarch64.manylinux_2_28_aarch64.whl (225.8 kB view details)

Uploaded Python 3manylinux: glibc 2.24+ ARM64manylinux: glibc 2.28+ ARM64

pyads_agile-0.2.0-py3-none-macosx_11_0_arm64.whl (177.9 kB view details)

Uploaded Python 3macOS 11.0+ ARM64

pyads_agile-0.2.0-py3-none-macosx_10_15_x86_64.whl (183.8 kB view details)

Uploaded Python 3macOS 10.15+ x86-64

File details

Details for the file pyads_agile-0.2.0.tar.gz.

File metadata

  • Download URL: pyads_agile-0.2.0.tar.gz
  • Upload date:
  • Size: 289.8 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.7

File hashes

Hashes for pyads_agile-0.2.0.tar.gz
Algorithm Hash digest
SHA256 869e4d1f5734700062e995970ea50ad316c913e02a9098685431c17281e4b485
MD5 dfff7dbfd24e3c237e452c37569a5ae4
BLAKE2b-256 060cb420a57074e7e67f106331a248398f62be8a749eddd134cb82f8b9d30d65

See more details on using hashes here.

Provenance

The following attestation bundles were made for pyads_agile-0.2.0.tar.gz:

Publisher: python-publish.yml on AgileAutomationTechnologies/pyads-agile

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file pyads_agile-0.2.0-py3-none-win_arm64.whl.

File metadata

  • Download URL: pyads_agile-0.2.0-py3-none-win_arm64.whl
  • Upload date:
  • Size: 82.9 kB
  • Tags: Python 3, Windows ARM64
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.7

File hashes

Hashes for pyads_agile-0.2.0-py3-none-win_arm64.whl
Algorithm Hash digest
SHA256 e2f5b5109cc7966404f67b8c7778476de4dc0f43bf708931048ba60def3cf5a2
MD5 1d1efc7f5ee772263d0632b8812e44ee
BLAKE2b-256 2bfe1dd8f62d6f8d82dc085c9c69c7b578ae2ab9738ee0d339a72e4af240c1cf

See more details on using hashes here.

Provenance

The following attestation bundles were made for pyads_agile-0.2.0-py3-none-win_arm64.whl:

Publisher: python-publish.yml on AgileAutomationTechnologies/pyads-agile

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file pyads_agile-0.2.0-py3-none-win_amd64.whl.

File metadata

  • Download URL: pyads_agile-0.2.0-py3-none-win_amd64.whl
  • Upload date:
  • Size: 82.9 kB
  • Tags: Python 3, Windows x86-64
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.7

File hashes

Hashes for pyads_agile-0.2.0-py3-none-win_amd64.whl
Algorithm Hash digest
SHA256 1b68172c51370e44f546e6dde613cc712b92727e22b0d6228b20d1f38a252f60
MD5 a7f0ed22e528af61c5aeb0f4a0cfec8b
BLAKE2b-256 c8b5d1545382a927e01250a72ae9ebcf2379986bacf31c19e63563b493280c46

See more details on using hashes here.

Provenance

The following attestation bundles were made for pyads_agile-0.2.0-py3-none-win_amd64.whl:

Publisher: python-publish.yml on AgileAutomationTechnologies/pyads-agile

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file pyads_agile-0.2.0-py3-none-win32.whl.

File metadata

  • Download URL: pyads_agile-0.2.0-py3-none-win32.whl
  • Upload date:
  • Size: 82.9 kB
  • Tags: Python 3, Windows x86
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.7

File hashes

Hashes for pyads_agile-0.2.0-py3-none-win32.whl
Algorithm Hash digest
SHA256 3d56431347659a13f127717e3865e0d3e05b893d7856f018c0d851ed3e252a06
MD5 eaadf249b9678f0ec047f926b9285474
BLAKE2b-256 dd69a80f7c7b55cd336832e1b25c1a563666d953da558ab7573595c6c237e238

See more details on using hashes here.

Provenance

The following attestation bundles were made for pyads_agile-0.2.0-py3-none-win32.whl:

Publisher: python-publish.yml on AgileAutomationTechnologies/pyads-agile

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file pyads_agile-0.2.0-py3-none-manylinux_2_24_x86_64.manylinux_2_28_x86_64.whl.

File metadata

File hashes

Hashes for pyads_agile-0.2.0-py3-none-manylinux_2_24_x86_64.manylinux_2_28_x86_64.whl
Algorithm Hash digest
SHA256 6fc5b5f5e5cf77e2253452638439e0879f5b45088f3b93eb5daef12712c6a81e
MD5 6a1a3db14703c8f83482736a691f6a26
BLAKE2b-256 b1723cfca6dd5c8be4c8fef4dde0a5dd19f30833b32bba21b9c49954bbfb8266

See more details on using hashes here.

Provenance

The following attestation bundles were made for pyads_agile-0.2.0-py3-none-manylinux_2_24_x86_64.manylinux_2_28_x86_64.whl:

Publisher: python-publish.yml on AgileAutomationTechnologies/pyads-agile

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file pyads_agile-0.2.0-py3-none-manylinux_2_24_aarch64.manylinux_2_28_aarch64.whl.

File metadata

File hashes

Hashes for pyads_agile-0.2.0-py3-none-manylinux_2_24_aarch64.manylinux_2_28_aarch64.whl
Algorithm Hash digest
SHA256 23be0c36be05a4b918f4a3905c82adf4535bfcb8995515fbbff52a674000d5ef
MD5 9d9a56c5b8a1d0d34c035bd345dd4fcf
BLAKE2b-256 0c088bb0586adbed52db40e77e4a5314b40fa3ee313c9fc079a0be85a5602554

See more details on using hashes here.

Provenance

The following attestation bundles were made for pyads_agile-0.2.0-py3-none-manylinux_2_24_aarch64.manylinux_2_28_aarch64.whl:

Publisher: python-publish.yml on AgileAutomationTechnologies/pyads-agile

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file pyads_agile-0.2.0-py3-none-macosx_11_0_arm64.whl.

File metadata

File hashes

Hashes for pyads_agile-0.2.0-py3-none-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 638e122ce0cc52d6c758c9f32a8e256a71408a0a33e12c51ed58cc575ef23f90
MD5 9c3faa04378d0758f5b8167d4c448e02
BLAKE2b-256 861994acf47da99ae044757f4b8c58f5ee0a1d673adef002d0d1fabe1ed7efe0

See more details on using hashes here.

Provenance

The following attestation bundles were made for pyads_agile-0.2.0-py3-none-macosx_11_0_arm64.whl:

Publisher: python-publish.yml on AgileAutomationTechnologies/pyads-agile

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file pyads_agile-0.2.0-py3-none-macosx_10_15_x86_64.whl.

File metadata

File hashes

Hashes for pyads_agile-0.2.0-py3-none-macosx_10_15_x86_64.whl
Algorithm Hash digest
SHA256 517dd888a92020aee398cf13fd7791210a96f8cedd29fc9afe14606ec60bf740
MD5 5627b0161eed32d4a2b0b92639f846ef
BLAKE2b-256 49ebf678d0b6bc20839f8a8694529e63927223c475bd6d0f83cd617dda4d0db1

See more details on using hashes here.

Provenance

The following attestation bundles were made for pyads_agile-0.2.0-py3-none-macosx_10_15_x86_64.whl:

Publisher: python-publish.yml on AgileAutomationTechnologies/pyads-agile

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page