TIA VCI Viewer
Built and maintained by JB Automation GmbH.
🌐 jb-automation.de · 📧 contact@jbautomation.de · 💼 LinkedIn
VS Code extension that makes Siemens TIA Portal VCI (Version Control Interface) exports readable, reviewable, and safer to merge in git.
Industrial teams use git with TIA exports every day — but the XML/SCL on disk was never meant for human review. IDs shuffle on every export, renames look like delete+add, and a line-based merge can leave you with two member names and hundreds of broken symbol references after the next VCI import. TIA VCI Viewer closes that gap: one structured view per file, semantic diffs, rename-aware merges, and workspace-wide reference propagation before you commit.
What you get in one place:
- a structured preview of the TIA object (header, sections, members, tags, comments) — opens by default for TIA workspace files
- a graphical LAD/FBD rendering for code blocks (contacts, coils, FB-call boxes with pins and instance DBs)
- a proper SCL preview with header, version, attributes,
VAR_* sections and code body
- inline diff annotations vs HEAD in the same view — tables, LAD graph, comments, and line-level SCL body diff
- a TIA Explorer sidebar that lists every TIA object by its real name
- a 3-way merge editor on Bausteine / members / tags (not XML lines), with automatic rename detection when a branch renamed a UDT member
- workspace-wide member rename — propagate a renamed UDT/DB member to every referencing XML and SCL file before the next VCI import
- type-aware reference search — symbol paths are resolved through your UDT/DB catalog so unrelated blocks with the same member name are not rewritten by mistake
Installation
From VS Code Marketplace (recommended)
- Open Extensions in VS Code (
Ctrl+Shift+X).
- Search for TIA VCI Viewer (publisher jb-automation).
- Install, or use the marketplace link:
https://marketplace.visualstudio.com/items?itemName=jb-automation.tia-vci-viewer
Updates appear automatically when a new version is published (see Releases & CI/CD below).
The extension activates automatically once you open a folder that looks like a TIA VCI workspace (i.e. contains Programmbausteine/, PLC-Datentypen/ or PLC-Variablen/).
Activation triggers
| Trigger |
When |
workspaceContains:**/.vci/workspace.vci.config |
Project exported via TIA VCI |
workspaceContains:**/Programmbausteine/** |
Has any block exports |
workspaceContains:**/PLC-Datentypen/** |
Has any UDT exports |
workspaceContains:**/PLC-Variablen/** |
Has any tag-table exports |
Outside such folders the extension stays inactive and does not hijack unrelated *.xml files.
Features
1. Structured preview (default editor)
Click any TIA-exported file under Programmbausteine/, PLC-Datentypen/, or PLC-Variablen/. The TIA Preview opens automatically, showing:
- the object's TIA name, kind badge, language, engineering version, memory layout
- non-empty multilingual block titles and comments (the empty boilerplate is filtered out)
- per-section tables for members (UDTs, DBs, code-block interfaces) with name, data type, default value, attributes
- per-tag rows for tag tables with address, type, comment
- for code blocks: a rendered LAD/FBD network per
CompileUnit with power rails, contacts (incl. negated via <Negated/>), coils (S / R / negated / P / N), instruction boxes, and FB/FC call boxes with EN/ENO, pin labels, instance-DB labels above the box, and TIA-style quoted operand names ("OB_DI".sInit)
- for SCL files: a parsed header (block keyword, version, attributes), tables per
VAR_* section, and the code body
To go back to the raw XML/SCL: command palette → TIA: Open Raw XML/SCL, or the title-bar button in the preview.
When your working copy differs from HEAD and a member rename is likely (one removed + one added with the same signature), a rename hint appears above the section with an Apply across workspace action.
To turn off the default editor: workbench.editorAssociations setting:
{ "workbench.editorAssociations": { "*.xml": "default" } }
2. Inline diff vs HEAD (same view)
When the file is tracked in git, the preview also loads the HEAD revision in the background, builds a TIA-object-aware diff plan, and overlays the changes directly in the same view:
- Tables: each row carries a
+ / − / ~ badge; changed cells show old → new with strikethrough on the old value. Removed rows appear at the bottom as ghost rows in red.
- LAD/FBD networks: parts, calls and operands are colored green (added), red dashed (removed) or yellow (modified) inside the SVG. Removed elements from HEAD appear as a ghost rung below the live network. Networks themselves get a colored side-stripe and an
ADDED / REMOVED / MODIFIED badge in the header.
- Comments / titles: matched culture-by-culture; new comments green, removed ones red with strikethrough.
- SCL body: real line-level LCS diff with three-column gutter (old line / new line / sign), inline highlighting for added/removed lines.
A toolbar checkbox "Show changes vs HEAD" lets you toggle the diff overlay off if you want to see the pure structure.
A banner in the toolbar summarizes change counts (N changes vs HEAD · Header: modified · M items tracked) so you know at a glance whether the file is dirty.
An Activity Bar icon (TIA VCI) lists every TIA object in the workspace, grouped by folder, named by the object's TIA name (parsed from the XML), with a type-specific icon (FB / FC / OB / DB / UDT / Tag Table / SCL). Clicking opens the preview. The view also exposes per-item context-menu commands: Open Raw XML and Compare with HEAD.
4. 3-way merge editor
When a TIA XML is in a git merge conflict (<<<<<<< markers present, or unmerged stages), the editor title shows a git-merge button. Clicking it opens the TIA Merge Editor:
- reads the three git stages (
:1: base, :2: ours, :3: theirs)
- parses each side, matches objects by stable
Name attributes (never by volatile ID)
- classifies each object as
unchanged, modifiedOurs, modifiedTheirs, modifiedBoth, addedOurs, addedTheirs, addedBoth, removedOurs, removedTheirs, removedBoth
- lets you pick a side per item, or use bulk Take Ours / Take Theirs buttons
- on save, the chosen sub-trees are inserted into the skeleton XML and all
ID attributes are re-assigned to a clean uppercase hex sequence (matching TIA's own scheme), then git add <file> runs automatically
This avoids the line-by-line chaos that pure git merging produces on TIA XML, where shuffled IDs and empty MultilingualText boilerplate generate hundreds of false conflicts.
Detected renames during merge
TIA VCI does not record renames — a renamed UDT member appears as delete old + add new. The merge editor pairs those sets (by datatype, default value, and structure) and shows a Detected renames panel at the top:
- accept a rename to keep only the new name in the merged file (not both names side by side)
- pick ours or theirs when both sides renamed the same member to different names
- on save, optionally propagate the rename to every referencing block, DB, and SCL file in the workspace (with a review list and live code preview per reference)
5. Rename member (workspace-wide)
Command palette → TIA: Rename UDT/DB Member (propagate refs) (also in the editor title bar and TIA Explorer context menu):
- open the UDT, DB, interface, or SCL file that owns the member
- pick the member and enter the new name
- review every workspace reference (
<Component Name="…"/> in XML, dotted paths in SCL) — arrow keys show the matching line in a side editor; false positives can be unticked
- apply — definition and all selected references are rewritten and staged with
git add
References are filtered by type catalog: the extension walks nested symbol paths ("DB"."struct"."member") and only pre-selects occurrences that resolve to the UDT you are editing.
Supported TIA object types
| Root element / file |
Recognized as |
Where |
SW.Tags.PlcTagTable |
Tag Table |
PLC-Variablen/*.xml |
SW.Types.PlcStruct |
UDT |
PLC-Datentypen/**/*.xml |
SW.Blocks.GlobalDB, SW.Blocks.InstanceDB |
Data Block |
Programmbausteine/**/*.xml |
SW.Blocks.FB, SW.Blocks.FC, SW.Blocks.OB |
Code Block (interface + LAD/FBD graphical rendering) |
Programmbausteine/**/*.xml |
.scl files |
SCL source (parsed header + interface + body) |
Programmbausteine/**/*.scl |
LAD/FBD support covers contacts, coils, instruction boxes, FB/FC calls with parameters and instance DBs, and the <Negated/> modifier. Parallel branches (Openbranch/Closebranch), jumps, and exotic instruction shapes are simplified — use TIA Portal itself for definitive editing.
Configuration
| Setting |
Default |
Description |
tia.preview.openByDefault |
true |
Open TIA XML/SCL files with the TIA Preview editor by default. Set to false (or override via workbench.editorAssociations) to fall back to the plain text editor. |
tia.merge.autoStageResolved |
true |
Run git add <file> automatically after a successful TIA merge resolution. |
Development
npm install
npm run build # one-shot bundle into dist/
npm run watch # rebuild on change
npm test # parser + diff + merge tests
npm run lint # tsc --noEmit
Press F5 with the Launch Extension (against baseframework) configuration to open a dev host. Point the tests at your own corpus:
TIA_BASEFRAMEWORK_PATH=/abs/path/to/your/baseframework npm test
Layout
src/
extension.ts # activation, commands, context
parser/ # XML / SCL -> typed TiaObject AST
views/projectTreeProvider.ts # TIA Explorer sidebar
preview/ # CustomTextEditor + unified diff-aware webview
diff/ # DiffPlan builder (shared by preview)
merge/ # 3-way merge: git stages, plan, webview, serializer
refactor/ # rename detection, reference scan, type catalog
util/ # git helpers, workspace detection, branding
test/
parser.test.ts # parses real TIA exports
diff.test.ts # 2-way diff plan
merge.test.ts # 3-way merge classification + serializer round-trip
How the merge editor avoids line-by-line chaos
TIA XML carries volatile numeric ID attributes that change on every export, plus large blocks of repeated MultilingualText boilerplate. Both wreck text-based 3-way merges. This extension:
- Matches objects across base / ours / theirs by stable keys (
Name attribute of tags, members, sections, blocks — never by ID).
- Re-assigns all
ID attributes on save so the resulting file has no spurious diff against either side.
- Filters empty multilingual entries from the comparison so untouched comments do not register as changes.
Disclaimer — no liability for damages
USE AT YOUR OWN RISK.
This software is provided by JB Automation GmbH "as is" and "as available", without warranty of any kind, whether express or implied, including but not limited to warranties of merchantability, fitness for a particular purpose, accuracy, or non-infringement.
JB Automation GmbH does not accept liability for any damages arising from the use of, or inability to use, this extension, including without limitation:
- loss of production, plant downtime, or missed deadlines
- corrupted, incomplete, or incorrectly merged TIA export files
- broken symbol links, failed VCI imports, or PLC programs that no longer compile in TIA Portal
- data loss in git repositories or on engineering stations
- indirect, incidental, special, or consequential damages of any kind
You are solely responsible for reviewing every change (diff, merge resolution, and rename propagation) before committing, pushing, or importing back into TIA Portal. Always keep backups and test on a non-production project first.
Nothing in this disclaimer limits liability where such limitation is not permitted by applicable law (e.g. mandatory consumer rights or liability for intent or gross negligence under German law).
Trademarks
This extension is an independent community project and is NOT affiliated with, endorsed by, sponsored by, or supported by Siemens AG.
"Siemens", "TIA Portal", "SIMATIC", "Openness", "STEP 7", and related names, marks, and logos are registered trademarks of Siemens AG. Their use here (including in the extension name and documentation) is purely descriptive — to identify the file formats and the third-party product this software is designed to inter-operate with.
The TIA Portal VCI XML/SCL file formats are read using publicly documented information and lawful interoperability research consistent with Article 6 of EU Directive 2009/24/EC.
License
Licensed under the Apache License, Version 2.0.
See NOTICE for attribution and third-party components.
For security issues, please email contact@jbautomation.de instead of opening a public issue.