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.

ItemDetail
RepositoryC:\git\ra-logix-designer-vcs-custom-tools
GitHubRockwellAutomation/ra-logix-designer-vcs-custom-tools
Runtime.NET 8.0
SDK DependencyRockwellAutomation.LogixDesigner.CSClient (NuGet, from Logix Designer SDK)
RequiresStudio 5000 Logix Designer + Logix Designer SDK installed
Build outputartifacts\bin\Release\l5xgit.exe
StatusBuilt and tested — converting v34 ACD files successfully

Commands

CommandToolDescription
acd2l5xl5xgitConvert ACD → L5X using Logix Designer SDK
l5x2acdl5xgitConvert L5X → ACD (reverse)
explodel5xplodeDecompose L5X into directory of XML + text files (git-friendly)
implodel5xplodeRecompose directory back into L5X
commitl5xgitCommit exploded project to Git
difftooll5xgitDiff with previous Git commit
restoreacdl5xgitRestore 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 Release

The 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.L5X

This 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.

ItemDetail
LocationC:\git\PLC\mcp-server\acd_analyzer.py
RuntimePython 3.11
Libraryhutcheb/acd-tools (Python)
RequiresPython only — no Studio 5000 needed
StatusProduction (deployed on PS-PROXY)

What It Extracts

The analyzer runs a 10-step extraction pipeline:

  1. Extract internal ACD database using acd-tools
  2. Parse TagInfo.XML (UTF-16 encoded) for tags and data types
  3. Build project tree from internal components database
  4. Extract modules (Input, Output, Ethernet, DeviceNet)
  5. Map tags to programs and routines
  6. Extract rung logic (ladder text)
  7. Build fault/alarm catalog from tag patterns and comments
  8. Generate I/O cross-reference
  9. 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

FeatureACD Analyzer (Python)L5X Parser (from true L5X)
Rung logic (structured text)Partial extractionComplete XML
Module configurationBasicFull (RPI, connections, IP addresses)
UDT definitionsLimitedComplete
Ethernet device discoveryNoYes (IP addresses, data sizes)
MSG instructionsNoYes
Safety programNoYes
Studio 5000 requiredNoYes (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.

ItemDetail
LocationC:\git\PLC\xlsxwork\l5x_parser.js
RuntimeNode.js
DependenciesNone (regex-based XML parsing)
InputL5X file (XML)
OutputJSON + 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_exports

Features: 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.

MetricCount
Total projects with controller software1,391
AB Logix 5000 projects (ACD files)507
ACD projects with primary file identified489
AB SLC 500 projects414
CNC programs248
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.

VersionProjectsCumulative
v34 (installed)9018%
v2017855%
v12 (legacy)14284%
v15, v17, v33, other79100%

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.py when SDK conversion fails

2. PowerShell Batch Scripts (Manual/Ad-hoc)

Scripts in C:\git\PLC\scripts\ for manual batch operations:

  1. Build-AcdInventory.ps1 — Scans 16 folder types + sw\ root, scores and selects primary ACD per project
  2. Scan-AcdVersions.ps1 — Reads version from ACD plaintext header (no SDK needed)
  3. Run-BatchConversion.ps1 — Batch l5xgit acd2l5x with timeout, resume mode, version extraction, centralized logging
  4. Run-BatchAnalysis.ps1 — Runs l5x_parser.js on converted L5X files to generate analysis JSON
  5. compute-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

StatusProjects
Converted (v34)~90 (in progress)
Blocked (version mismatch)~399
Total489

MCP Server Integration

The MCP Server’s get_plc_analysis tool uses a fallback chain:

  1. Check for cached plc_analysis_{job}.json → return immediately
  2. Check for L5X in {job}/sw/PLC/l5x/ → parse with l5x_parser.js → cache → return
  3. Call PLC Conversion Runner to convert ACD → L5X on demand → parse → return
  4. Check for ACD → analyze with acd_analyzer.py → cache → return
  5. 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.


  • 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