sami.khan
sami.khan

Reputation: 61

TwinCAT Realtime Startup of isolated CPU Fails

I am currently running Twincat 3.1..4022.16 on Hyper V virtual machine. I am able to correctly build my project but when activating configuration I am getting realtime startup isolated cpu fail.

Attached is my Realtime setting and the error.

enter image description here

Any leads to solution will be highly appreciated.

Upvotes: 6

Views: 34525

Answers (9)

PLCENG
PLCENG

Reputation: 1

If you have tried every thing and still have the problem, it is very likely that you are using a company laptop with active Antivirous.

The runtime does not work with Active antivirus and you should wether deactivate it, or use a virtual machine.

Upvotes: 0

Roald
Roald

Reputation: 2979

I got the following errors when trying to activate my configuration using TwinCAT 4024.10.

Severity Description
Error 'TwinCAT System' (10000): Sending ams command >> Init4\RTime: Start Interrupt: Ticker started >> AdsError: 4132 (0x1024, RTIME: incompatible software detected) << failed!
Error 'TCRTIME' (200): start of real-time avoided by "HyperV"

error messages visual studio

Solution

The issue was caused by the fact that I had earlier tried to get Docker working on my laptop. In order to get Docker to work I had to enable a bunch of Hypervisor options. After realizing this I reverted these by doing the following:

  1. Press the windows key and start typing "Turn Windows features on or off"

    windows features

  2. In the following menu, make sure "Virtual Machine Platform" and "Windows Hypervisor Platform" are deselected. In case either option was selected, deselect it and restart your computer for it to take effect.

    turn off windows hypervisor features

Alternative solutions (16 February 2024)

I had to do this again recently, but I couldn't make it work. As an alternative you can try to:

  1. Use a local virtual machine, as described here.
  2. Use the new Usermode Runtime. See here for a tutorial.

Upvotes: 10

user22847708
user22847708

Reputation: 11

On my side I was still unable to make it work even with all solutions provided above. I am not on a virtual machine but rather a physical laptop (running Windows 11 Pro, i7-12800H, 32 GB RAM. HP ZBook G9 Mobile Workstation)

Tried what Kolc said but now in msinfo it still showing "Activated but not running" for the "Virtualization-based security"

I get this error plus the one shown below if I use isolated core in TwinCAT: ( 'TCRTIME' (200): start of real-time avoided by "HyperV" )

but if I am using shared core, it shows this: ( 'TwinCAT System' (10000): Sending ams command >> Init4\RTime: Start Interrupt: Ticker started >> AdsError: 4124 (0x101c, RTIME: activated CPU(s) not present on target) << failed )

I was able to reach Beckhoff support using their form online and they found a fix for the problem:

  • When I installed TwinCAT I think I didn't do it with administrator rights
  • I run the .exe install file with administrator rights and use the repair function
  • In "C:\TwinCAT\3.1\System" I run the file "win8settick.bat" with administrator rights
  • They told me they had similar problems with others customers, especially when it's a HP laptop, which was my case

Upvotes: 1

Kolc
Kolc

Reputation: 11

Further supplement to the solutions above. I did all above, but "Virtualization-based security" was still "Enabled" in System Information (see Felipe's answer).

I had to turn off SystemGuard in regedit by setting "Enabled" to "0". Registry path: HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\DeviceGuard\Scenarios\SystemGuard

After reboot "Virtualization-based security" was correctly "Not enabled".

regedit

Upvotes: 1

stijn
stijn

Reputation: 35901

Supplement to Felipe's and Roald's answer: latest offender prohibiting TwinCAT from starting is yet another virtualization feature: Windows Sandbox. Can be turned toggled in the Windows Features dialog accessible from Start->Turn Windows features on or off.

Upvotes: 2

Sameera Nanayakkara
Sameera Nanayakkara

Reputation: 11

If none of the above solutions worked, try to uncheck the below settings in Windows 11:

Privacy & security > Windows security > device security > core isolation > memory integrity >> off

Upvotes: 1

Felipe Cunha
Felipe Cunha

Reputation: 216

This is a supplement to Roald's answer.

If you already deactivated Virtual Machine Platform, Windows Hypervisor Platform and Microsoft Defender Platform Guard and still doesn't work, chances are you have virtualization-based security enabled. You can check it by typing msinfo on windows search box.

Check if VBS is enabled

To deactivate it, type Core Isolation on the windows search box and deactivate Memory Integrity. Restart the machine and run ms info again to make sure that VBS is off.

By deactivating memory integrity you disable Virtualization-Based Security

Go to Twincat, activate your project and witness a miracle!

Upvotes: 6

MIHOW
MIHOW

Reputation: 411

Read available number of CPUs from the Target, then change number of Isolated Cores from 0 to any higher number (most cases 1) and decrease number of Cores that are dedicated to Windows. After that click Set on target.

Here's link to detailed article about Twincat and Virtualization alltwincat.com/2018/06/14/twincat-virtualization/

Upvotes: 2

Filippo Boido
Filippo Boido

Reputation: 1206

I found this on the Beckhoff website:

The runtime environment cannot be started inside a Hyper-V environment. This refers in particular to virtual Hyper-V machines, which are run in a privileged Hyper-V machine. As soon as a component of the computer uses Hyper-V, only the engineering environment (XAE) can be used on this computer, not the runtime environment (XAR). Apart from software solutions for virtual machines, you can also use operating system means (Device Guard, Credential Guard, virtualization-based security, etc.) or other Hyper-V programs.

Link

Upvotes: 2

Related Questions