Skip to content

Commit 9cf6c35

Browse files
committed
docs: add TwinCAT setup guide and prerequisites
1 parent 0585de6 commit 9cf6c35

2 files changed

Lines changed: 119 additions & 0 deletions

File tree

TcAutomation/README.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@
33
## 1 Prerequisites
44

55
- [Inno Setup](https://jrsoftware.org/isinfo.php)
6+
- TwinCAT XAE Shell 15.0 properly installed and configured (see [TwinCAT Setup Guide](TWINCAT_SETUP.md))
67

78
## 2 Build Project
89

TcAutomation/TWINCAT_SETUP.md

Lines changed: 118 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,118 @@
1+
# TwinCAT Setup Guide
2+
3+
This guide covers the prerequisites and setup steps for working with TwinCAT XAE Shell 15.0.
4+
5+
## 1 Prerequisites
6+
7+
- Windows 10/11
8+
- TwinCAT XAE Shell Version 15.0 (compatibility with other versions has not been tested)
9+
- **Tested Version**: TcXaeShell 15.0.34829.251 D15.9
10+
- **Edition**: Express
11+
- **Framework**: Microsoft .NET Framework 4.8.09221
12+
- 7-day trial license (or full license)
13+
14+
## 2 TwinCAT Installation
15+
16+
1. Download and install TwinCAT XAE Shell 15.0 from [Beckhoff's website](https://www.beckhoff.com/en-en/support/download-finder/software-and-tools/)
17+
2. Follow the installation wizard
18+
3. Verify the installation by checking the version (Help → About in TwinCAT XAE)
19+
20+
### 2.1 Verified Components
21+
22+
The framework has been tested with the following TwinCAT components:
23+
24+
- **TwinCAT XAE Base**: 3.1.0.0
25+
- **TcXaeShell**: 1.15.0
26+
- **TcXaeHelper**: 4024.65.0.0
27+
- **TcXaeModules**: 4024.65.0.0 (TMC Editor, TMC Code Generator)
28+
- **TwinCAT Measurement**: 4.48.45.0
29+
- **TwinCAT Scope**: 4.48.92.0
30+
31+
## 3 License Setup
32+
33+
TwinCAT requires a valid license to run. For development and testing purposes, you can obtain a 7-day trial license:
34+
35+
1. Create a new TwinCAT XAE project (File → New → Project → TwinCAT XAE Project)
36+
2. Add a PLC project to your solution
37+
3. Try to activate the configuration or switch to Run Mode
38+
4. A license popup will appear automatically, offering a 7-day trial license
39+
5. Follow the prompts to request and activate the trial license
40+
41+
**Note:** The 7-day trial license needs to be renewed after expiration. You can renew it by repeating the process above.
42+
43+
## 4 Hyper-V Compatibility Issue
44+
45+
TwinCAT requires direct hardware access and **does not work with Hyper-V enabled**. If you're running Windows with Hyper-V or WSL2, you need to disable it.
46+
47+
### 4.1 Disable Windows Core Isolation (Memory Integrity)
48+
49+
Windows Core Isolation with Memory Integrity can interfere with TwinCAT. You need to disable it:
50+
51+
1. Open Windows Security (Windows Defender)
52+
2. Go to **Device Security****Core Isolation Details**
53+
3. Turn off **Memory Integrity**
54+
4. Restart your computer
55+
56+
57+
### 4.2 Solution: Dual Boot Configuration
58+
59+
Instead of permanently disabling Hyper-V, you can create a dual boot option that allows you to choose whether to boot Windows with or without Hyper-V.
60+
61+
#### 4.2.1 Create Boot Entry (PowerShell Script)
62+
63+
Run the following PowerShell script **as Administrator**:
64+
65+
```powershell
66+
# Get GUID of current Windows boot entry
67+
$sourceGuid = "{current-boot-entry-guid}" # Replace with your actual GUID
68+
$description = "Windows 11 - No Hyper-V (TwinCAT)"
69+
70+
# Create new boot entry
71+
$bcdCopyOutput = bcdedit /copy $sourceGuid /d $description
72+
73+
# Extract GUID
74+
if ($bcdCopyOutput -match "\{[0-9a-fA-F\-]+\}") {
75+
$newGuid = $matches[0]
76+
77+
# Disable Hyper-V for this boot entry
78+
bcdedit /set $newGuid hypervisorlaunchtype off
79+
80+
# Set boot timeout (optional)
81+
bcdedit /timeout 5
82+
83+
# Display result
84+
Write-Host "`n New boot entry successfully created:"
85+
Write-Host " Description: $description"
86+
Write-Host " GUID: $newGuid"
87+
Write-Host "`n Select '$description' on next boot for TwinCAT without Hyper-V."
88+
} else {
89+
Write-Host " Error: Could not extract GUID."
90+
}
91+
```
92+
93+
#### 4.2.2 Find Your Current Boot GUID
94+
95+
To find your current Windows boot entry GUID, run the following command as Administrator in PowerShell:
96+
97+
```powershell
98+
bcdedit /enum
99+
```
100+
101+
Look for the entry marked as `{current}` and note its GUID.
102+
103+
#### 4.2.3 Result
104+
105+
After running the script, you'll have two boot options:
106+
107+
- **Windows 11** - Normal boot with Hyper-V enabled (for WSL2, Docker, etc.)
108+
- **Windows 11 - No Hyper-V (TwinCAT)** - Boot without Hyper-V for TwinCAT development
109+
110+
Simply select the appropriate option when starting your computer.
111+
112+
## 5 Verify Installation
113+
114+
After setup, verify that TwinCAT is correctly installed:
115+
116+
1. Open TwinCAT XAE (Visual Studio Shell)
117+
2. Check that TwinCAT system tray icon appears (orange/blue)
118+
3. Switch to Config Mode and then Run Mode to verify functionality

0 commit comments

Comments
 (0)