Silent Mode
Sometimes an Automation Interface script or program should operate silently, which means without any message boxes or other visible interruptions. Although the Visual Studio DTE command “dte.Visible = true/false” may seem sufficient in most use cases, the TwinCAT Automation Interface introduces a new Silent Mode switch, which is available since TwinCAT 3.1 Build 4020.0 and above.
This new switch can be activated as follows.
Code snippet (C#):
var settings = dte.GetObject("TcAutomationSettings");
settings.SilentMode = true;
Code snippet (Powershell):
$settings = $dte.GetObject("TcAutomationSettings")
$settings.SilentMode = $true
This will suppress message box dialogs during usage of the TwinCAT Automation Interface.