L5X Tools — PLC Program Analysis & Conversion
Toolchain for converting, parsing, and analyzing Allen-Bradley PLC program files (ACD → L5X → structured analysis). Powers the PLC analysis capabilities of the MCP Server and Digital Thread.
Overview
PSI stores PLC programs as ACD files (Rockwell binary format) on the K: drive. These cannot be read or analyzed programmatically. The L5X toolchain converts ACD files to L5X (Rockwell’s XML export format), then parses the L5X into structured JSON for AI agents and analysis tools.
ACD (binary)
→ l5xgit acd2l5x (Rockwell SDK) ← Preferred: true L5X conversion
→ acd_analyzer.py (hutcheb/acd-tools) ← Fallback: direct ACD extraction
→ L5X (XML)
→ l5x_parser.js (Node.js)
→ Structured JSON (controller, modules, tags, faults, I/O map)
→ MCP Server get_plc_analysis tool
→ Ask the Fleet / Claude Code / Claude Desktop
Tool 1: Rockwell VCS Custom Tools (l5xgit / l5xplode)
Source: RockwellAutomation/ra-logix-designer-vcs-custom-tools (MIT License)
Official Rockwell Automation .NET 8.0 CLI tools for working with Studio 5000 L5X project files.
| Item | Detail |
|---|---|
| Repository | C:\git\ra-logix-designer-vcs-custom-tools |
| GitHub | RockwellAutomation/ra-logix-designer-vcs-custom-tools |
| Runtime | .NET 8.0 |
| SDK Dependency | RockwellAutomation.LogixDesigner.CSClient (NuGet, from Logix Designer SDK) |
| Requires | Studio 5000 Logix Designer + Logix Designer SDK installed |
| Build output | artifacts\bin\Release\l5xgit.exe |
| Status | Built and tested — converting v34 ACD files successfully |
Commands
| Command | Tool | Description |
|---|---|---|
acd2l5x | l5xgit | Convert ACD → L5X using Logix Designer SDK |
l5x2acd | l5xgit | Convert L5X → ACD (reverse) |
explode | l5xplode | Decompose L5X into directory of XML + text files (git-friendly) |
implode | l5xplode | Recompose directory back into L5X |
commit | l5xgit | Commit exploded project to Git |
difftool | l5xgit | Diff with previous Git commit |
restoreacd | l5xgit | Restore ACD from Git |
ACD → L5X Conversion
The key command for PSI’s PLC analysis pipeline:
l5xgit acd2l5x --acd "K:\PROJECT\2399\sw\PLC\Proj2399.ACD" --l5x "K:\PROJECT\2399\sw\PLC\l5x\proj2399.L5X"Under the hood, this calls LogixProject.OpenLogixProjectAsync() → SaveAsAsync() using Rockwell’s official .NET SDK. No GUI interaction required — pure programmatic conversion.
Build Instructions
Must be built on a machine with Studio 5000 + Logix Designer SDK installed (the NuGet package comes from a local SDK directory):
cd C:\git\ra-logix-designer-vcs-custom-tools
dotnet build -c ReleaseThe NuGet config points to a local package source:
C:/Users/Public/Documents/Studio 5000/Logix Designer SDK/dotnet
L5X Explode / Implode
The explode command decomposes a monolithic L5X file into a directory structure that’s version-control friendly:
# Explode into git-friendly structure
l5xplode explode --l5x proj2399.L5X --dir proj2399/
# Implode back to L5X
l5xplode implode --dir proj2399/ --l5x proj2399.L5XThis enables diffing PLC programs between machine versions or sibling projects — directly supporting the Fleet Analysis phase of the digital thread.
Tool 2: ACD Analyzer (Python)
Source: C:\git\PLC\mcp-server\acd_analyzer.py
Python script that extracts analysis data directly from ACD files using the hutcheb/acd-tools open-source library. Does not require Studio 5000.
| Item | Detail |
|---|---|
| Location | C:\git\PLC\mcp-server\acd_analyzer.py |
| Runtime | Python 3.11 |
| Library | hutcheb/acd-tools (Python) |
| Requires | Python only — no Studio 5000 needed |
| Status | Production (deployed on PS-PROXY) |
What It Extracts
The analyzer runs a 10-step extraction pipeline:
- Extract internal ACD database using
acd-tools - Parse
TagInfo.XML(UTF-16 encoded) for tags and data types - Build project tree from internal components database
- Extract modules (Input, Output, Ethernet, DeviceNet)
- Map tags to programs and routines
- Extract rung logic (ladder text)
- Build fault/alarm catalog from tag patterns and comments
- Generate I/O cross-reference
- Produce structured JSON output
Output Format
{
"controller": { "name": "...", "processorType": "...", "majorRev": 33 },
"modules": [ { "name": "Local", "catalogNumber": "1769-L33ER", ... } ],
"tags": [ { "name": "AirPressure_Low", "dataType": "BOOL", ... } ],
"programs": [ { "name": "MainProgram_Blast", "routines": [...] } ],
"faults": [ { "name": "Air Pressure Low", "severity": "HOLD", "tag": "..." } ],
"ioMap": [ { "slot": 4, "bit": 7, "tag": "AirPressure_Low", ... } ]
}Usage
Called by the MCP server’s get_plc_analysis and analyze_acd tools:
python acd_analyzer.py "K:\PROJECT\2399\sw\PLC\Proj2399.ACD" "2399"Limitations vs L5X
| Feature | ACD Analyzer (Python) | L5X Parser (from true L5X) |
|---|---|---|
| Rung logic (structured text) | Partial extraction | Complete XML |
| Module configuration | Basic | Full (RPI, connections, IP addresses) |
| UDT definitions | Limited | Complete |
| Ethernet device discovery | No | Yes (IP addresses, data sizes) |
| MSG instructions | No | Yes |
| Safety program | No | Yes |
| Studio 5000 required | No | Yes (for conversion) |
| Speed | ~30-60 sec | ~5-10 sec (parsing only) |
Recommendation: Use the Rockwell SDK (l5xgit acd2l5x) for highest fidelity. Use the Python analyzer as a fallback when Studio 5000 is unavailable or for quick analysis.
Tool 3: L5X Parser (Node.js)
Source: C:\git\PLC\xlsxwork\l5x_parser.js
Pure JavaScript XML parser that extracts structured analysis from L5X files. No external dependencies beyond Node.js built-ins.
| Item | Detail |
|---|---|
| Location | C:\git\PLC\xlsxwork\l5x_parser.js |
| Runtime | Node.js |
| Dependencies | None (regex-based XML parsing) |
| Input | L5X file (XML) |
| Output | JSON + text reports |
What It Extracts
- Controller configuration (processor model, firmware, security)
- I/O module inventory (slot-by-slot with catalog numbers)
- Ethernet I/O devices (IP addresses, data sizes — identifies robots, VFDs)
- Complete tag list with data types and scopes
- Program/routine hierarchy with rung counts
- Complete I/O mapping (tag → slot.bit)
- Fault catalog (categorized by severity)
- Communication setup (MSG instructions)
Tool 4: ACD to L5X PowerShell Script
Source: C:\git\PLC\xlsxwork\acd_to_l5x.ps1
PowerShell batch script that converts ACD files to L5X by shelling out to LogixDesigner.exe (Studio 5000 GUI with CLI flags). Simpler but less reliable than the Rockwell SDK approach.
.\acd_to_l5x.ps1 -ProjectNumbers 2399,2386,2337 -OutputDir C:\git\PLC\l5x_exportsFeatures: ZIP extraction, SwxCF format support, companion .varCF files, smart primary ACD selection, resume mode with -Force flag.
Note: Prefer l5xgit acd2l5x (Rockwell SDK) over this script when possible — it’s more reliable and doesn’t require the GUI application.
Fleet-Wide ACD → L5X Conversion
Goal
Pre-convert all Allen-Bradley ACD files to L5X across the PSI fleet, enabling instant PLC analysis via the MCP server without requiring Studio 5000 at query time.
Fleet Inventory (Actual)
Full fleet census completed Feb 2026. See PLC Fleet Catalog for complete data.
| Metric | Count |
|---|---|
| Total projects with controller software | 1,391 |
| AB Logix 5000 projects (ACD files) | 507 |
| ACD projects with primary file identified | 489 |
| AB SLC 500 projects | 414 |
| CNC programs | 248 |
| Robots (Fanuc + ABB) | 252 |
Version Blocker
The Logix Designer SDK requires the matching Studio 5000 version installed to open each ACD. Current install: v34 only.
| Version | Projects | Cumulative |
|---|---|---|
| v34 (installed) | 90 | 18% |
| v20 | 178 | 55% |
| v12 (legacy) | 142 | 84% |
| v15, v17, v33, other | 79 | 100% |
Next step: Install Studio 5000 v20 to unlock 178 more projects (55% total).
Conversion Approaches
There are two ways to run fleet-wide conversion:
1. PLC Conversion Runner (Automated Service)
The PLC Conversion Runner (PSI.PlcRunner) is a .NET 8 HTTP service on PS-PLCRunner that wraps l5xgit.exe with a REST API, job queue, and scheduled nightly scanning. This is the primary production approach.
- Runs at 2 AM daily, scanning all projects for unconverted ACD files
- On-demand conversion via
POST http://ps-plcrunner:3200/api/convert - Falls back to Python
acd_analyzer.pywhen SDK conversion fails
2. PowerShell Batch Scripts (Manual/Ad-hoc)
Scripts in C:\git\PLC\scripts\ for manual batch operations:
Build-AcdInventory.ps1— Scans 16 folder types +sw\root, scores and selects primary ACD per projectScan-AcdVersions.ps1— Reads version from ACD plaintext header (no SDK needed)Run-BatchConversion.ps1— Batchl5xgit acd2l5xwith timeout, resume mode, version extraction, centralized loggingRun-BatchAnalysis.ps1— Runsl5x_parser.json converted L5X files to generate analysis JSONcompute-scorecards.js— Generates 4-dimension PLC code scorecards from analysis data
L5X output stored at K:\PROJECT\{job}\sw\PLC\l5x\{filename}.L5X
Conversion Status
| Status | Projects |
|---|---|
| Converted (v34) | ~90 (in progress) |
| Blocked (version mismatch) | ~399 |
| Total | 489 |
MCP Server Integration
The MCP Server’s get_plc_analysis tool uses a fallback chain:
- Check for cached
plc_analysis_{job}.json→ return immediately - Check for L5X in
{job}/sw/PLC/l5x/→ parse withl5x_parser.js→ cache → return - Call PLC Conversion Runner to convert ACD → L5X on demand → parse → return
- Check for ACD → analyze with
acd_analyzer.py→ cache → return - Fall back → check BOM for PLC hardware identification
Non-AB PLC Systems
Not all PSI machines use Allen-Bradley. The fleet census identified Fanuc robots (116), ABB robots (136), CNC (248), SLC 500 (414), PLC-5 (24), SmartGuard (18), and Siemens (1). When no ACD/L5X file exists, the MCP Server falls back to BOM-based PLC identification.
Related Pages
- PLC Conversion Runner — HTTP service wrapping l5xgit for on-demand and scheduled fleet conversion
- PLC Fleet Catalog — Complete inventory of all controller software across the fleet (1,391 projects, version distribution, conversion status)
- PLC Fleet Archive — Git-backed version control and change tracking for PLC programs
- MCP Server — AI tools that consume PLC analysis (get_plc_analysis, analyze_acd, find_acd_files)
- PSI Explorer — “Ask the Fleet” AI chat uses PLC analysis data
- Digital Thread — Full machine analysis methodology (Layer 1: Control Logic)
- DwgToPdf — Sister CLI tool for DWG → PDF conversion
- PSI Export CLI — BOM/data export CLI tool