RSLogix .L5X interface.
Project description
This package aims to implement an interface for manipulating content of RSLogix .L5X export files using a native Pythonic approach as opposed to dealing with raw XML.
Getting Started
All access to .L5X data is through a top-level Project object, instantiated by passing a filename to the constructor. If the project is to be modified the write method writes the updated data back to a file for importing into RSLogix. Typical execution flow is as follows:
import l5x prj = l5x.Project('project.L5X') # Read or modify data as needed. prj.write('modified.L5X')
Controller
The controller attribute of a project has the following attributes:
- tags:
A tag scope containing controller tags; see Tags.
- comm_path:
Permits reading and modifying the controller’s communication path. Setting to None will delete the communication path.
>>> prj.controller.tags['tag_name'].description = 'A controller tag' >>> prj.controller.comm_path 'AB_ETHIP-1\\192.168.1.10\\Backplane\\0'
Programs
A project’s programs attribute contains a names attribute that evaluates to a list of program names, members of which can be used as indices to access program-scoped tags.
>>> prj.programs.names ['MainProgram', 'AnotherProgram'] >>> prj.programs['MainProgram'].tags['a_program_tag'].value = 50
Project details
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.