{"id":24351,"library":"pylogix","title":"pylogix","description":"pylogix is a Python library for reading and writing Rockwell Automation Logix-based PLCs (ControlLogix, CompactLogix, MicroLogix, etc.) over Ethernet/IP. Current version is 1.1.5, released occasionally with bug fixes and minor enhancements.","status":"active","version":"1.1.5","language":"python","source_language":"en","source_url":"https://github.com/dmroeder/pylogix","tags":["plc","rockwell","automation","ethernet/ip","logix"],"install":[{"cmd":"pip install pylogix","lang":"bash","label":"Install from PyPI"}],"dependencies":[],"imports":[{"note":"Correct import for the PLC class.","symbol":"PLC","correct":"from pylogix import PLC"}],"quickstart":{"code":"from pylogix import PLC\n\nwith PLC() as comm:\n    comm.IPAddress = '192.168.1.10'\n    ret = comm.Read('MyTag')\n    if ret.Value is not None:\n        print(ret.Value)","lang":"python","description":"Basic read operation: initialize PLC, set IP, read a tag, and print the value."},"warnings":[{"fix":"Set comm.IPAddress immediately before calling Read/Write, or use 'with PLC() as comm:' which resets on exit.","message":"The PLC object modifies its internal state (like IPAddress) after each read/write call. Always set IPAddress before each transaction or use a context manager.","severity":"gotcha","affected_versions":"all"},{"fix":"Verify tag name in the PLC’s tag database; use the full path including program scope if needed.","message":"Tag names must be exact and case-sensitive. Rockwell PLCs often require the full path (e.g., 'Program:MainProgram.MyTag').","severity":"gotcha","affected_versions":"all"},{"fix":"Update to use 'from pylogix import PLC' and instantiate PLC() object, then call .Read() and .Write().","message":"Version 0.7.0 changed the API: 'read' and 'write' functions were replaced by methods on the PLC object. Old code using 'from pylogix import read' breaks.","severity":"breaking","affected_versions":"<0.7.0"}],"env_vars":null,"last_verified":"2026-05-01T00:00:00.000Z","next_check":"2026-07-30T00:00:00.000Z","problems":[{"fix":"Use 'from pylogix import PLC' and then call plc.Read() instead.","cause":"Using old import 'from pylogix import read' after upgrading to version >=0.7.0.","error":"AttributeError: module 'pylogix' has no attribute 'read'"},{"fix":"Verify IP address, ensure PLC is on the same subnet, and check firewall settings. If using a ControlLogix, set comm.ProcessorSlot if not 0.","cause":"Incorrect IP address, PLC not reachable, or wrong CIP path.","error":"pylogix.exceptions.ConnectionError: Unable to connect to the PLC"},{"fix":"Use the exact tag path including program scope (e.g., 'Program:MainProgram.MyTag') and confirm case sensitivity.","cause":"Tag name does not exist or incorrect path (e.g., missing program scope).","error":"pylogix.exceptions.TagError: Tag Not Found"}],"ecosystem":"pypi","meta_description":null,"install_score":null,"install_tag":null,"quickstart_score":null,"quickstart_tag":null}