Skip to content
Python wrapper for TwinCAT ADS
Python Dockerfile
Branch: master
Clone or download
stlehmann Merge pull request #103 from kryskool/patch-2
Add Python 3.8 on Travis CI test
Latest commit 3f6c43e Dec 21, 2019
Permalink
Type Name Latest commit message Commit time
Failed to load latest commit information.
adslib @ a3da436 use latest adslib Jul 29, 2019
doc Spelling fixes Oct 19, 2019
pyads Spelling fixes Oct 19, 2019
tests Spelling fixes Oct 19, 2019
.checkignore
.coveralls.yml Update coveralls Jul 13, 2018
.flake8 Add type annotations Jul 12, 2018
.gitattributes
.gitignore
.gitmodules Remove src from.gitmodules. Mar 29, 2019
.travis.yml Add Python 3.8 on Travis CI test Nov 11, 2019
CONTRIBUTING.md added CONTRIBUTING.md and updated tox ini to align with travis Oct 2, 2019
Dockerfile
LICENSE add license, rewrite README Jun 4, 2015
MANIFEST.in Include adslib/* in Manifest.in. Mar 29, 2019
PKG-INFO changed some package infos Sep 29, 2013
README.md Add feature list and remove duplicates from Readme Oct 4, 2019
lint.py lint changes Jul 13, 2018
mypy.ini
pyproject.toml formatted all with black Oct 4, 2019
requirements.in Requirements: Replace slow Pipfiles by requirements.in and requiremen… Feb 19, 2019
requirements.txt Update requirements. Apr 21, 2019
setup.cfg Add NOTEFUNC to Windows Aug 16, 2018
setup.py
tox.ini Update Tox configuration for Python 3.8 Nov 19, 2019

README.md

pyads - Python package

Build Status Coverage Status Documentation Status PyPI version Code style: black

This is a python wrapper for TwinCATs ADS library. It provides python functions for communicating with TwinCAT devices. pyads uses the C API provided by TcAdsDll.dll on Windows adslib.so on Linux. The documentation for the ADS API is available on infosys.beckhoff.com.

Documentation: http://pyads.readthedocs.io/en/latest/index.html

Installation

From PyPi:

$ pip install pyads

From Github:

$ git clone https://github.com/MrLeeh/pyads.git --recursive
$ cd pyads
$ python setup.py install

Features

  • connect to a remote TwinCAT device like a plc or a PC with TwinCAT
  • create routes on Linux devices and on remote plcs
  • supports TwinCAT 2 and TwinCAT 3
  • read and write values by name or address
  • read DUTs (structures) from the plc
  • notification callbacks

Basic usage

import pyads

# add route to remote plc
pyads.add_route("192.168.1.12.1.1", "192.168.1.12")

# connect to plc and open connection
plc = pyads.Connection('127.0.0.1.1.1', pyads.PORT_SPS1)
plc.open()

# read int value by name
i = plc.read_by_name("GVL.int_val", pyads.PLCTYPE_INT)

# write int value by name
plc.write_by_name("GVL.int_val", i, pyads.PLCTYPE_INT)

# close connection
plc.close()
You can’t perform that action at this time.