{ "info": { "author": "Agostino Ruscito", "author_email": "uscito@gmail.com", "bugtrack_url": null, "classifiers": [ "Development Status :: 5 - Production/Stable", "Environment :: MacOS X", "Environment :: Win32 (MS Windows)", "Environment :: X11 Applications", "Intended Audience :: Developers", "Intended Audience :: End Users/Desktop", "Intended Audience :: Information Technology", "Intended Audience :: Manufacturing", "Intended Audience :: Other Audience", "License :: OSI Approved :: MIT License", "Operating System :: MacOS", "Operating System :: MacOS :: MacOS X", "Operating System :: Microsoft :: MS-DOS", "Operating System :: Microsoft :: Windows", "Operating System :: Microsoft :: Windows :: Windows 7", "Operating System :: Microsoft :: Windows :: Windows NT/2000", "Operating System :: Microsoft :: Windows :: Windows Server 2003", "Operating System :: Microsoft :: Windows :: Windows Server 2008", "Operating System :: Microsoft :: Windows :: Windows Vista", "Operating System :: Microsoft :: Windows :: Windows XP", "Operating System :: OS Independent", "Programming Language :: Python", "Programming Language :: Python :: 2.6", "Programming Language :: Python :: 2.7", "Topic :: Scientific/Engineering", "Topic :: System :: Monitoring", "Topic :: Terminals" ], "description": "pycomm\r\n======\r\npycomm is a package that includes a collection of modules used to communicate with PLCs.\r\nAt the moment the first module in the package is ab_comm.\r\n\r\nTest\r\n----\r\nThe library is currently test on Python 2.6, 2.7\r\n\r\n.. image:: https://travis-ci.org/ruscito/pycomm.svg?branch=master\r\n :target: https://travis-ci.org/ruscito/pycomm\r\n\r\nSetup\r\n-----\r\nThe package can be installed from\r\n\r\nGitHub:\r\n::\r\n\r\n git clone https://github.com/ruscito/pycomm.git\r\n cd pycomm\r\n sudo python setup.py install\r\n\r\nPyPi:\r\n::\r\n \r\n pip install pycomm\r\n\r\nab_comm\r\n-------\r\nab_comm is a module that contains a set of classes used to interface Rockwell PLCs using Ethernet/IP protocol.\r\nThe \"clx\" class can be used to communicate with Compactlogix, Controllogix PLCs\r\nThe \"slc\" can be used to communicate with Micrologix or SLC PLCs\r\n\r\nI tried to followCIP specifications volume 1 and 2 as well as `Rockwell Automation Publication 1756-PM020-EN-P - November 2012`_ .\r\n\r\n.. _Rockwell Automation Publication 1756-PM020-EN-P - November 2012: http://literature.rockwellautomation.com/idc/groups/literature/documents/pm/1756-pm020_-en-p.pdf\r\n\r\nSee the following snippet for communication with a Controllogix PLC:\r\n\r\n::\r\n\r\n from pycomm.ab_comm.clx import Driver as ClxDriver\r\n import logging\r\n\r\n\r\n if __name__ == '__main__':\r\n logging.basicConfig(\r\n filename=\"ClxDriver.log\",\r\n format=\"%(levelname)-10s %(asctime)s %(message)s\",\r\n level=logging.DEBUG\r\n )\r\n c = ClxDriver()\r\n\r\n if c.open('172.16.2.161'):\r\n\r\n print(c.read_tag(['ControlWord']))\r\n print(c.read_tag(['parts', 'ControlWord', 'Counts']))\r\n\r\n print(c.write_tag('Counts', -26, 'INT'))\r\n print(c.write_tag(('Counts', 26, 'INT')))\r\n print(c.write_tag([('Counts', 26, 'INT')]))\r\n print(c.write_tag([('Counts', -26, 'INT'), ('ControlWord', -30, 'DINT'), ('parts', 31, 'DINT')]))\r\n\r\n # To read an array\r\n r_array = c.read_array(\"TotalCount\", 1750)\r\n for tag in r_array:\r\n print (tag)\r\n\r\n # reset tha array to all 0\r\n w_array = []\r\n for i in xrange(1750):\r\n w_array.append(0)\r\n c.write_array(\"TotalCount\", \"SINT\", w_array)\r\n\r\n c.close()\r\n\r\n\r\n\r\n\r\nSee the following snippet for communication with a Micrologix PLC:\r\n\r\n\r\n::\r\n\r\n from pycomm.ab_comm.slc import Driver as SlcDriver\r\n import logging\r\n\r\n\r\n if __name__ == '__main__':\r\n logging.basicConfig(\r\n filename=\"SlcDriver.log\",\r\n format=\"%(levelname)-10s %(asctime)s %(message)s\",\r\n level=logging.DEBUG\r\n )\r\n c = SlcDriver()\r\n if c.open('172.16.2.160'):\r\n\r\n print c.read_tag('S:1/5')\r\n print c.read_tag('S:60', 2)\r\n\r\n print c.write_tag('N7:0', [-30, 32767, -32767])\r\n print c.write_tag('N7:0', 21)\r\n print c.read_tag('N7:0', 10)\r\n\r\n print c.write_tag('F8:0', [3.1, 4.95, -32.89])\r\n print c.write_tag('F8:0', 21)\r\n print c.read_tag('F8:0', 3)\r\n\r\n print c.write_tag('B3:100', [23, -1, 4, 9])\r\n print c.write_tag('B3:100', 21)\r\n print c.read_tag('B3:100', 4)\r\n\r\n print c.write_tag('T4:3.PRE', 431)\r\n print c.read_tag('T4:3.PRE')\r\n print c.write_tag('C5:0.PRE', 501)\r\n print c.read_tag('C5:0.PRE')\r\n print c.write_tag('T4:3.ACC', 432)\r\n print c.read_tag('T4:3.ACC')\r\n print c.write_tag('C5:0.ACC', 502)\r\n print c.read_tag('C5:0.ACC')\r\n\r\n c.write_tag('T4:2.EN', 0)\r\n c.write_tag('T4:2.TT', 0)\r\n c.write_tag('T4:2.DN', 0)\r\n print c.read_tag('T4:2.EN', 1)\r\n print c.read_tag('T4:2.TT', 1)\r\n print c.read_tag('T4:2.DN',)\r\n\r\n c.write_tag('C5:0.CU', 1)\r\n c.write_tag('C5:0.CD', 0)\r\n c.write_tag('C5:0.DN', 1)\r\n c.write_tag('C5:0.OV', 0)\r\n c.write_tag('C5:0.UN', 1)\r\n c.write_tag('C5:0.UA', 0)\r\n print c.read_tag('C5:0.CU')\r\n print c.read_tag('C5:0.CD')\r\n print c.read_tag('C5:0.DN')\r\n print c.read_tag('C5:0.OV')\r\n print c.read_tag('C5:0.UN')\r\n print c.read_tag('C5:0.UA')\r\n\r\n c.write_tag('B3:100', 1)\r\n print c.read_tag('B3:100')\r\n\r\n c.write_tag('B3/3955', 1)\r\n print c.read_tag('B3/3955')\r\n\r\n c.write_tag('N7:0/2', 1)\r\n print c.read_tag('N7:0/2')\r\n\r\n print c.write_tag('O:0.0/4', 1)\r\n print c.read_tag('O:0.0/4')\r\n\r\n c.close()\r\n\r\n\r\nThe Future\r\n----------\r\nThis package is under development.\r\nThe modules _ab_comm.clx_ and _ab_comm.slc_ are completed at moment but other drivers will be added in the future.\r\n\r\nThanks\r\n------\r\nThanks in advance for feedback and suggestions\r\n\r\nLicense\r\n-------\r\npycomm is distributed under the MIT License", "description_content_type": null, "docs_url": null, "download_url": "UNKNOWN", "downloads": { "last_day": -1, "last_month": -1, "last_week": -1 }, "home_page": "https://github.com/ruscito/pycomm", "keywords": "", "license": "MIT", "maintainer": "", "maintainer_email": "", "name": "pycomm", "package_url": "https://pypi.org/project/pycomm/", "platform": "UNKNOWN", "project_url": "https://pypi.org/project/pycomm/", "project_urls": { "Download": "UNKNOWN", "Homepage": "https://github.com/ruscito/pycomm" }, "release_url": "https://pypi.org/project/pycomm/1.0.8/", "requires_dist": null, "requires_python": null, "summary": "A PLC communication library for Python", "version": "1.0.8" }, "last_serial": 1796001, "releases": { "1.0.8": [ { "comment_text": "", "digests": { "md5": "f065a4ba86b4e610bee759ab32769a80", "sha256": "1b027fa43b49e40ead4693d066ca86d67e898667b28a68a2d1d6827fb93bfc00" }, "downloads": -1, "filename": "pycomm-1.0.8.tar.gz", "has_sig": false, "md5_digest": "f065a4ba86b4e610bee759ab32769a80", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 23139, "upload_time": "2015-11-01T17:10:50", "url": "https://files.pythonhosted.org/packages/a1/87/532113d0749642ae5d3e3007edac4f8896aeaef7ea7676fbeaba755daaa2/pycomm-1.0.8.tar.gz" } ] }, "urls": [ { "comment_text": "", "digests": { "md5": "f065a4ba86b4e610bee759ab32769a80", "sha256": "1b027fa43b49e40ead4693d066ca86d67e898667b28a68a2d1d6827fb93bfc00" }, "downloads": -1, "filename": "pycomm-1.0.8.tar.gz", "has_sig": false, "md5_digest": "f065a4ba86b4e610bee759ab32769a80", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 23139, "upload_time": "2015-11-01T17:10:50", "url": "https://files.pythonhosted.org/packages/a1/87/532113d0749642ae5d3e3007edac4f8896aeaef7ea7676fbeaba755daaa2/pycomm-1.0.8.tar.gz" } ] }