The L5X Routine Replicator is a Flask application designed to work with Rockwell Automation's Studio 5000 program files. It enables users to upload a routine exported from Studio 5000 and apply a list of user-defined replacements to create a modified L5X file that can be imported back into Studio 5000 as a program.
- File Conversion: Converts an uploaded L5X file into a JSON representation for easy viewing and verification.
- File Modification: Applies bulk modifications based on user-provided replacement pairs and exports the modified L5X file.
- Secure Parsing: XML parsing is done with security in mind to prevent XXE (XML External Entity) attacks.
- Rate Limiting: Ensures that the service cannot be overwhelmed by too many requests using Flask-Limiter.
- Pretty Printing: Outputs the modified XML in a neatly formatted manner for better readability.
To get started with the L5X Routine Replicator, clone the repository and follow the installation instructions below.
Make sure you have Docker and Docker Compose installed on your system.
Clone the repository:
git clone https://github.com/DMDuFresne/L5X-Routine-Replicator.git
Navigate into the project directory:
cd L5X-Routine-Replicator
Build and run the application using Docker Compose:
docker-compose up --build -d
The application will be available at http://localhost:8000
.
The L5X Routine Replicator is a web tool designed to make it easy to modify L5X files exported from Rockwell Automation's Studio 5000. Follow this guide to learn how to use the tool for modifying and duplicating your routines.
Once you’ve set up the L5X Routine Replicator, open your web browser and go to:
http://localhost:8000
Before using the L5X Routine Replicator, you need to export a routine from Studio 5000:
- Open Studio 5000: Launch your Studio 5000 Logix Designer software.
- Select the Routine: Navigate to the routine you want to export in the Controller Organizer.
- Export Routine:
- Right-click on the routine.
- Select "Export Routine".
- Choose a location to save the file and click "Save".
You now have an L5X file that you can upload to the L5X Routine Replicator.
-
Select an L5X file: Click on the "Select an L5X file" button and choose the L5X file you want to upload from your computer.
-
Optional: Program Name: If you want to give your modified file a custom program name, enter it in the "Program Name" field.
You can define replacements to be applied to the uploaded L5X file using the replacement table.
-
Add Columns: Click the "Column" button to add columns to the replacement table. Each column represents a field you want to replace in the L5X file.
-
Add Rows: Click the "Row" button to add rows to the replacement table. Each row represents a set of replacements you want to make.
-
Editing Cells: Type the replacement values in the cells. You can add multiple replacements by adding more rows.
-
Context Menu: Right-click on headers or rows to rename or delete them.
-
Import CSV: Click the "Import" button to load a CSV file with your replacement definitions. Make sure the CSV structure matches your table.
-
Export CSV: Click the "Export" button to save your current replacement table as a CSV file for reuse or backup.
- Convert: Click the "View" button to convert the uploaded L5X file into a JSON format. The JSON tree will be shown in the "Data Viewer" section, so you can inspect the file structure and contents.
- Modify: Click the "Modify" button to apply your defined replacements to the uploaded L5X file. The modified file will automatically be downloaded to your computer.
-
Expand All: Click "Expand All" to expand all nodes in the JSON tree view and see the entire structure.
-
Collapse All: Click "Collapse All" to collapse all nodes in the JSON tree view, making it easier to navigate large files.
- The application shows a spinner overlay while processing files to let you know when the operation is in progress. Once it is complete, the new L5X file will be downloaded.
- File Size: The application can handle files up to 10 MB. Larger files won’t be accepted.
- Replacement Complexity: The tool uses simple string replacements. For more complex changes, additional processing might be needed.
- Browser Support: Use a modern web browser for the best experience. Some features might not work on older browsers.
- Security: The tool uses secure methods to prevent XML External Entity (XXE) attacks, but always be careful about the source of your L5X files.
The L5X Routine Replicator makes it easy to modify Studio 5000 L5X files. By following this guide, you can effectively use the tool to streamline your workflow.
- Rockwell Automation for the RSLogix 5000 L5X format.
- The Flask community for their comprehensive documentation and examples.
- Flask - The web framework used.
- Gunicorn - WSGI server for UNIX.
- lxml - Library for processing XML and HTML in Python.
- Flask-Limiter - For rate limiting.
- Skeleton - A simple, responsive boilerplate to kickstart any responsive project.
- Docker - To containerize the application.
- Docker Compose - To manage multi-container Docker applications.
- Dylan DuFresne - Initial work - DMDuFresne
This project is licensed under the MIT License - see the LICENSE file for details.