{ "info": { "author": "Jason Valenzuela", "author_email": "jvalenzuela1977@gmail.com", "bugtrack_url": null, "classifiers": [ "Development Status :: 5 - Production/Stable", "Intended Audience :: Developers", "License :: OSI Approved :: GNU General Public License v3 or later (GPLv3+)", "Operating System :: OS Independent", "Programming Language :: Python :: 2.7", "Programming Language :: Python :: 3", "Topic :: Scientific/Engineering :: Interface Engine/Protocol Translator", "Topic :: Software Development :: Libraries :: Python Modules", "Topic :: Text Processing :: Markup :: XML" ], "description": "=========================\r\nRSLogix .L5X Interface\r\n=========================\r\n\r\nThis package aims to implement an interface for manipulating content of\r\nRSLogix .L5X export files using a native Pythonic approach as opposed to\r\ndealing with raw XML.\r\n\r\n\r\nGetting Started\r\n-------------------------\r\n\r\nAll access to .L5X data is through a top-level Project object, instantiated\r\nby passing a filename to the constructor. If the project is to be modified\r\nthe write method writes the updated data back to a file for importing into\r\nRSLogix. Typical execution flow is as follows:\r\n\r\n::\r\n\r\n\timport l5x\r\n\tprj = l5x.Project('project.L5X')\r\n\r\n\t# Read or modify data as needed.\r\n\r\n\tprj.write('modified.L5X')\r\n\r\n\r\nController\r\n-------------------------\r\n\r\nThe controller attribute of a project has the following attributes:\r\n\r\ntags:\r\n\tA tag scope containing controller tags; see Tags_.\r\n\r\n\r\ncomm_path:\r\n\tPermits reading and modifying the controller's communication path.\r\n\tSetting to None will delete the communication path.\r\n\r\n::\r\n\r\n\t>>> prj.controller.tags['tag_name'].description = 'A controller tag'\r\n\t>>> prj.controller.comm_path\r\n\t'AB_ETHIP-1\\\\192.168.1.10\\\\Backplane\\\\0'\r\n\r\nsnn:\r\n\tSafety network number; see Modules_ for details.\r\n\r\n\r\nPrograms\r\n-------------------------\r\n\r\nA project's programs attribute contains a names attribute that evaluates\r\nto an iterable of program names, members of which can be used as indices to\r\naccess program-scoped tags.\r\n\r\n::\r\n\r\n\t>>> prj.programs.names\r\n\t['MainProgram', 'AnotherProgram']\r\n\t>>> prj.programs['MainProgram'].tags['a_program_tag'].value = 50\r\n\r\n\r\nTags\r\n-------------------------\r\n\r\nThe top-level project contains tag scope objects, such as controller or\r\nprograms, which provide access to their respective tags. Indexing a scope\r\nobject with a tag's name will return a tag object providing access to the\r\nvarious properties of the tag. An iterable of tag names can also be acquired\r\nfrom a scope's names attribute.\r\n\r\n::\r\n\r\n\tctl_tags = prj.controller.tags\r\n\ttag_names = ctl_tags.names\r\n\tsome_tag = ctl_tags[tag_names[0]]\r\n\r\nAll tag objects have at least the following attributes:\r\n\r\ndata_type\r\n\tA string describing the tag's data type, such as DINT or TIMER.\r\n\r\nvalue\r\n\tThe tag's complete value, the type of which varies based on the\r\n tag's type. For base data types this will be a single value, such\r\n as an integer, however, container objects are utilized for compound\r\n\tdata types such as arrays and UDTs. See documentation below for\r\n\tdetails. This attribute can be read to acquire the current value\r\n\tor written to set a new value.\r\n\r\ndescription\r\n\tThe tag's top-level comment. See data type specific\r\n documentation for data types which support commenting subelements\r\n\tsuch as individual array members or integer bits. In addition to\r\n normal read/write activities, setting this attribute to None will\r\n delete any existing comment.\r\n\r\n Recent versions of RSLogix have implemented maintaining comments and\r\n descriptions in multiple languages. Adding, removing, or modifying\r\n comments with the L5X package will only affect comments in the\r\n project's current language. Changing the current language, or\r\n manipulating comments in other languages is currently not implemented.\r\n\r\nConsumed tags include these additional read/write attributes:\r\n\r\nproducer\r\n\tName of the producing controller.\r\n\r\nremote_tag\r\n\tRemote tag name.\r\n\r\n\r\nIntegers\r\n~~~~~~~~~~~~~~~~~~~~~~~~~\r\n\r\nDINT, INT, and SINT data types accept integer values.\r\n\r\n::\r\n\r\n\tprj.controller.tags['dint_tag'].value = 42\r\n\r\nAccessing individual bits is available via index notation with a zero-based\r\ninteger index:\r\n\r\n::\r\n\r\n\tprj.controller.tags['dint_tag'][3].value = 1\r\n\tprj.controller.tags['dint_tag'][2].description = 'this is bit 2'\r\n\r\n\r\nBooleans\r\n~~~~~~~~~~~~~~~~~~~~~~~~~\r\n\r\nLike integers, BOOL data types accept integer values, albeit only\r\n0 or 1.\r\n\r\n\r\nFloats\r\n~~~~~~~~~~~~~~~~~~~~~~~~~\r\n\r\nREAL data types use floating point values. If an integer value is desired,\r\nit must first be converted to a float before assignment or a TypeError will\r\nbe raised. Infinite and not-a-number values may not be used.\r\n\r\n\r\nStructures\r\n~~~~~~~~~~~~~~~~~~~~~~~~~\r\n\r\nStructured data types include UDTs and built-ins such as TIMER. Individual\r\nmembers are accessed using the member's name as an index as follows:\r\n\r\n::\r\n\r\n\tprj.controller.tags['timer']['PRE'].value = 100\r\n\tprj.controller.tags['timer']['DN'].description = 'done bit'\r\n\r\nAn iterable set of member identifiers is available with the names attribute:\r\n\r\n::\r\n\r\n\t>>> prj.controller.tags['timer'].names\r\n\t['PRE', 'ACC', 'TT', 'EN', 'DN']\r\n\r\nAccessing the value of the structure as a whole is also possible using\r\ndictionaries keyed by member name.\r\n\r\n::\r\n\r\n\td = {'PRE':0, 'ACC':0, 'EN':0, 'TT':0, 'DN':0}\r\n\tprj.controller.tags['timer'].value = d\r\n\r\n\r\nArrays\r\n~~~~~~~~~~~~~~~~~~~~~~~~~\r\n\r\nArray elements are accessed with standard index notation using integer\r\nindices. Multidimensional arrays use a series of indices, each within their\r\nown bracket as opposed to the comma-separated style of RSLogix.\r\n\r\n::\r\n\r\n\t>>> prj.controller.tags['single_dim_array'][3].value = 16\r\n\t>>> prj.controller.tags['multi_dim_array'][2][5].description\r\n\t'This is multi_dim_array[2,5]'\r\n\r\nThe value of entire array is available through the value attribute using\r\nlists. Multidimensional arrays use lists of lists and arrays of complex data\r\ntypes are supported, for example an array of UDTs is a list of dicts.\r\n\r\n::\r\n\r\n\t>>> l = [0, 1, 2, 3, 4]\r\n\t>>> prj.controller.tags['single_dim_array'].value = l\r\n\t>>> prj.controller.tags['multi_dim_array'].value\r\n\t[[0, 1], [2, 3], [4, 5]]\r\n\r\n\r\nAn array's dimensions may be read with the shape attribute, which returns\r\na tuple containing the size of each dimension. The following example shows\r\noutput for a tag of type DINT[4,3,2]. Note the tuple's reversed display order\r\nas the number of elements in DimX is placed in shape[X].\r\n\r\n::\r\n\r\n\t>>> prj.controller.tags['array'].shape\r\n\t(2, 3, 4)\r\n\r\n\r\nArrays may also be resized by assigning the shape attribute to a new set\r\nof dimensions. Keep in mind the reversed appearance of dimensions described\r\nabove. Specifying a shape tuple of (x, y, z) will yield an array sized as\r\nif Dim0=x, Dim1=y, and Dim2=z were used in the Logix tag dialog. Also the\r\narray's element values and descriptions are undefined following a resize\r\noperation, even if the new shape is a subset of the original. If original\r\ncontent needs to be retained across a resize, it should be copied to\r\nseparate variables before assigning a new shape.\r\n\r\n::\r\n\r\n >>> prj.controller.tags['DINT_array'].value\r\n [0, 1, 2, 3]\r\n >>> prj.controller.tags['DINT_array'].shape = (2, 2)\r\n >>> prj.controller.tags['DINT_array'].value\r\n [[0, 0], [0, 0]]\r\n\r\n\r\nModules\r\n-------------------------\r\n\r\nThe project's modules attribute provides access to modules defined in the\r\nI/O Configuration tree. A list of modules can be obtained with the names\r\nattribute.\r\n\r\n::\r\n\r\n\t>> prj.modules.names\r\n\t['Controller', 'DOUT1', 'ENBT']\r\n\r\nEach module is comprised of a set of communication ports identified by\r\na unique integer. Ports feature a read-only type attribute to query the\r\ninterface type and a read-write address attribute to get or set the\r\ntype-specific address. A typical example for manipulating the IP\r\naddress of an Ethernet port, which is usually port 2:\r\n\r\n::\r\n\r\n\t>> prj.modules['ENBT'].ports[2].type\r\n\t'Ethernet'\r\n\t>> prj.modules['ENBT'].ports[2].address = '192.168.0.1'\r\n\r\nSafety modules, including the controller, contain a read/write snn\r\nattribute for manipulating the module's safety network number.\r\nIt evaluates to a 12-character string representing the hexadecimal\r\nsafety network number; intervening underscores as seen with RSLogix\r\nare stripped away. Acceptable values to set a new number need not be\r\nzero padded and may contain intervening underscores, however, it must\r\nbe a string yielding a hexadecimal number not exceeding 48 bits.\r\n\r\n::\r\n\r\n\t>>> prj.controller.snn\r\n\t'000011112222'\r\n\t>>> prj.modules['safe_in'].snn\r\n\t'AAAABBBBCCCC'\r\n\t>>> prj.controller.snn = '42'\r\n\t>>> prj.modules['safe_out'].snn = '0001_0002_0003'\r\n\r\n\r\n", "description_content_type": "", "docs_url": null, "download_url": "", "downloads": { "last_day": -1, "last_month": -1, "last_week": -1 }, "home_page": "http://pypi.python.org/pypi/l5x/", "keywords": "", "license": "LICENSE.txt", "maintainer": "", "maintainer_email": "", "name": "l5x", "package_url": "https://pypi.org/project/l5x/", "platform": "", "project_url": "https://pypi.org/project/l5x/", "project_urls": { "Homepage": "http://pypi.python.org/pypi/l5x/" }, "release_url": "https://pypi.org/project/l5x/1.4/", "requires_dist": null, "requires_python": "", "summary": "RSLogix .L5X interface.", "version": "1.4" }, "last_serial": 4375582, "releases": { "1.0": [ { "comment_text": "", "digests": { "md5": "d05bc572cf5315031b6cdd83ecabdea2", "sha256": "a8a2e1367a30a9a239b35890a7ec9a04dc40765da14ea2b93bd1625607747891" }, "downloads": -1, "filename": "l5x-1.0.win32.exe", "has_sig": false, "md5_digest": "d05bc572cf5315031b6cdd83ecabdea2", "packagetype": "bdist_wininst", "python_version": "any", "requires_python": null, "size": 214363, "upload_time": "2013-03-25T02:04:29", "url": "https://files.pythonhosted.org/packages/f2/b2/645d21b92db7fe587710386612c3e518ebcf073150d608e532e23dfea9fd/l5x-1.0.win32.exe" } ], "1.1": [ { "comment_text": "", "digests": { "md5": "2f858dd9bda38d03c820e4c390f9c8cc", "sha256": "b50cfde738861ac48635e232095e5cc2d792f436d257cb8afd1720b7b9b30cf9" }, "downloads": -1, "filename": "l5x-1.1.win32.exe", "has_sig": false, "md5_digest": "2f858dd9bda38d03c820e4c390f9c8cc", "packagetype": "bdist_wininst", "python_version": "any", "requires_python": null, "size": 224870, "upload_time": "2013-07-24T13:05:01", "url": "https://files.pythonhosted.org/packages/a0/16/ad8690c97bb25357f343631a368b3976f495d91ef1acf30a565caf8b4632/l5x-1.1.win32.exe" }, { "comment_text": "", "digests": { "md5": "32a9726f7662d4977beb4fd2a954d7e8", "sha256": "836c13f87d07c7252c661d970573c59b7c3419a43f0d1d16dd8922b12ce46848" }, "downloads": -1, "filename": "l5x-1.1.win-amd64.exe", "has_sig": false, "md5_digest": "32a9726f7662d4977beb4fd2a954d7e8", "packagetype": "bdist_wininst", "python_version": "any", "requires_python": null, "size": 250979, "upload_time": "2013-07-27T06:28:37", "url": "https://files.pythonhosted.org/packages/5a/a6/419c0219fba758f90b2e9be5f23a9672613d51ac387f79d2bf7d258c3573/l5x-1.1.win-amd64.exe" } ], "1.2": [ { "comment_text": "", "digests": { "md5": "f9c7b8d296afe6ba2e2d39033056e886", "sha256": "10fcda6487eebc85f6ad5f06f600b449a5e2be63b69cb401e67644271fd59b48" }, "downloads": -1, "filename": "l5x-1.2-py2.py3-none-any.whl", "has_sig": false, "md5_digest": "f9c7b8d296afe6ba2e2d39033056e886", "packagetype": "bdist_wheel", "python_version": "2.7", "requires_python": null, "size": 28191, "upload_time": "2016-08-26T22:18:35", "url": "https://files.pythonhosted.org/packages/49/cf/438a0113220b379d01a955e8dd411d5c73195339dd7b63f1c05c2c0c2c91/l5x-1.2-py2.py3-none-any.whl" }, { "comment_text": "", "digests": { "md5": "e03d7e321bb713c828309595224f84b0", "sha256": "70ebbbb71e772b83c0973313fcd4625d4e3e42422f2c631316dae3764b598ec6" }, "downloads": -1, "filename": "l5x-1.2-win32.exe", "has_sig": false, "md5_digest": "e03d7e321bb713c828309595224f84b0", "packagetype": "bdist_wininst", "python_version": "any", "requires_python": null, "size": 227894, "upload_time": "2016-08-24T22:38:54", "url": "https://files.pythonhosted.org/packages/d5/47/6b00d9d9999b7b46fac56bac99991a5a439ed855898e4f6034fd5f0136e8/l5x-1.2-win32.exe" } ], "1.3": [ { "comment_text": "", "digests": { "md5": "41a00c49ed82270541cac1752009b865", "sha256": "bac8581e2cc6e2c309adac9f43ef9ddb83c0a5263d64a3d9400ced9b9a8eb1d2" }, "downloads": -1, "filename": "l5x-1.3-py2.py3-none-any.whl", "has_sig": false, "md5_digest": "41a00c49ed82270541cac1752009b865", "packagetype": "bdist_wheel", "python_version": "py2.py3", "requires_python": null, "size": 25206, "upload_time": "2018-08-12T00:38:53", "url": "https://files.pythonhosted.org/packages/78/f7/ef572735e88346f5f0f05704250e9332f0998e820f9ced16fdf78be4f8b1/l5x-1.3-py2.py3-none-any.whl" } ], "1.4": [ { "comment_text": "", "digests": { "md5": "c818d7f33f511f93f6f40d297b5a046b", "sha256": "2911e87df456d0d62321972ceba84b77ef27ca0b2b6f40ba110d812a0a85abb5" }, "downloads": -1, "filename": "l5x-1.4-py2.py3-none-any.whl", "has_sig": false, "md5_digest": "c818d7f33f511f93f6f40d297b5a046b", "packagetype": "bdist_wheel", "python_version": "py2.py3", "requires_python": null, "size": 29487, "upload_time": "2018-10-14T23:02:25", "url": "https://files.pythonhosted.org/packages/62/f0/a561becf563f98b19e1ba4b0af47f7344b43d601f6f93efaa7e9a213e357/l5x-1.4-py2.py3-none-any.whl" } ] }, "urls": [ { "comment_text": "", "digests": { "md5": "c818d7f33f511f93f6f40d297b5a046b", "sha256": "2911e87df456d0d62321972ceba84b77ef27ca0b2b6f40ba110d812a0a85abb5" }, "downloads": -1, "filename": "l5x-1.4-py2.py3-none-any.whl", "has_sig": false, "md5_digest": "c818d7f33f511f93f6f40d297b5a046b", "packagetype": "bdist_wheel", "python_version": "py2.py3", "requires_python": null, "size": 29487, "upload_time": "2018-10-14T23:02:25", "url": "https://files.pythonhosted.org/packages/62/f0/a561becf563f98b19e1ba4b0af47f7344b43d601f6f93efaa7e9a213e357/l5x-1.4-py2.py3-none-any.whl" } ] }