Skip to content

Commit

Permalink
Use dos2unix on source files
Browse files Browse the repository at this point in the history
  • Loading branch information
stlehmann committed May 11, 2020
1 parent ef0167d commit 7f10504
Show file tree
Hide file tree
Showing 7 changed files with 2,057 additions and 2,057 deletions.
24 changes: 12 additions & 12 deletions PKG-INFO
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
Metadata-Version: 1.1
Name: adsPy
Version: 1.0.2
Summary: Python wrapper for TwinCAT ADS-DLL
Home-page: http://mrleeh.square7.ch/
Author: Stefan Lehmann
Author-email: [email protected]
License: UNKNOWN
Description: UNKNOWN
Platform: UNKNOWN
Requires: ctypes
Provides: adsPy
Metadata-Version: 1.1
Name: adsPy
Version: 1.0.2
Summary: Python wrapper for TwinCAT ADS-DLL
Home-page: http://mrleeh.square7.ch/
Author: Stefan Lehmann
Author-email: [email protected]
License: UNKNOWN
Description: UNKNOWN
Platform: UNKNOWN
Requires: ctypes
Provides: adsPy
132 changes: 66 additions & 66 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,66 +1,66 @@
pyads - Python package
======================

[![Build Status](https://travis-ci.org/stlehmann/pyads.svg?branch=master)](https://travis-ci.org/stlehmann/pyads)
[![Coverage Status](https://coveralls.io/repos/github/stlehmann/pyads/badge.svg?branch=master)](https://coveralls.io/github/stlehmann/pyads?branch=master)
[![Documentation Status](https://readthedocs.org/projects/pyads/badge/?version=latest)](http://pyads.readthedocs.io/en/latest/?badge=latest)
[![PyPI version](https://badge.fury.io/py/pyads.svg)](https://badge.fury.io/py/pyads)
[![Code style: black](https://img.shields.io/badge/code%20style-black-000000.svg)](https://github.com/psf/black)
[![Downloads](https://pepy.tech/badge/pyads)](https://pepy.tech/project/pyads)
[![Downloads](https://pepy.tech/badge/pyads/week)](https://pepy.tech/project/pyads/week)

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](http://infosys.beckhoff.com/english.php?content=../content/1033/tcadsdll2/html/tcadsdll_api_overview.htm&id=20557).


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

# Installation

From PyPi:

```bash
$ pip install pyads
```

From Github:

```bash
$ 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

```python
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()
```

[0]: https://infosys.beckhoff.de/english.php?content=../content/1033/TcSystemManager/Basics/TcSysMgr_AddRouteDialog.htm&id=

pyads - Python package
======================

[![Build Status](https://travis-ci.org/stlehmann/pyads.svg?branch=master)](https://travis-ci.org/stlehmann/pyads)
[![Coverage Status](https://coveralls.io/repos/github/stlehmann/pyads/badge.svg?branch=master)](https://coveralls.io/github/stlehmann/pyads?branch=master)
[![Documentation Status](https://readthedocs.org/projects/pyads/badge/?version=latest)](http://pyads.readthedocs.io/en/latest/?badge=latest)
[![PyPI version](https://badge.fury.io/py/pyads.svg)](https://badge.fury.io/py/pyads)
[![Code style: black](https://img.shields.io/badge/code%20style-black-000000.svg)](https://github.com/psf/black)
[![Downloads](https://pepy.tech/badge/pyads)](https://pepy.tech/project/pyads)
[![Downloads](https://pepy.tech/badge/pyads/week)](https://pepy.tech/project/pyads/week)

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](http://infosys.beckhoff.com/english.php?content=../content/1033/tcadsdll2/html/tcadsdll_api_overview.htm&id=20557).


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

# Installation

From PyPi:

```bash
$ pip install pyads
```

From Github:

```bash
$ 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

```python
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()
```

[0]: https://infosys.beckhoff.de/english.php?content=../content/1033/TcSystemManager/Basics/TcSysMgr_AddRouteDialog.htm&id=

90 changes: 45 additions & 45 deletions pyads/__init__.py
Original file line number Diff line number Diff line change
@@ -1,45 +1,45 @@
# -*- coding: utf-8 -*-
"""The pyads package.
:author: Stefan Lehmann <[email protected]>
:license: MIT, see license file or https://opensource.org/licenses/MIT
:created on: 2018-06-11 18:15:53
"""
from .structs import AmsAddr, NotificationAttrib

from .ads import open_port, close_port, get_local_address, read_state, \
write_control, read_device_info, write, read_write, read, \
read_by_name, write_by_name, add_route, add_route_to_plc, delete_route, \
add_device_notification, del_device_notification, Connection, \
set_local_address, set_timeout, size_of_structure, dict_from_bytes

from .pyads_ex import ADSError

from .constants import PLCTYPE_BOOL, PLCTYPE_BYTE, PLCTYPE_DATE, \
PLCTYPE_DINT, PLCTYPE_DT, PLCTYPE_DWORD, PLCTYPE_INT, PLCTYPE_LREAL, \
PLCTYPE_REAL, PLCTYPE_SINT, PLCTYPE_STRING, PLCTYPE_TIME, PLCTYPE_TOD, \
PLCTYPE_ULINT, PLCTYPE_UDINT, PLCTYPE_UINT, PLCTYPE_USINT, PLCTYPE_WORD, \
PLCTYPE_ARR_DINT, PLCTYPE_ARR_INT, PLCTYPE_ARR_LREAL, PLCTYPE_ARR_REAL, \
PLCTYPE_ARR_SHORT, PLC_DEFAULT_STRING_SIZE, DATATYPE_MAP

from .constants import PORT_EVENTLOGGER, PORT_IO, PORT_LOGGER, PORT_NC, \
PORT_NOCKE, PORT_SCOPE, PORT_SPECIALTASK1, PORT_SPECIALTASK2, PORT_SPS1, \
PORT_SPS2, PORT_SPS3, PORT_SPS4, PORT_SYSTEMSERVICE, \
PORT_CAM, PORT_TC2PLC1, PORT_TC2PLC2, PORT_TC2PLC3, PORT_TC2PLC4, PORT_TC3PLC1

from .constants import INDEXGROUP_MEMORYBYTE, INDEXGROUP_MEMORYBIT, \
INDEXGROUP_MEMORYSIZE, INDEXGROUP_RETAIN, INDEXGROUP_RETAINSIZE, \
INDEXGROUP_DATA, INDEXGROUP_DATASIZE

from .constants import ADSSTATE_INVALID, ADSSTATE_IDLE, ADSSTATE_RESET, \
ADSSTATE_INIT, ADSSTATE_START, ADSSTATE_RUN, ADSSTATE_STOP, \
ADSSTATE_SAVECFG, ADSSTATE_LOADCFG, ADSSTATE_POWERFAILURE, \
ADSSTATE_POWERGOOD, ADSSTATE_ERROR, ADSSTATE_SHUTDOWN, ADSSTATE_SUSPEND, \
ADSSTATE_RESUME, ADSSTATE_CONFIG, ADSSTATE_RECONFIG

from .constants import ADSTRANS_NOTRANS, ADSTRANS_CLIENTCYCLE, \
ADSTRANS_CLIENT1REQ, ADSTRANS_SERVERCYCLE, ADSTRANS_SERVERONCHA

__version__ = '3.2.1'
# -*- coding: utf-8 -*-
"""The pyads package.
:author: Stefan Lehmann <[email protected]>
:license: MIT, see license file or https://opensource.org/licenses/MIT
:created on: 2018-06-11 18:15:53
"""
from .structs import AmsAddr, NotificationAttrib

from .ads import open_port, close_port, get_local_address, read_state, \
write_control, read_device_info, write, read_write, read, \
read_by_name, write_by_name, add_route, add_route_to_plc, delete_route, \
add_device_notification, del_device_notification, Connection, \
set_local_address, set_timeout, size_of_structure, dict_from_bytes

from .pyads_ex import ADSError

from .constants import PLCTYPE_BOOL, PLCTYPE_BYTE, PLCTYPE_DATE, \
PLCTYPE_DINT, PLCTYPE_DT, PLCTYPE_DWORD, PLCTYPE_INT, PLCTYPE_LREAL, \
PLCTYPE_REAL, PLCTYPE_SINT, PLCTYPE_STRING, PLCTYPE_TIME, PLCTYPE_TOD, \
PLCTYPE_ULINT, PLCTYPE_UDINT, PLCTYPE_UINT, PLCTYPE_USINT, PLCTYPE_WORD, \
PLCTYPE_ARR_DINT, PLCTYPE_ARR_INT, PLCTYPE_ARR_LREAL, PLCTYPE_ARR_REAL, \
PLCTYPE_ARR_SHORT, PLC_DEFAULT_STRING_SIZE, DATATYPE_MAP

from .constants import PORT_EVENTLOGGER, PORT_IO, PORT_LOGGER, PORT_NC, \
PORT_NOCKE, PORT_SCOPE, PORT_SPECIALTASK1, PORT_SPECIALTASK2, PORT_SPS1, \
PORT_SPS2, PORT_SPS3, PORT_SPS4, PORT_SYSTEMSERVICE, \
PORT_CAM, PORT_TC2PLC1, PORT_TC2PLC2, PORT_TC2PLC3, PORT_TC2PLC4, PORT_TC3PLC1

from .constants import INDEXGROUP_MEMORYBYTE, INDEXGROUP_MEMORYBIT, \
INDEXGROUP_MEMORYSIZE, INDEXGROUP_RETAIN, INDEXGROUP_RETAINSIZE, \
INDEXGROUP_DATA, INDEXGROUP_DATASIZE

from .constants import ADSSTATE_INVALID, ADSSTATE_IDLE, ADSSTATE_RESET, \
ADSSTATE_INIT, ADSSTATE_START, ADSSTATE_RUN, ADSSTATE_STOP, \
ADSSTATE_SAVECFG, ADSSTATE_LOADCFG, ADSSTATE_POWERFAILURE, \
ADSSTATE_POWERGOOD, ADSSTATE_ERROR, ADSSTATE_SHUTDOWN, ADSSTATE_SUSPEND, \
ADSSTATE_RESUME, ADSSTATE_CONFIG, ADSSTATE_RECONFIG

from .constants import ADSTRANS_NOTRANS, ADSTRANS_CLIENTCYCLE, \
ADSTRANS_CLIENT1REQ, ADSTRANS_SERVERCYCLE, ADSTRANS_SERVERONCHA

__version__ = '3.2.1'
Loading

0 comments on commit 7f10504

Please sign in to comment.