Bring software-engineering discipline to PLC code
CtrlLens turns a Studio 5000 project into a version-controlled, reviewable, AI-ready codebase. This guide walks the full workflow — from install to CI/CD — feature by feature. Works in VS Code and Cursor on Windows, macOS, and Linux.
What CtrlLens does
Git was built for text. A Studio 5000 project is a proprietary binary (.ACD) or one dense XML file (.L5X) — so plain Git gives you no diff, no review, no merge. CtrlLens closes that gap: it explodes the project into a per-routine tree, renders every change visually, resolves merge conflicts rung by rung, and keeps an always-current briefing on disk for your AI assistant.
CtrlLens is not a replacement for Studio 5000 — it is complementary. Studio 5000 owns hardware configuration, compilation, download, and online monitoring. CtrlLens owns the software-engineering layer Studio 5000 leaves open: version control, code review, multi-developer collaboration, CI/CD, and cross-platform access.
Readable diffs
Fearless merge
AI-ready
Install & activate the extension
Install CtrlLens from the VS Code Marketplace — it runs in both VS Code and Cursor, from a single VSIX, on Windows, macOS, and Linux. Free features work immediately — no account, no network. The extension wakes up automatically when the workspace contains Logix files (the triggers below) and stays dormant otherwise.
Extension load triggers
RSLogix5000Content/RSLogix5000Content.xml— an exploded projectacd_sync_config.yaml— a configured project- any
*.l5xor*.L5Xfile
Activate Pro
Free needs nothing. To unlock Pro (Git, Visual Diff, editing, Merge UI, AI Context) you activate a license once — pick the path that matches your machine:
| Path | What you do | Result |
|---|---|---|
| 14-day trial | On the Activate page in your dashboard, click Start 14-day trial — it's free. | Full Pro for 14 days on this machine, then it reverts to Free. |
| Online (default) | In the extension, run CtrlLens: Activate License and paste your key (or click Activate in your dashboard). Your browser confirms it's you and the license is sent back to the editor automatically — no files to handle. | Pro unlocked. The extension re-checks every ~12 h while online; one active device at a time (activating elsewhere takes over the slot). |
| Offline / air-gapped | Run CtrlLens: Export Activation Request, carry it to a connected PC, issue a signed license.dat on the Activate page, copy it back, then run CtrlLens: Import License File. | Pro works fully offline until the license expires — no network ever. |
Requirements
- Git must be installed — the version-control, diff, and merge features depend on it. If you don't already have it, download and install from git-scm.com (most PLC / electrical engineers won't have Git yet; the default installer options are fine).
- No CLI tools to install — L5X explode / implode and all Git operations run fully inside the extension on every platform, with zero setup.
- ACD ↔ L5X conversion needs the Logix Designer® SDK 2.2 (the
2.2.xbackend — CtrlLens pins the2.2.1109client; Windows only, installed via the Studio 5000 SDK installer). The smallctrllens-acdhelper that drives it is bundled with the Windows build. The SDK is auto-detected; every other feature — preview, Git, diff, merge, editing,.L5Ximport / export — works without it, on all platforms.
Extension settings
CtrlLens works with zero configuration. Explode / implode and Git run in-process — there are no CLI paths to set. The ACD ↔ L5X converter (ctrllens-acd, Windows only) ships inside the extension and is resolved automatically; you never point at it. The only optional setting is the SDK location, and even that is auto-detected:
| Setting | Default | When to set it |
|---|---|---|
ctrllens.logixDesignerSdkPath | empty → auto-detected (Windows) | Only if Studio 5000 / the SDK is installed to a non-default location. Auto-filled on first launch when found. |
ctrllens-acd converter is bundled and resolved automatically — there are no CLI paths to set, and an upgrade never breaks a hard-coded path.Logix Designer SDK (Windows only) — version 2.2.x required (the bundled ctrllens-acd is built against the 2.2.1109 client and must match the installed SDK 2.2 backend). Example default install location:
C:\Program Files (x86)\Rockwell Software\Studio 5000\Logix Designer SDK
CtrlLens auto-detects this on launch and fills the setting for you. If it isn't found, CtrlLens shows a one-time prompt with install / set-path options — or set ctrllens.logixDesignerSdkPath manually.
Behavior & display settings
| Setting | Purpose |
|---|---|
ctrllens.defaultViewMode | Default view mode: preview or xml. |
ctrllens.validateInViewMode | Pro. Live-validate routines while only viewing them (red-highlight invalid operands and the rung wire). Off by default — edit mode always validates regardless of this setting. |
ctrllens.merge.showReviewOnSuccess | After a no-conflict git merge, show a Merge Review panel summarising the routine changes about to be committed (default: true). |
ctrllens.git.historyLimit | Maximum commits fetched for git history queries — routine history, branch picker, and repo commit list (default: 100). |
New / Open / Close a project
The VCS Sync panel exposes the universal IDE triad. Each verb maps to a command:
| Action | What it does | Platform |
|---|---|---|
| New Project… | One unified picker for an .ACD or an .L5X. An .L5X is exploded directly (SDK-free) → git init → initial commit. An .ACD is auto-converted (acd2l5x) → exploded → committed. | .L5X: all platforms. .ACD: Windows + SDK |
| Open Project… | Attach an existing exploded folder; validates the RSLogix5000Content/ marker, offers git init if needed, and auto-links the ACD from acd_sync_config.yaml when present. | All platforms — never touches the SDK |
| Close | Reset the configured paths (deletes nothing on disk). | All platforms |
First-time setup
- 1Open the CtrlLens sidebar from the Activity Bar. The VCS Sync panel shows “No project configured”.
- 2Click New Project… and pick an
.L5X(works everywhere, no SDK) or an.ACD(auto-converted on Windows + SDK) — or Open Project… to attach an already-exploded folder. - 3The ACD is an optional, per-project property. With no ACD linked the panel runs in L5X mode (Sync from L5X); ACD-only actions stay disabled with an explanatory tooltip until an ACD is linked or generated.
Joining an existing project (clone onboarding)
- 1
git clone <repo-url>the project repository and open the folder in VS Code. - 2CtrlLens detects the exploded structure and prompts: “Detected a CtrlLens project. Associate a local ACD file?”
- 3Click Select ACD File to link your local ACD, or Later to skip and work in L5X mode.
Manual path configuration
If the onboarding prompt was dismissed, configure paths directly in the VCS Sync panel: click ... next to GIT REPO to browse for the project folder, and ... next to ACD to browse for the ACD file.
Diagram preview — RLL, FBD, SFC, ST
Click any routine in the Project Organizer to open it. Graphical languages (RLL/FBD/SFC) render on a Konva canvas; Structured Text opens in VS Code’s native Monaco editor with PM007-conformant syntax highlighting (100+ Rockwell instructions, bit access, region folding, conversion functions).
Canvas navigation
| Action | Input |
|---|---|
| Pan | Click and drag on empty canvas area |
| Zoom in / out | Ctrl = / Ctrl -, or Ctrl + scroll |
| Reset zoom | Ctrl 0 |
| Set exact zoom | Click the percentage in the status bar and type a value (30%–300%) |
Toolbar & status bar
- Breadcrumb —
Task > Program > Routinepath, with badges for routine type and rung count. - Edit button — toggles Preview ↔ Edit mode (exploded projects only). See Interactive editing.
- </> XML button — exposes the routine source to AI tools. See AI context.
- Status bar — rung info and modified indicator on the left, zoom controls on the right.
Interactive editing
Toggle the Edit button in the toolbar to enter edit mode. Editing is available for exploded projects only (not single .L5X files) and requires a Pro license.
Inline editing — three trigger zones (RLL)
| Zone | Trigger | Editor |
|---|---|---|
| Operand text | Double-click the operand label | Tag editor with autocomplete from project tags + Tag Browser dropdown (Ctrl Space / Alt ↓) |
| Mnemonic title bar | Block: double-click above the wire. Contact/Coil/Res: double-click on the graphic strip | Mnemonic editor with autocomplete from the full Rockwell catalog + project AOIs; operands carry over by position |
| Numeric value cell | Double-click the value-below cell on a tall row | Single-line value editor; persists to the tag XML on save |
Press Enter or Tab to confirm (Tab also advances to the next operand in tag-edit mode); Escape cancels. Double-click the comment line above a rung for a multi-line comment editor.
Selection, drag & drop, context menu
- Select — click an instruction or rung number; Ctrl+click to multi-select; Shift+click a rung number for a range; click a branch node (Start/Middle/End) to scope to the branch or path.
- Drag an instruction to move it (within or across rungs); Ctrl+drag to duplicate; drag a rung number to reorder rungs.
- Right-click an instruction, rung number, or branch node for Cut / Copy / Paste / Duplicate / Delete (plus Insert Rung After on rungs).
- Branch editing —
+Branchinserts a branch at the selection;+BrLvladds a parallel path. Deleting the second-to-last path auto-unwraps the branch.
SFC Action body / Transition editing
Inside the SFC editor, double-click an Action body or a Transition condition to open its ST code in a side Monaco tab (a virtual .st file). Edit, Ctrl S, and the content round-trips back into the SFC XML — the canvas refreshes automatically. Because the virtual file is a real document, AI tools can read and write these bodies directly.
Save flow
- Ctrl S (or the Save button) runs roundtrip validation (parse → serialize → parse) before writing the exploded XML.
- Closing a modified tab fires VS Code’s native “Do you want to save the changes?” modal — Save / Don’t Save / Cancel.
- Triggering Sync from ACD, a branch switch, or Merge while routines are dirty aggregates all modified tabs into one combined save prompt; Cancel aborts the upstream operation cleanly.
Tag insight, live values & Cam Editor
Tag hover popup
Hover any tag-bearing element for 500 ms to see a Studio 5000-style tooltip, available across RLL, FBD, SFC, and ST. The field set adapts to the operand kind:
| Operand kind | Fields shown |
|---|---|
Plain tag (MyBit, Servo) | Tag · Data Type · Scope · Usage · Alias For · Value · Description |
Member access (MyTimer.PRE) | Tag Element · Tag Data Type (base tag) · Usage · Scope · Alias For · resolved Value · Description |
| Non-tag slots (JSR / JMP / LBL / FOR / EVENT / SFR / GSV) | Dedicated labels — Routine:, Label:, Task:, Step:, Class/Instance/Attribute: |
| Undefined tag | Red border + Undefined Tag: <name> |
System status flag (S:FS, S:MINOR …) | Status Flag · Name · Access (read-only / read-write) · Description — type s: in a tag editor to autocomplete all seven flags; write slots only offer the writable ones |
The popup is read-only and never blocks clicks or drags. Sweeping to a different operand re-arms the 500 ms delay so it doesn’t flicker.
Live tag values & power-flow
- Block instructions — each numeric operand row shows the resolved value in a value box below the operand text (Studio 5000 data-monitor style).
- BOOL highlight — BOOL operand rows get a green square at the right edge when the value is
1. - Contact / Coil power flow — when the underlying BOOL is
1, the left/right wire stubs highlight green. - Editing values (Edit mode, RLL) — double-click a value cell, type, Enter, then Ctrl S. CtrlLens writes back to the tag XML following program-local-then-controller scope rules; undo/redo keeps logic and values in lockstep.
Cam Editor (Motion CAM operands)
Block operand rows that accept a CAM-family tag render a … affordance. Click it to open the Studio 5000-style Cam Editor:
| Data type | Mode |
|---|---|
CAM / CAM_EXTENDED | Fully editable — add/edit/delete points, edit Master/Slave/SegmentType; Save writes back to the tag XML |
CAM_PROFILE / CAM_PROFILE_EXTENDED | Read-only — the L5K polynomial cache is generated by MCCP at runtime |
Position / Velocity / Acceleration / Jerk curves are drawn with a natural cubic spline (analytic derivatives), styled to match Studio 5000 Graph Properties, with pan/zoom and a resizable point table.
VCS Sync panel
The VCS Sync panel is the central hub for all synchronization and Git operations. When configured it shows GIT REPO & ACD paths, the current branch, last commit time, ahead/behind sync status (e.g. ↑2 ↓1), and the remote URL.
ACD Modified banner
CtrlLens polls the ACD file’s modification time every 10 seconds. When Studio 5000 saves the ACD, a yellow ACD Modified — needs sync banner appears.
Git operations
| Button | Action |
|---|---|
| Push | Push commits to remote (prompts to set one up if none) |
| Pull | Pull from remote (rebase/merge strategy selection) |
| Branch | Create / switch / delete branches; offers Stash & Switch if dirty |
| Restore | Discard all uncommitted changes (with confirmation) |
| Stash / Pop (N) | Stash working changes; Pop the most recent stash |
| Merge | Merge another branch in; shows Abort during a merge |
Sync operations
The panel adapts to the project’s mode, derived from whether an ACD is linked and whether the SDK is available.
| Mode | Buttons |
|---|---|
| ACD mode | Sync from ACD (ACD → L5X → Explode → diff), Restore to ACD (Implode → L5X → ACD), Restore to… (Save As), Refresh |
| L5X mode | Sync from L5X (SDK-free, all platforms), Generate ACD (optional upgrade once the SDK is available), Refresh |
Content table
Shows per-component change status after syncing — Name (Program / Tags / DataTypes / Modules / Tasks), Status (Synced / Modified / Untracked), and a rung-level Changes summary (e.g. +2 ~1 -0 rungs). Click the Content header to collapse/expand; the state persists.
Commit
- 1Type a commit message in the text area at the bottom of the panel.
- 2Click Commit Changes (enabled only when modified items exist).
- 3CtrlLens commits all changes in the exploded project directory.
SDK detection & platform gating
.ACD conversion requires the Logix Designer SDK (Windows only); the .L5X path is SDK-free everywhere. New Project… / Open Project… / Refresh are never gated — only ACD-specific buttons are.
| Environment | ACD path row | Sync from ACD / Restore | Sync from L5X |
|---|---|---|---|
| Windows + SDK detected | Visible, enabled | Enabled | Available when no ACD linked |
| Windows + SDK missing | Visible, disabled with tooltip | Disabled, tooltip points to ctrllens.logixDesignerSdkPath | Available |
| macOS / Linux | Hidden | Hidden | Available |
Auto-detection checks your configured path first, then the standard Rockwell install locations; the detected directory is written back to the setting so it shows in the Settings UI. Override it via File → Preferences → Settings → “ctrllens” — the Sync panel re-renders immediately, no reload needed.
Visual diff & code review
Default diff mode (HEAD vs working tree)
The Project Organizer decorates nodes against the last commit: ~M modified (yellow), +A added (green), -D deleted (red). Click any decorated node to open its diff.
Commit-to-commit diff
- 1Click Compare Commits (git-compare icon) in the Project Organizer title bar.
- 2Pick the FROM and TO commits (or “Working Tree”). The picker spans all branches; branch tips show ref labels like
HEAD -> main. - 3The tree updates with decoration badges. Click the Home button to return to HEAD vs Working Tree.
Routine-level diff
Right-click a Routine for View Diff — Compare Two Commits or Show Routine Commit History. Each language gets its own diff view:
| Language | Diff view |
|---|---|
| RLL | Side-by-side Konva canvas; added green / deleted red / modified yellow / unchanged collapsed; Toggle Unchanged, Reselect FROM/TO, zoom controls |
| FBD | Side-by-side canvas with element-border status colors, dimmed unchanged elements, a change navigator, and a sheet selector |
| SFC | Side-by-side canvas with a collapsible Detail Panel showing text-level diff of Action bodies / Transition conditions |
| ST | Block-level structural diff (IF/FOR/WHILE/CASE) plus an Open Monaco Diff button for native line-by-line |
Tags & program diff
- Right-click a Tags folder for View Tags Diff — Compare Two Commits or history — added/deleted/modified tags with name, type, value, and comment changes.
- Right-click a Program for Diff All Routines in Program vs HEAD — a summary of every routine change in the program.
Visual merge & conflict resolution
When a Git merge conflicts in a graphical routine, CtrlLens opens a visual side-by-side merge view. It reads the three Git index stages (base / ours / theirs) directly rather than parsing conflict markers, so both sides always render as valid diagrams. Granularity depends on the language:
| Language | Merge unit | Accept options |
|---|---|---|
| RLL | Rung-by-rung | Accept Ours / Theirs / All per rung, plus batch All Ours / All Theirs |
| FBD | Per-sheet | Accept Ours / All (keep both) / Theirs per changed sheet |
| SFC | Whole-routine | Accept Ours / Theirs (single connected chart, no per-element pick) |
- 1Click Merge in the Sync Panel after a conflicted pull.
- 2Conflicted routines appear in the tree with
U(unresolved) status; click one to open the matching Merge View. - 3Pick a winner per unit. For FBD, base-aware auto-seeding pre-resolves sheets that changed on only one side.
- 4Click Confirm & Resolve to write the merged result. In-flight picks are saved to
.git/ctrllens-merge-draft.jsonand restored if VS Code restarts mid-merge. - 5Conflicts CtrlLens cannot render (ST, tag definitions, add/add with no base) fall back to VS Code’s native merge editor. Abort Merge returns to the pre-merge state.
Merge Review on a clean merge
Even when a git merge finishes with no conflicts, CtrlLens pops a Merge Review panel summarising the routine changes about to be committed — so an automated or fast-forward merge never lands unseen. Turn it off with ctrllens.merge.showReviewOnSuccess: false.
Verify, validate & the pre-commit gate
CtrlLens statically validates a project against the instruction catalog and Studio 5000 scope rules, surfacing issues in VS Code’s native Problems panel.
| Command | Scope |
|---|---|
CtrlLens: Verify Routine | The open routine (also on the Ladder / FBD / SFC edit toolbar — uses the unsaved canvas snapshot so in-flight edits are checked) |
CtrlLens: Verify Controller | The whole project — also on the Project Organizer root Controller <name> right-click menu (Pro) |
What it checks
- Tag references resolve across all four scopes (Program-local / Controller / AOI parameter / AOI local tag)
- Operand kind / Type / Format / exhaustive-enum, from the htm-extracted full instruction catalog
- No duplicate rung numbers; routine names unique within a Program; no cross-scope duplicate tag names
- FBD orphan blocks; SFC Step ↔ Transition alternation
- Periodic-task overlap static estimate (rung-count × 10 µs vs Task rate)
- Instruction ↔ editor-language compatibility (RLL / FBD / ST); ST syntax (bracket pairing, keyword spelling)
- System status flag access rules (S:FS, S:N, S:Z, S:V, S:C, S:MINOR, S:R) — a read-only flag used as the target of a writing instruction is a precise error, exactly as Studio 5000 verify behaves
Navigation, live feedback & gate
- Click a Problems entry to open the routine and scroll the canvas to the offending rung / block / element; F8 cycles natively.
- Live red highlight — a rung wire turns red the instant an operand is invalid and recovers when you type a valid tag or Ctrl Z; FBD/SFC shapes border red the same way. On by default in edit mode only — view mode stays clean because an imported L5X is already Studio 5000-valid, so any view-mode red would be a validator false positive. Pro users can opt into view-mode highlighting with
ctrllens.validateInViewMode; the on-demand Verify commands report to the Problems panel regardless of mode. - Pre-commit gate — before a Sync Panel commit, error-severity issues show a modal: Commit Anyway proceeds, Fix First jumps to the Problems panel.
Multi-developer team workflow
Studio 5000 authors the logic; CtrlLens turns each project into a branchable, reviewable Git repo. Two PLC engineers work in parallel, while a senior engineer reviews and merges their pull requests — without ever installing Studio 5000, on any OS. Each step below is tagged with the tool that performs it, so you can see exactly where CtrlLens takes over from Studio 5000.
Exploded L5X · feature branches · pull requests
push → review → Merge / Rebase → pull
Developer A
PLC Engineer
Studio 5000 + CtrlLens · Windows
- 1Author logic (RLL / FBD / ST)Studio 5000
- 2Save the ACD projectStudio 5000
- 3Sync ACD → L5X (explode to Git)CtrlLens
- 4Commit & push a feature branchCtrlLens
- 5Open a Pull Request for reviewCtrlLens
- 6Pull merged main, Restore to ACDCtrlLens
- 7Reopen the ACD to keep buildingStudio 5000
- 8Onsite CommissioningStudio 5000
Developer B
PLC Engineer
Studio 5000 + CtrlLens · Windows
- 1Author logic (RLL / FBD / ST)Studio 5000
- 2Save the ACD projectStudio 5000
- 3Sync ACD → L5X (explode to Git)CtrlLens
- 4Commit & push a feature branchCtrlLens
- 5Open a Pull Request for reviewCtrlLens
- 6Pull merged main, Restore to ACDCtrlLens
- 7Reopen the ACD to keep buildingStudio 5000
- 8Onsite CommissioningStudio 5000
Senior Engineer
Code Reviewer
CtrlLens only · any OS
- 1Pull the Pull Request branchCtrlLens
- 2Visual diff: RLL / FBD / SFC / STCtrlLens
- 3Comment & request changesCtrlLens
- 4Resolve merge conflicts visuallyCtrlLens
- 5Approve & merge to mainCtrlLens
Run PLC code review, version control, and merges anytime, on any OS — even on a machine that doesn't have Windows or Studio 5000 installed.
Local configuration
Each developer’s machine-specific paths live in acd_sync_config.yaml at the project root. It is git-ignored on purpose:
# CtrlLens — local sync config (git-ignored) source_acd_path: D:\Projects\MyProject.ACD source_l5x_path: D:\Projects\MyProject.L5X last_sync_timestamp: 1743465600000
A project carries whichever path key matches its mode; an L5X-mode project upgraded via Generate ACD gains a source_acd_path. last_sync_timestamp drives the 10-second ACD change detection that raises the “ACD Modified” banner.
Restore to a new ACD
If you cloned a project without a local ACD, click Restore to…, name a new .ACD in the Save As dialog — CtrlLens implodes the project → L5X → ACD — then open the result in Studio 5000.
AI integration — the agent already knows your project
CtrlLens is built to work alongside AI coding tools (Claude Code, Copilot, Cursor). Four layers cooperate so the agent reads, modifies, and extends a Logix project safely — context files, an XML bridge, cross-view validation, and a built-in MCP tool server — without CtrlLens ever calling an AI API itself.
The </> XML bridge
AI tools can’t see a Konva canvas — only files open in the text editor. The </> XML button in the breadcrumb opens the routine’s underlying XML so any agent in the IDE can read it. After the agent saves, a file watcher re-renders the canvas in under 300 ms.
The context bundle
On sync / open / Refresh Now, CtrlLens regenerates a deterministic markdown snapshot under <gitDir>/.ctrllens/context/, split across four files:
| File | Contents |
|---|---|
PROJECT.md | Controller info, the Tasks → Programs → Routines tree, rules for AI-assisted editing, controller-scope constraints, and the scope-assignment procedure |
TAGS.md | Controller / program-local / AOI tags as alphabetized tables, plus a Tag Creation Guide with live example tag XMLs and detected naming conventions |
TYPES.md | Every UDT with member signatures and every AOI with metadata, parameters, local tags, and routines (encrypted AOIs flagged 🔒) |
InstructionIndex.md | The full instruction catalog — every mnemonic and alias, grouped by category, with a ✓ on each instruction this project already uses — so the AI can confirm a mnemonic exists in Logix 5000 before writing it; operand details stay with ctrllens_get_instruction |
Everything is local-only and git-ignored. On first sync CtrlLens offers (once, declinable) to write an AGENTS.md at the root — the vendor-neutral standard read by Cursor / Copilot / Codex — plus a thin CLAUDE.md that imports it. Write your project-specific policies into AGENTS.md; CtrlLens never touches it again. The AGENTS.md template also scaffolds a Sample Projects section: list your reference projects once (path + one line each) and every agent session knows where they live — agents can read them directly or point the MCP tools at a sample via projectRoot.
Cross-view validation & Tag Browser
If the AI references a tag that doesn’t exist in scope, every shape that displays it turns red across all three views; when the AI creates the tag in a watched directory, the highlight clears within 2 seconds — no manual reload. The Studio 5000-style Tag Browser opens from any inline editor (Ctrl Space / Alt ↓) with virtual scrolling for 5k+ tag projects.
MCP agent tools — ground, verify, apply
CtrlLens ships a built-in MCP server (Model Context Protocol), so an MCP-capable agent doesn't just read context files — it calls tools. The agent runs a full ground → generate → verify → fix → apply loop against your project — and, on Pro, a review pass over commits or uncommitted changes — with CtrlLens supplying deterministic grounding and validation at every step. Fully local: the server runs on your machine, and nothing leaves it.
| Tool | What it gives the agent |
|---|---|
ctrllens_search_instructions | Search the full Logix instruction catalog by keyword, category, or language |
ctrllens_get_instruction | Exact operand specs — types, formats, required flags, the enum keyword forms Studio 5000 actually serialises (with their integer synonyms), ST signatures, and hand-verified usage notes |
ctrllens_get_routine_context | A routine's referenced tags with scope, called AOIs with parameter signatures, and related tags — plus, in the same call, full specs for the instructions the agent plans to use |
ctrllens_render_preview | Structured ladder-layout JSON of a candidate rung or an existing routine — the agent sees the structure before anything is written |
ctrllens_verify | Dry-run validation of generated logic against your project's tags, scopes, and instruction signatures — ladder and ST each go through the right engine |
ctrllens_apply_rung · Pro | Guarded write-back of one verified rung through the editor's own save pipeline; open canvases refresh automatically |
ctrllens_get_commit_diff · Pro | A structured semantic diff for AI review. Called with no arguments it means “review my uncommitted changes”; pass two refs to compare commits. RLL comes back per rung, FBD per sheet element, SFC per step/transition, ST both sides — with Safety-program changes flagged |
Write-backs are guarded. Safety programs are always refused. A candidate rung is verified before it is written — only errors it would introduce block the apply, so a fix to an already-red routine still goes through — and re-verified from disk afterwards. Untouched rungs are preserved byte-for-byte.
AI code review, anchored to PLC structure. Ask “review my uncommitted changes” and the agent pulls the semantic diff, grounds itself on the touched routines, and returns findings that cite rung numbers, FBD/SFC element IDs, and tag names — not XML line numbers — so every comment jumps straight to a spot on the canvas or in Visual Diff. Changes inside Safety programs are flagged and surfaced first, and the same call compares any two commits.
Setup is one step. GitHub Copilot agent mode discovers the server automatically. For Claude Code / Cursor, run CtrlLens: Set Up AI Agent Tools (also offered on first sync) — it writes a .mcp.json into the project directory and self-heals the path after every extension update.
The server also composes with other MCP tools on the same agent: CtrlLens covers understanding, verifying, and safely editing an existing project at rung / routine scale — pair it with a code-generation MCP tool and let the framework come from the generator while the process logic goes through CtrlLens's verify-in-the-loop editing.
Supported AI tools
| Tool | How it connects |
|---|---|
| Claude Code | Auto-loads CLAUDE.md → imports AGENTS.md → follows the pointer to the bundle; connects to the MCP server via the generated .mcp.json |
| Cursor / Codex | Auto-read AGENTS.md → bundle + routine XML; Cursor also connects to the MCP server via .mcp.json |
| GitHub Copilot (agent mode) | Discovers the MCP server automatically; reference AGENTS.md / bundle / routine XML with #file or @workspace |
| Other tools | Any agent with file access to .ctrllens/context/; any MCP client can connect to the server |
</> XML bridge, context-bundle generation, canvas auto-reload, cross-view validation, MCP rung apply (ctrllens_apply_rung), and MCP commit/diff review (ctrllens_get_commit_diff) require a Pro license.CI/CD pipeline & any Git host
Exploded L5X is plain text, so your project is just a standard Git repository — push it to any CI/CD host (GitHub Actions, Azure Pipelines, GitLab CI, …) and branch protection, pull-request review, and history all work out of the box. The Verify gate statically checks operand types, tag scope, and instruction signatures against the full Rockwell instruction catalog at commit time, blocking regressions before they reach a controller.
git push. Your data stays portable.Keyboard shortcuts
Ladder preview (canvas)
| Shortcut | Action |
|---|---|
| Ctrl = | Zoom in |
| Ctrl - | Zoom out |
| Ctrl 0 | Reset zoom to 100% |
| Ctrl + scroll | Zoom with the mouse wheel |
Edit mode
| Shortcut | Action |
|---|---|
| Ctrl Z | Undo |
| Ctrl Y / Ctrl Shift Z | Redo |
| Ctrl S | Save changes |
| Delete | Delete selected instruction(s) / rung(s) / branch |
| Ctrl C / X / V / D | Copy / Cut / Paste / Duplicate |
| Ctrl+click / Shift+click | Multi-select / range-select rungs |
| Ctrl+drag | Duplicate instruction via drag |
| Tab / Shift Tab | Navigate between editable operands |
| Enter / Escape | Confirm / cancel inline edit or drag |
Licensing & platform
What’s free vs Pro
| Capability | Free | Pro |
|---|---|---|
| L5X preview (Ladder / FBD / SFC / ST / Tags) | ||
| Project Organizer + ST syntax highlighting | ||
| ACD ↔ L5X sync | ||
| Git VCS (commit / push / pull / branch / stash / merge) | ||
| Visual Diff (RLL / FBD / SFC / Tags / ST) | ||
| Interactive editor + Cam Editor write | ||
| Merge conflict resolution UI | ||
| AI Context bundle + </> XML bridge | ||
| MCP agent tools — search / spec / context / preview / verify | ||
| MCP agent tools — apply verified rung | ||
| MCP agent tools — commit/diff review |
A free user who triggers a Pro feature gets a one-time-per-session upgrade prompt — nothing is blocked silently.
Activating Pro
Start a 14-day trial or buy Pro from your dashboard. You receive a license key like CTL-XXXX-XXXX-XXXX by email.
Online (default): run CtrlLens: Activate License in the extension (or click Activate in your dashboard). Your browser verifies ownership and the license returns to the editor automatically — nothing to download or import. Air-gapped: issue a signed license.dat on the Activate page and run CtrlLens: Import License File instead.
Concurrent (floating) license
One license holds one active online slot. Install on as many machines as you like; activating elsewhere takes over the slot, and the previous machine drops to free features on its next online re-check (~12 h).
For air-gapped or on-site work, borrow the license for offline use (7 / 14 / 30 days), then return it early or let it auto-expire.
License commands (Command Palette)
| Command | Use |
|---|---|
| Activate License… | Enter your key + machine label; opens the dashboard to authorize |
| Import License File… | Import a license.dat downloaded from the dashboard (also the offline path) |
| Export Activation Request (Offline)… | Produce a request to carry to a connected machine (air-gapped OT) |
| Borrow / Return License | Lock to this device for 7 / 14 / 30 days, or return early |
| Take License Back to This Device… | Reclaim the online slot when it is active elsewhere |
| Refresh / Deactivate / Show Details | Heartbeat / release the slot / inspect current state |
The status bar shows the current state — Free / Pro / Grace / Borrowed / Active Elsewhere / Expired; clicking an “Active Elsewhere” badge offers to take the slot back.
ACD Sync (free, Windows only)
ACD Sync converts ACD binaries to L5X on save and back — so you commit L5X to Git and still open the native ACD in your engineering tool. Free for everyone. Its only dependency is the Logix Designer SDK (Windows, auto-detected; ships with Studio 5000) — not Studio 5000 itself. Git, diff, merge, preview, and editing all work without it on every platform.
Frequently asked questions
Do free features need an account?
No. L5X preview, project organizer, ladder / FBD / SFC rendering, ST syntax highlighting, the tag browser, live operand validation, and ACD ↔ L5X sync run 100% locally with no account and no network.
Does it work in Cursor?
Yes. CtrlLens is a standard VS Code extension and runs directly in Cursor — install it the same way and every feature behaves identically.
How does the concurrent license work?
One license = one active online slot. Install on any number of machines; activating on a new machine takes over the slot and the previous machine drops to free features on its next online re-check (~12 h). Borrow for 7 / 14 / 30 days for offline or air-gapped work.
Does it work offline or on air-gapped networks?
Yes. The offline and borrowed tiers verify locally with no connection, and manual offline activation is supported for fully isolated, air-gapped machines. The default online tier does a lightweight license re-check (~ every 12 h) when it has network — offline and borrowed never connect.
Where do I find my machine ID?
In VS Code or Cursor, run CtrlLens: Export Machine ID from the command palette and paste the value into the dashboard when starting a trial or activating.
Which AI tools are supported?
Any file-aware agent — Claude Code, GitHub Copilot, Cursor, or any tool with file-system access — plus any MCP-capable agent via the built-in MCP server (instruction search & specs, routine context, verify, ladder preview, and Pro rung apply). CtrlLens provides the context and the tools; it never calls an AI API itself.
Do you collect telemetry?
Zero telemetry. No analytics, crash reports, or usage tracking. The extension contacts our servers only to activate and to re-check the license (online Pro ~ every 12 h; offline and borrowed never connect), sending only your license key, machine ID, and extension version. Your PLC code never leaves your machine.
Need help?
Full tutorials and sample projects are being written. In the meantime, email [email protected] and we’ll answer directly.