TwinCAT setup

To test your controller in real-time on your digital twin you need the TwinCAT software.

Download and Installation

Follow the instructions to download and install Beckhoff ADS TwinCAT 3 on your computer.

  1. Download and execute the file TC31-Full-Setup.3.1.4024.47.exe, which will start the installer.

  2. Run the setup.

    • If you have already installed a version of Visual Studio, the setup asks you for which version you would like to install the TwinCAT XAE Shell. Select Integrate TwinCAT and Activate TC Settings for one of the four Microsoft Visual Studio versions (2013, 2015, 2017 or 2019), it does not matter which version you choose. Also, select Install TwinCAT XAE Shell,as shown in the figure below. Note: if you do not have Visual Studio yet, the setup will install it for you, and you will not see the screenshot below.

    ../_images/TwinCAT-VS2013Shell.png
  3. Restart your computer.

  4. Open a Command Prompt as administrator.

    1. Type cmd in the Windows search bar.

    2. Right mouse click on the Command Prompt application and select Run as administrator.

    ../_images/cmd.png
  5. Type cd C:\TwinCAT\3.1\System and press ENTER.

  6. Type win8settick and press ENTER. The command prompt will show one of the two following messages:

    • The operation completed successfully -> Proceed to the next step.

    • The boot configuration data store could not be opened. Access is denied -> Open a Command Prompt as administrator and try again (step 4 to 6).

  7. Restart your computer.

  8. To finalize the installation, initialize TwinCAT for your computer.

Hint

After installing TwinCAT, disable User interface program for TwinCAT during startup in Task Manager to improve boot time.

../_images/disable-startup.png

Initialization

After installing TwinCAT a few extra steps are required to initialize TwinCAT on your computer. There are two feasible options to finalize the installation of TwinCAT. The first option is enabling virtualization on your computer. The second option is isolating one of your processor cores. It is advised to try the first option first.

Important

Some students encounter problems if they do not run TwinCAT on an isolated core. If you encounter problems with TwinCAT (crashes/unable to login) then you should definitely opt for the option to isolate a processor core.

OPTION 1: Enabling Virtualization

Virtualization enables a computer to run a virtual computer (e.g. TwinCAT). Some computers have this setting enabled by default while others do not. To check whether or not this setting is enabled, follow the following steps:

  1. Open Task Manager (in the more details view).

  2. Navigate to the tab Performance ‣ CPU.

  3. Find the setting Virtualization on this tab and check its status, see picture below.

    1. If Enabled: Virtualization is enabled, you do not need to do anything else.

    2. If Disabled: Virtualization is disabled, enter the BIOS of your computer and try to enable virtualization yourself. Due to the many different brands in the computer market, it is impossible to tell you exactly how you should do this. Try to look for a setting called VT-x, VT-d or Virtualization and enable it. In most cases, Google might be the best place for help. Another, and in some cases easier option is to isolate a processor core.

../_images/task-manager-vt-enabled.png

OPTION 2: Isolating a processor core

Isolating a processor core is the most stable option to run TwinCAT on your computer. To isolate and initialise TwinCAT follow the steps below:

  1. Click on the Windows Search bar.

  2. Type msconfig and open System Configuration.

    ../_images/open-msconfig.png
  3. Navigate to the tab Boot.

  4. Click on Advanced options….

    ../_images/msconfig-boot-advanced.png
  5. Click on the checkbox Number of processors:.

  6. From the dropdown menu below Number of processors:, choose the highest number minus 1. As an example, if the dropdown menu shows 12 as the highest number choose 11.

    ../_images/select-cores.png
  7. Click Ok twice to close the menus.

  8. Restart your computer, as asked by Windows.

    ../_images/restart-computer.png
  9. Start TwinCAT on your computer: Start menu > Beckhoff > TwinCAT XAE (VS 2013).

  10. Click: File -> Open -> Project/Solution.

  11. Open the template plc-dt.sln (avaiable here for download). This may take around a minute to load. You can watch progress in the purple bar at the bottom of your window.

  12. Navigate to ws_plc-dt ‣ SYSTEM and double-click on Real-Time.

    ../_images/realtime-setting.png
  13. Click on Read from Target. All your (isolated) processor cores will show up.

    ../_images/read-from-target.png
  14. Uncheck RT-Core 0 (shared) and check the checkbox with the highest core number, which should be followed by the text (Isolated).

    ../_images/core-select.png
  15. Save the project (img-save-all) and close TwinCAT.

Hint

When you have isolated a processor core, do not forget to deisolate it after you finish the course. See the Deisolating a processor core page for step-by-step instructions. If you do not deisolate it, your system will not use the isolated core, which negatively impacts performance for computation intensive multi-core programs.

Know problems

Virtualization

TwinCAT does not run together with software that uses the Windows Virtual Machine Platform, such as the Windows Subsystem for Linux (WSL). If you can temporarily manage without WSL, you can (temporarily) switch of the Windows Virtual Machine Platform as follows:

  1. Click the Search icon in the taskbar, or click the Start button, and type “windows features”.

  2. Click the (top) result: Turn Windows features on or off.

  3. Scroll down to Virtual Machine Platform and make sure the checkbox in front of it is disabled (empty), as shown in the figure.

    ../_images/virtual-machine-platform.png

VirtualBox

One of the virtual machine platforms that TwinCAT does not appear to be working with is VirtualBox from Oracle, which is needed for specific courses. If somehow you have found a way to get TwinCAT working with VirtualBox, please let your teacher know.

Bitlocker

We have also heard of people not being able to run TwinCAT on a system where the files were encrypted using BitLocker. This is something we cannot do anything about. Please inform your teacher.

What to do when you cannot get TwinCAT to work

In such a case, the only thing you can do is to ask your team mate(s) to do the TwinCAT experiments.

Uninstall TwinCAT

To uninstall TwinCAT, it is recommended to redownload and execute the TwinCAT installation file, as described at the top of the page. This is the safest and most straightforward way to completely remove TwinCAT from your system.

Follow the installation instructions, until the installation program recognizes that TwinCAT is already installed and shows you the following window:

../_images/twincat-uninstall.png

Clicking Next, takes you to a screen where you are offered three options: Modify, Repair and Remove. Executing Remove completely removes all installed Beckhoff TwinCAT components.

Please note that this procedure is only guaranteed to work, when the installation file to remove TwinCAT, is of the same TwinCAT version as the originally installed version. During the 4TC00 course, the TwinCAT installation file will not be changed, unless a serious error is encountered that requires fixing.

Alternatively, you can follow the uninstall instructions from this Beckhof page.

Hint

When you have isolated a processor core, do not forget to deisolate it after you finish the course. See the Deisolating a processor core page for step-by-step instructions. If you do not deisolate it, your system will not use the isolated core, which negatively impacts performance for computation intensive multi-core programs.

Note

Questions can be asked via the appropriate channels in Teams. Please use email only for private issues.