Skip to main content

Read/Write Rockwell Automation Logix based PLC's

Project description

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.

This project does not support PLC5, SLC or the Micrologix controllers.

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.

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

pylogix-0.6.3.tar.gz (33.0 kB view details)

Uploaded Source

Built Distribution

pylogix-0.6.3-py2.py3-none-any.whl (38.0 kB view details)

Uploaded Python 2 Python 3

File details

Details for the file pylogix-0.6.3.tar.gz.

File metadata

  • Download URL: pylogix-0.6.3.tar.gz
  • Upload date:
  • Size: 33.0 kB
  • Tags: Source
  • Uploaded using 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

File hashes

Hashes for pylogix-0.6.3.tar.gz
Algorithm Hash digest
SHA256 076e92eac2576d2cf82d4810b7ca17ee53bf188cf25cee1505c04f3582c88af8
MD5 a6fdb483866cedbeecf8b259e88745df
BLAKE2b-256 e44d22043f7fed8756523796a4efa3735b1ff9b650ca51b08dd146e61fdc8f93

See more details on using hashes here.

File details

Details for the file pylogix-0.6.3-py2.py3-none-any.whl.

File metadata

  • Download URL: pylogix-0.6.3-py2.py3-none-any.whl
  • Upload date:
  • Size: 38.0 kB
  • Tags: Python 2, Python 3
  • Uploaded using 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

File hashes

Hashes for pylogix-0.6.3-py2.py3-none-any.whl
Algorithm Hash digest
SHA256 75eee846a7e0664ebbb65cdcedef16b3e3305706da1c26db7d73f06028841f97
MD5 ea3a7ee7f0bdb3714d72c13003cb2bab
BLAKE2b-256 e1541a3e0102c9c7e7d3db185480ad0e3af476100b02b58d96e2c54032f17b09

See more details on using hashes here.

Supported by

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