0
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

More than 1 year has passed since last update.

TwinCATでRunモード移行時にAdsError: 4132が発生

Last updated at Posted at 2023-12-06

なかなかてこずったため、対策をメモしておきます。

経緯

TwinCAT/C++でRunモード移行時に以下エラーが発生しました。

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

image.png

Hyper-Vが原因かと思い、「Windowsの機能」で確認しましたが、OFFになっていました。
念のため、「Windowsハイパーバイザープラットフォーム」、「仮想マシンプラットフォーム」もOFFにしましたが、結果は変わらず。

エラー内容で検索して出てきたstack overflowのサイト( https://stackoverflow.com/questions/59463238/twincat-realtime-startup-of-isolated-cpu-fails )を見てみるといろいろな対策がかかれていましたが、以下は試しても変わらず。

  • Realtime設定のCoreのIsolation
  • コア分離設定のメモリ整合性設定のOFF

ただ、Kolcさんが記載していた以下を試すとエラーが解消しました。

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".

解決した方法

  1. Windowsキーを押してregeditと打ってレジストリーエディターを起動する
  2. 「HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\DeviceGuard\Scenarios\SystemGuard」をクリックする。
  3. Enabledと記載されている場所をダブルクリック
  4. 値が1となっていたのを削除して0とし、OKをクリック
  5. この工程の後は他のstack overflowの他の方が記載していたシステム情報内の仮想化ベースのセキュリティーが「無効」になりました。(実行前までは「実行中」となっていた)

終わりに

TwinCATはいくつかのPCでセットアップしてきましたが、初めてこのようなエラーが発生しててこずりました。
その前は何度かブルースクリーンになったり。
TwinCATは簡単にPCをIPC化・リアルタイム処理できて(※ラインセンスは必要、トライアルライセンスもあり)便利ではありますが、エラー内容が分かりづらいこともよくあるため、知見を貯めてすぐに対処できるようにしていきたいです。

0
0
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
0
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?