UNPKG

major-ai-skills

Version:

Installable agentic skills / AI agent skills (SKILL.md) for Claude Code, Cursor, Codex CLI, Gemini CLI & Antigravity - 402+ professional app, token-efficiency, and common-sense skills. SEO/GEO ready.

124 lines (95 loc) 7.66 kB
--- title: "Rockwell Studio 5000 Logix Designer AI Skill Guide (GPT & Codex)" description: "Comprehensive operational skill specification for OpenAI GPT and Codex to automate, script, troubleshoot, and optimize Studio 5000 Logix Designer, L5X XML generation, EtherNet/IP CIP automation (pycomm3), and Add-On Instructions (AOI)." category: "Allen-Bradley PLC Programming & Control Design" tags: ["rockwell-studio-5000", "l5x-generator", "pycomm3-automation", "aoi-definition", "gpt-codex", "cip-ethernet-ip"] --- # Rockwell Studio 5000 Logix Designer AI Skill Guide (GPT & Codex) ## Overview & Engine Architecture Rockwell Studio 5000 Logix Designer supports programmatic project engineering via the **L5X XML schema specification**, **CIP EtherNet/IP socket communication (`pycomm3`)**, and modular **Add-On Instructions (AOI)**. GPT/Codex acts as a Principal Industrial Controls Software Engineer and Allen-Bradley Automation Developer, delivering **programmatic L5X XML rung and tag generators**, **EtherNet/IP telemetry and batch setpoint clients**, **reusable AOI libraries**, and **automated test harnesses**. ### Developer Architecture & L5X Automation Stack ``` ┌─────────────────────────────────────────────────────────────┐ │ Studio 5000 Developer Platform │ │ │ │ L5X XML Schema & Meta-Programming │ │ ├── `RSLogix5000Content` Root Element & Target Descriptor │ │ ├── Structured Text & Ladder Rung Serialization (`<Rung>`) │ │ └── Add-On Instruction (AOI) Definition & Logic Containers │ │ │ │ CIP Communication & Telemetry Subsystems │ │ ├── EtherNet/IP CIP Protocol Client (`pycomm3.LogixDriver`)│ │ ├── Multi-Service Request Batching (High Throughput Reads) │ │ └── UDT Dynamic Struct Unpacker & Data Type Marshalling │ └─────────────────────────────────────────────────────────────┘ ``` --- ## Operational Capabilities & Agent Directives 1. **Programmatic L5X XML Generation**: Author Python scripts to dynamically generate valid Studio 5000 `.L5X` import files containing controller tags, UDT schemas, and ladder logic rungs. 2. **High-Throughput CIP Data Harvesting (`pycomm3`)**: Write Python pipelines utilizing CIP multi-service request batching to stream high-frequency telemetry ($>50\text{Hz}$) from ControlLogix processors into time-series databases (InfluxDB, TimescaleDB). 3. **Add-On Instruction (AOI) XML Authoring**: Generate encapsulated AOI XML blocks with input parameters, output parameters, local tags, and Structured Text logic routines. 4. **Automated Tag Verification & Migration**: Build scripts comparing online PLC tag databases against offline design spreadsheets to identify unmapped addresses. --- ## Production Python Automation: Automated L5X Ladder Rung Generator Save this script as `generate_l5x_rungs.py` to programmatically build an importable `.L5X` file containing motor start/stop ladder rungs: ```python """ Rockwell Studio 5000 L5X XML Ladder Rung Generator Generates an importable .L5X XML fragment containing standard motor interlock ladder rungs. """ import sys import xml.etree.ElementTree as ET def generate_motor_l5x(motor_name: str, output_file: str): print(f"--- [GENERATING STUDIO 5000 L5X LADDER RUNGS: {motor_name}] ---") # 1. Root Element root = ET.Element("RSLogix5000Content", { "SchemaRevision": "1.0", "SoftwareRevision": "33.00", "TargetName": "Packaging_PLC", "TargetType": "Routine", "ContainsContext": "true" }) controller = ET.SubElement(root, "Controller", {"Use": "Context", "Name": "Packaging_PLC"}) programs = ET.SubElement(controller, "Programs", {"Use": "Context"}) program = ET.SubElement(programs, "Program", {"Use": "Context", "Name": "MainProgram"}) routines = ET.SubElement(program, "Routines", {"Use": "Context"}) routine = ET.SubElement(routines, "Routine", {"Use": "Target", "Name": f"{motor_name}_Control", "Type": "RLL"}) rll_content = ET.SubElement(routine, "RLLContent") # 2. Rung 0: Motor Start/Stop Seal-In Circuit # Ladder Text: [XIC(PB_Start) , XIC(Motor_Run_Out)] XIO(PB_Stop) XIO(Motor_Overload) OTE(Motor_Run_Out); rung0 = ET.SubElement(rll_content, "Rung", {"Number": "0", "Type": "N"}) comment0 = ET.SubElement(rung0, "Comment") comment0.text = f"<![CDATA[Standard 3-Wire Motor Seal-In Circuit for {motor_name} with Overload Protection.]]>" text0 = ET.SubElement(rung0, "Text") text0.text = f"<![CDATA[[XIC({motor_name}_Start_PB) , XIC({motor_name}_Run_Out)] XIO({motor_name}_Stop_PB) XIO({motor_name}_Overload_Tripped) OTE({motor_name}_Run_Out);]]>" tree = ET.ElementTree(root) ET.indent(tree, space=" ", level=0) tree.write(output_file, encoding="utf-8", xml_declaration=True) print(f"✅ Successfully generated Studio 5000 L5X routine: {output_file}") print("To import: In Studio 5000, right-click Routine folder -> Import Routine -> select this L5X file.") if __name__ == "__main__": out = sys.argv[1] if len(sys.argv) > 1 else "Motor01_Routine.L5X" generate_motor_l5x("Conveyor_M101", out) ``` --- ## Technical Troubleshooting Matrix | Issue & Failure Signature | Root Cause Analysis | Diagnostic & Resolution Pathway | | :--- | :--- | :--- | | **L5X Import Fails: `XML syntax error on line X`** | CDATA encapsulation missing or invalid character entity in ladder rung text. | Ensure rung logic strings are enclosed in `<![CDATA[ ... ]]>` blocks and end with a semicolon `;`. | | **`pycomm3.LogixDriver` Connection Drops on Batch Read** | Exceeded maximum CIP packet payload size ($508\text{ bytes}$) without automatic multi-request splitting. | `pycomm3` handles multi-request packing automatically; ensure firmware supports CIP multi-service (Firmware $\ge \text{v20}$). | | **AOI Verification Error: `Local tag cannot be alias`** | Add-On Instruction attempted to declare an internal tag as an alias to a global controller tag. | AOI local tags must be private memory instances; use In/Out parameters to pass external tag references into AOIs. | | **L5X Import Fails with Target Type Mismatch** | Root tag `TargetType` does not match the import context (e.g. importing `Routine` into `ControllerTags`). | Ensure `TargetType` matches the destination node (`Controller`, `Program`, `Routine`, or `AddOnInstructionDefinition`). | --- ## Command Line Syntax & Batch Processing ```bash # Validate L5X XML Structure via Python python3 -c "import xml.etree.ElementTree as ET; ET.parse('Motor01_Routine.L5X'); print('L5X Valid!')" # Run Batch CIP Tag Monitor via pycomm3 python3 -c "from pycomm3 import LogixDriver; plc = LogixDriver('192.168.1.10'); print(plc.open()); print(plc.read('System_Heartbeat')); plc.close()" ``` ### Essential File Locations - **Studio 5000 Projects**: `*.ACD` - **L5X Schema Files**: `*.L5X` --- ## Agent Operational Directive > **MANDATORY**: When authoring ladder logic strings in L5X XML files, always terminate each rung statement with a semicolon `;` and wrap the text within `<![CDATA[ ... ]]>` tags.