pylogix
This project will allow you to easily read/write values from tags in Rockwell Automation Logix based PLC's over Ethernet I/P using Python. PLC models inclued CompactLogix, ControlLogix and Micro8xx. Python2 and Python3 are both supported.
Getting Started
There are currently no dependencies so you can get going quickly without having to install any other prerequiste packages.
Installing
You can clone the repo with the following:
git clone https://github.com/dmroeder/pylogix.git
cd pylogix
python setup.py install --user
Or you can install with pip (Latest version):
pip install git+https://github.com/dmroeder/pylogix
To install previous version before major changes (0.3.7):
pip install git+https://github.com/dmroeder/pylogix@v0.3.7
Verifying Installation
To verify the installation on Linux, open the terminal and use the following commands:
python
import pylogix
pylogix.__version__
Your First Script:
The cloned repository will come with many examples, I'll give one here. We'll read one simple tag and print out the value. All methods will return the Response class, which contains TagName, Value and Status.
from pylogix import PLC
with PLC() as comm:
comm.IPAddress = '192.168.1.9'
ret = comm.Read('MyTagName')
print(ret.TagName, ret.Value, ret.Status)
NOTE: If your PLC is in a slot other than zero (like can be done with ControLogix), then you can specify the slot with the following:
comm.ProcessorSlot = 2
NOTE: If you are working with a Micro8xx PLC, you must set the Micro800 flag since the path is different:
comm.Micro800 = True
Other Features
Pylogix has features other than simply reading/writing. You can see all of them in the examples, I'll also list them here
- Discover()
- GetPLCTime()
- SetPLCTime()
- GetTagList()
- GetModuleProperties(slot=0)
Authors
- Burt Peterson - Initial work
- Dustin Roeder - Maintainer - dmroeder
- Fernando B. - Contributor - kodaman2
- Ottowayi - Contributor - ottowayi
License
This project is licensed under Apache 2.0 License - see the LICENSE file for details.
Acknowledgements
- Archie of AdvancedHMI for all kinds pointers and suggestions.
- Thanks to ottowayi for general python and good practice advice
- Thanks to all of the users that have tested and provided feedback.
Metadata
Release files for pylogix 0.6.0
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | |
|---|---|---|---|
| pylogix-0.6.0.tar.gz | 32.4 kB | Details |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Reset |
|---|---|---|---|---|
| pylogix-0.6.0-py2.py3-none-any.whl | Python 2, Python 3 | none | any | Details |
Total release size: 69.6 kB
Release files / pylogix-0.6.0.tar.gz
| Download URL | pylogix-0.6.0.tar.gz |
|---|---|
| Size | 32.4 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
5ab51f3db3726f2af61ef9d3201c2d0bc7f5efd24d41449959a3f424475a5153
|
|
BLAKE2b-256 checksum How to use checksums |
a4f7de60ed483cace153206f60f368ff04d2c7d7453fef7b6563882e9e52915d
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/1.15.0 pkginfo/1.5.0.1 requests/2.23.0 setuptools/44.1.0 requests-toolbelt/0.9.1 tqdm/4.44.1 CPython/2.7.17
|
Release files / pylogix-0.6.0-py2.py3-none-any.whl
| Download URL | pylogix-0.6.0-py2.py3-none-any.whl |
|---|---|
| Size | 37.3 kB |
| Tags | Python 2 Python 3 |
|
SHA-256 checksum How to use checksums |
211c8daa95d99f153cb69c6feba32fc1e263466c1bfeb00520bfc3362edd776c
|
|
BLAKE2b-256 checksum How to use checksums |
13ca53a294d92645ae3793069b348475952b19b4d1a179fe4ffbca32de0e4e23
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/1.15.0 pkginfo/1.5.0.1 requests/2.23.0 setuptools/44.1.0 requests-toolbelt/0.9.1 tqdm/4.44.1 CPython/2.7.17
|