Automation meets DevOps
TIA Portal project files (.ap*) are opaque binary formats, impossible to compare (diff) or version properly. By using T-IA Connect to automatically export your logic to XML, you unlock the use of Git to track every change, work in teams, and ensure total traceability.
Prerequisites
- Git installed on your engineering workstation
- T-IA Connect (AI Pro or Enterprise edition)
- An account on a Git platform (GitHub, GitLab, Gitea)
Step 1: Bulk XML Export
Use the API to export all your blocks (SCL, LAD, FBD) and data types to a local folder in XML format.
curl -X POST http://localhost:9000/api/blocks/actions/export-all \
-H "Content-Type: application/json" \
-d '{
"outputFolder": "C:\\Projects\\Machine_V1\\src",
"format": "XML",
"includeSubfolders": true
}'{
"success": true,
"exportedFiles": 156,
"path": "C:\\Projects\\Machine_V1\\src",
"durationMs": 12400
}Step 2: Git Repository Initialization
Initialize a Git repository in the export folder. Create a .gitignore file to exclude temporary files and keep only useful source code.
cd C:\Projects\Machine_V1\src git init git add . git commit -m "Initial export from TIA Portal"
Initialized empty Git repository in C:/Projects/Machine_V1/src/.git/ [master (root-commit) 4a2b3c4] Initial export from TIA Portal 156 files changed, 124050 insertions(+) create mode 100644 FB_Main.xml ...
Step 3: Commit Workflow and Comparison
After each modification in TIA Portal, run the auto-export again. Use 'git diff' to visualize exactly which lines of code changed before committing.
git diff FB_MotorControl.xml
--- a/src/FB_MotorControl.xml +++ b/src/FB_MotorControl.xml @@ -42,7 +42,7 @@ - <Attribute Name="Speed" Value="1500" /> + <Attribute Name="Speed" Value="1800" />
XML versioning not only allows version comparison but also specific block restoration without re-opening a full project archive.