TIA Portal Import — VS Code ExtensionBidirectional bridge between VS Code and Siemens TIA Portal — import PLC/HMI projects from TIA Portal to local files, edit them with full VS Code + Copilot power, and export changes back. Built on the TIA Portal Openness API. Key FeaturesImport from TIA Portal (TIA → local files)
Export to TIA Portal (local files → TIA)
Smart Capabilities
Requirements
Installation
UsageConnecting to TIA Portal
Importing from TIA Portal
Exporting to TIA Portal
Exported Directory StructureWhen you connect to TIA Portal (or run the
Template files ( You can also scaffold the workspace manually at any time via Workspace Templates (
|
| File / Folder | Purpose |
|---|---|
.github/copilot-instructions.md |
Instructions for GitHub Copilot (and other AI assistants) that teach the model how to work with Siemens TIA Portal XML files. Covers SimaticML XML structure,.s7dcl / .s7res file conventions, MLC ID handling, network titles/comments, and rules for updating ProjectDescription.md. These instructions are automatically picked up by Copilot in VS Code. |
.github/ProjectDescription.md |
A living document describing the project's architecture, communication topology, block hierarchy, data structures, and data flow. Initially empty — it is populated automatically by Copilot when you start analyzing the project (as instructed by copilot-instructions.md). Should be kept up to date when blocks, communication channels, or data structures change. Includes Mermaid diagrams for visual documentation. |
.github/Schemas/ |
SimaticML XSD schema files (SW.PlcBlocks.*.xsd, SW.Common_v3.xsd, etc.) copied from Documentation/Schemas/. These schemas enable XML validation and IntelliSense for exported TIA Portal block files directly in VS Code. |
.gitignore |
TIA-specific ignore rules (e.g..tia-cache) to keep temporary/cache files out of version control. |
Tip: Commit the
.github/directory to your Git repository so that every team member and CI pipeline benefits from the same AI instructions, project documentation, and XML schemas.
Extension Settings
| Setting | Description | Default |
|---|---|---|
tiaImport.exportFolderName |
Folder name for TIA exports | TiaExport |
tiaImport.tiaPortalPath |
Path to TIA Portal installation | C:\…\Portal V21 |
tiaImport.autoConnect |
Auto-connect on activation | false |
tiaImport.includeComments |
Include comments in export | true |
tiaImport.exportFormat |
Block export format (xml / sd) |
xml |
tiaImport.tagTableFormat |
Tag table export format (xml / xlsx) |
xlsx |
tiaImport.preserveTimestamps |
Preserve original timestamps | true |
tiaImport.excludeSystemBlocks |
Exclude system blocks | true |
tiaImport.dotnetPath |
Path to .NET runtime | Auto-detect |
tiaImport.compileAfterExport |
Compile PLC software after export (always / ask / never) |
ask |
Block Export Formats
| Format | Extension | Description |
|---|---|---|
| xml | .xml |
SimaticML XML — full block data with interface sections, networks, and metadata. Default TIA Portal format. |
| sd | .scl / .s7dcl + .s7res |
SIMATIC Source Documents — auto-selects per programming language: SCL blocks →.scl (via GenerateSource), LAD/FBD/STL blocks → .s7dcl + .s7res (via ExportAsDocuments). Ideal for version control. |
Tag Table Export Formats
| Format | Extension | Description |
|---|---|---|
| xml | .xml |
SimaticML XML — native TIA Portal format |
| xlsx | .xlsx |
Excel spreadsheet — sheets "Tags" and "Constants", with Siemens-style formatting. Editable in Excel, importable back to TIA. |
Commands
Import Commands (TIA → local)
| Command | Description |
|---|---|
TIA Import: Connect to TIA Portal |
Connect / attach to a running TIA Portal instance |
TIA Import: Disconnect from TIA Portal |
Disconnect from TIA Portal |
TIA Import: Select Project |
Select a project from the connected TIA Portal |
TIA Import: Import Entire Project |
Import full project structure |
TIA Import: Refresh Project Structure |
Refresh the project tree |
TIA Import: Import Device |
Import a device with all software |
TIA Import: Import Block |
Import a single block |
TIA Import: Import Block Folder |
Import a block group/folder |
TIA Import: Import Tag Tables |
Import all tag tables |
TIA Import: Import Tag Table |
Import a single tag table |
TIA Import: Import Data Types |
Import all UDTs |
TIA Import: Import Data Type |
Import a single UDT |
TIA Import: Import Watch Tables |
Import all watch tables |
TIA Import: Import Watch Table |
Import a single watch table |
TIA Import: Import HMI Screens |
Import HMI screens |
TIA Import: Import HMI Tags |
Import HMI tags |
TIA Import: Import HMI Connections |
Import HMI connections |
TIA Import: Import All HMI Elements |
Import all HMI elements |
TIA Import: Import HW Configuration |
Import full HW configuration |
TIA Import: Import Device HW Configuration |
Import HW config for a single device |
TIA Import: Import Programs for All Devices in Category |
Import all devices in a category |
Export Commands (local → TIA)
| Command | Description |
|---|---|
Export Blocks to TIA |
Export a block file (XML / SCL / SD) to TIA Portal |
Export Blocks to TIA (Folder) |
Export all blocks in a folder |
Export to TiaPortal: XML File |
Export a single XML file (non-block) |
Export to TiaPortal: XML Folder |
Export an XML folder |
Export XLSX Tags to TIA Portal |
Export XLSX tag table to TIA Portal |
Export XLSX Tags to TIA Portal (Folder) |
Export all XLSX tag tables in a folder |
Export to TiaPortal: HW Config XML |
Export HW config (XML/AML) |
Export to TiaPortal: HW Config Folder |
Export HW config folder |
Export to TIA - Program and HW |
Unified export (program + HW config) |
Export to TIA - Program without HW |
Unified export (program only, no HW) |
Utility Commands
| Command | Description |
|---|---|
TIA Import: Show Logs |
Open the extension output channel |
TIA Import: Open Settings |
Open extension settings page |
TIA Import: Select Export Format |
Switch block export format |
TIA Import: Format PLC Tags |
Toggle tag table format (XML/XLSX) |
TIA Import: Prepare Workspace |
Scaffold workspace (.github/, TiaExport/) |
Architecture
┌─────────────────────────────────────────────────────────────┐
│ VS Code Extension │
│ │
│ ┌────────────┐ ┌─────────────┐ ┌───────────────────────┐│
│ │ Commands │ │ Providers │ │ Utilities ││
│ │ (import/ │ │ (tree view, │ │ (logger, config, ││
│ │ export) │ │ connection)│ │ statusBar, workspace)││
│ └──────┬─────┘ └──────┬──────┘ └───────────────────────┘│
│ │ │ │
│ ┌──────▼───────────────▼──────────────────────────────────┐│
│ │ Services Layer ││
│ │ tiaConnection · projectImport · tiaOpennessBridge ││
│ │ blockImport · tagTableImport · udtImport ││
│ │ watchTableImport · hmiImport ││
│ └──────────────────────┬──────────────────────────────────┘│
│ │ electron-edge-js │
└─────────────────────────┼───────────────────────────────────┘
│
┌─────────────────────────▼───────────────────────────────────┐
│ .NET Wrapper (C#) │
│ │
│ TiaConnector.cs ─► TiaPortalService.cs │
│ │ │
│ ┌──────────────────────┼──────────────────────────────┐ │
│ │ Services/Export/ │ │
│ │ Software: BlockExportHandler, TagTableExport, │ │
│ │ UdtExport, WatchTableExport, SdExportHandler, │ │
│ │ SclExportHandler, XmlComparisonService │ │
│ │ HW: HwConfigExportToTia, DeviceExportHelper │ │
│ ├──────────────────────────────────────────────────────┤ │
│ │ Services/Import/ │ │
│ │ Software: BlockImport, TagTableImport, UdtImport, │ │
│ │ WatchTableImport, HmiImport, TagTableXlsx │ │
│ │ HW: HwConfigImport, DeviceItemHelper │ │
│ └──────────────────────────────────────────────────────┘ │
│ │ │
│ Siemens.Engineering.dll (TIA Openness API) │
└─────────────────────────────────────────────────────────────┘
The extension uses electron-edge-js to call the .NET TiaOpennessWrapper.dll in-process from Node.js. The wrapper communicates with TIA Portal via the official Siemens TIA Portal Openness API (Siemens.Engineering assemblies).
Documentation
- TIA Portal Openness API (Siemens) — official Openness API documentation
- Documentation/API/ — XML intellisense files for the Openness API
- Documentation/Schemas/ — SimaticML XSD schemas for all block types
- THIRD_PARTY_NOTICES.md — third-party components and redistribution notes
Third-Party Licensing & Redistribution
- This extension code is released under MIT.
- Third-party notices for npm/NuGet components are listed in THIRD_PARTY_NOTICES.md.
- For Siemens Openness components, use and distribution are subject to Siemens package terms; evaluate those terms for your release scenario.
- Do not bundle or redistribute
Siemens.Engineering.*binaries with this extension unless explicitly allowed by Siemens terms. - End users must provide their own licensed TIA Portal installation and Openness entitlement.
Known Issues & Limitations
- Windows only — TIA Portal and the Openness API are Windows-only
- Know-how protected blocks — cannot be exported; the extension detects and skips placeholder files
- Export requires TIA Portal ≥ V21 — import/export-to-TIA needs ≥ V21
- SD format (LAD/FBD) — only supports LAD/FBD and mixed blocks (no protected blocks)
- Large projects — full project import may take several minutes depending on project size
Disclaimer of Liability
The extension is a development and automation tool, and all imports/exports modify engineering data at your own risk.
The author is not liable for any direct or indirect damages, production downtime, data loss, project corruption, safety incidents, or other consequences resulting from changes made to TIA Portal projects using this extension.
Users are fully responsible for validating, testing, and approving all generated or imported changes before deployment to real machines, production lines, or safety-related systems.
Repository
https://github.com/cmariusz/TiaAI.ExtVScode
License
MIT — Copyright (c) 2026 Mariusz Czyrnek
Changelog
1.0.0
- Initial release
- Bidirectional TIA Portal ↔ VS Code bridge via Openness API
- Full project import: blocks, tag tables, UDTs, watch tables, HMI, HW config
- Export to TIA Portal V21 with smart comparison and orphan cleanup
- Multiple export formats: XML (SimaticML), SD (
.s7dcl/.scl), XLSX (tag tables) - Project Explorer tree view with context menus
- Status bar connection indicator with health monitoring
- Workspace scaffolding with
.gitignoreand.github/templates (on connect or viaPrepare Workspacecommand) - Dependency-aware import ordering (UDT → FB → FC → OB → DB)
- Unified device export command
- HMI support (screens, tags, connections)
- Hardware configuration import/export (XML, AML, CAx)
- Compile after export with configurable mode (Always / Ask / Never)
- Compile error tracking in VS Code PROBLEMS panel with file and line resolution