ciplink
Introduction
ciplink is a fork of pycomm3 by Ian Ottoway, a Python library for communicating with Allen-Bradley PLCs using Ethernet/IP. It keeps the pycomm3 API (import ciplink instead of pycomm3) and adds:
tag requests addressed by symbol instance ID, including UDT members and program-scoped tags
tag-table change detection with the controller’s edit counter, so online edits trigger a reload instead of reading a reused instance ID
fast reloads, batched tag-list uploads and a restart cache (tag_cache_file)
Add-On Instruction access probing: whole AOI reads return their readable parameters, and AOI locals are refused without a request
Without the work of the pycomm3 developers, and of the original pycomm developers before them, ciplink would not exist. The pycomm3 documentation applies to ciplink apart from the import name.
Drivers
ciplink includes 3 drivers:
- CIPDriver
This driver is the base driver for the library, it handles common CIP services used by the other drivers. Things like opening/closing a connection, register/unregister sessions, forward open/close services, device discovery, and generic messaging. It can be used to connect to any Ethernet/IP device, like: drives, switches, meters, and other non-PLC devices. ciplink is a client for explicit messaging only (unconnected/UCMM and class 3 connected over TCP 44818); implicit class 0/1 I/O (UDP 2222), produced/consumed tags and acting as a CIP server/adapter are not supported.
- LogixDriver
This driver supports services specific to ControlLogix, CompactLogix, and Micro800 PLCs. Services like reading/writing tags, uploading the tag list, and getting/setting the PLC time.
- SLCDriver
This driver supports basic reading/writing data files in a SLC500 or MicroLogix PLCs. It is a port of the SlcDriver from pycomm with minimal changes to make the API similar to the other drivers. Currently this driver is considered legacy and it’s development will be on a limited basis. PLC-5 processors are not supported by any driver.
Disclaimer
PLCs can be used to control heavy or dangerous equipment, this library is provided “as is” and makes no guarantees on its reliability in a production environment. This library makes no promises in the completeness or correctness of the protocol implementations and should not be solely relied upon for critical systems. The development for this library is aimed at providing quick and convenient access for reading/writing data inside Allen-Bradley PLCs.
Setup
The package can be installed from PyPI using pip: pip install ciplink or python -m pip install ciplink.
Optionally, you may configure logging using the Python standard logging library. A convenience method is provided to help configure basic logging, see the Logging Section in the docs for more information.
Python and OS Support
ciplink is a Python 3-only library and is supported on Python 3.9 and newer. There should be no OS-specific requirements and should be able to run on any OS that Python is supported on. Development and testing is done primarily on Windows 10. If you encounter an OS-related problem, please open an issue in the GitHub repository and it will be investigated.
Documentation
This README covers a basic overview of the library, full documentation can be found on Read the Docs or by visiting https://pycomm3.dev.
Contributions
If you’d like to contribute or are having an issue, please read the Contributing guidelines.
Highlighted Features
- generic_message for extra functionality not directly implemented
working similar to the MSG instruction in Logix, arguments similar to the MESSAGE properties
See the examples section for things like getting/setting drive parameters, IP configuration, or uploading an EDS file
used internally to implement some of the other methods (get/set_plc_time, forward open/close, etc)
- simplified data types
allows use of standard Python types by abstracting CIP implementation details away from the user
strings use normal Python str objects, does not require handling of the LEN and DATA attributes separately
custom string types are also identified automatically and not limited to just the builtin one
BOOL arrays use normal Python bool objects, does not require complicated bit shifting of the DWORD value
powerful type system to allow types to represent any CIP object and handle encoding/decoding the object
LogixDriver
- simple API, only 1 read method and 1 write method for tags.
does not require using different methods for different data types
requires the tag name only, no other information required from the user
automatically manages request/response size to pack as many requests into a single packet
automatically handles fragmented requests for large tags that can’t fit in a single packet
- both support full structure reading/writing (UDTs, AOIs, etc)
for read the Tag.value will be a dict of {attribute: value}
- for write the value should be a dict of {attribute: value} , nesting as needed
does not do partial writes, the value must match the complete structure
not recommended for builtin type (TIMER, CONTROL, COUNTER, etc)
both require no attributes to have an External Access of None
- uploads the tag list and data type definitions from the PLC
no requirement for user to determine tags available (like from an L5X export)
definitions are required for read/write methods
- automatically enables/disables different features based on the target PLC
Extended Forward Open (EN2T or newer and v20+)
Symbol Instance Addressing (Logix v21+)
detection of Micro800 and disables unsupported features (CIP Path, Ex. Forward Open, Instance Addressing, etc)
LogixDriver Overview
Creating a driver is simple, only a path argument is required. The path can be the IP address, IP and slot, or a full CIP route, refer to the documentation for more details. The example below shows how to create a simple driver and print some of the information collected about the device.
from ciplink import LogixDriver
with LogixDriver('10.20.30.100/1') as plc:
print(plc)
# OUTPUT:
# Program Name: PLCA, Device: 1756-L83E/B, Revision: 28.13
print(plc.info)
# OUTPUT:
# {'vendor': 'Rockwell Automation/Allen-Bradley', 'product_type': 'Programmable Logic Controller',
# 'product_code': 166, 'revision': {'major': 28, 'minor': 13}, 'status': b'`0', 'serial': 'ffffffff',
# 'product_name': '1756-L83E/B', 'keyswitch': 'REMOTE RUN', 'name': 'PLCA'}
Unit Testing
pytest is used for unit testing. The tests directory contains an L5X export of the testing program that contains all tags necessary for testing. The only requirement for testing (besides a running PLC with the testing program) is the environment variable PLCPATH for the PLC defined.
User Tests
These tests are for users to run. There are a few tests that are specific to a demo plc, those are excluded. To run them you have the following options:
with tox:
modify the PLCPATH variable in tox.ini
then run this command: tox -e user
or with pytest:
set PLCPATH=192.168.1.100
pytest --ignore tests/online/test_demo_plc.py
(or the equivalent in your shell)
License
ciplink is distributed under the MIT License
Metadata
Release files for ciplink 0.2.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 | Provenance | |
|---|---|---|---|---|
| ciplink-0.2.0.tar.gz | 116.8 kB | With provenance | Details |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Reset |
|---|---|---|---|---|
| ciplink-0.2.0-py3-none-any.whl | Python 3 | none | any | Details |
Total release size: 251.1 kB
Release files / ciplink-0.2.0.tar.gz
| Download URL | ciplink-0.2.0.tar.gz |
|---|---|
| Size | 116.8 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
a0aea079d90cba48268034e395665bbfa23814aec5872d5c5ed2e0226110aebd
|
|
BLAKE2b-256 checksum How to use checksums |
6800c214abb0b12d414462423bef5ab2ed0f282724e239e19ae9717792cc0c9e
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/7.0.0 CPython/3.13.14
|
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on Oct 15, 2026.
Transparency logRelease files / ciplink-0.2.0-py3-none-any.whl
| Download URL | ciplink-0.2.0-py3-none-any.whl |
|---|---|
| Size | 134.3 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
a629ab05e73ae85cc7fed2eccfa5896bc310ef9aa5e68aa194665f5dbcebfa68
|
|
BLAKE2b-256 checksum How to use checksums |
e90715b20fe1d2447a79dc17f302b195fd4d3ded8ee8e3daefae9ef9001e2563
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/7.0.0 CPython/3.13.14
|
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on Oct 15, 2026.
Transparency logSecurity for ciplink 0.2.0
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
Full provenance
All 2 files in this release have been uploaded with provenance metadata.
Attestation for ciplink-0.2.0.tar.gz
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on Oct 15, 2026.
Transparency logA note on package security
PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.