forked from stlehmann/pyads
-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
7 changed files
with
2,057 additions
and
2,057 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,66 +1,66 @@ | ||
pyads - Python package | ||
====================== | ||
|
||
[](https://travis-ci.org/stlehmann/pyads) | ||
[](https://coveralls.io/github/stlehmann/pyads?branch=master) | ||
[](http://pyads.readthedocs.io/en/latest/?badge=latest) | ||
[](https://badge.fury.io/py/pyads) | ||
[](https://github.com/psf/black) | ||
[](https://pepy.tech/project/pyads) | ||
[](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 | ||
====================== | ||
|
||
[](https://travis-ci.org/stlehmann/pyads) | ||
[](https://coveralls.io/github/stlehmann/pyads?branch=master) | ||
[](http://pyads.readthedocs.io/en/latest/?badge=latest) | ||
[](https://badge.fury.io/py/pyads) | ||
[](https://github.com/psf/black) | ||
[](https://pepy.tech/project/pyads) | ||
[](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= | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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' |
Oops, something went wrong.