Configuring boot settings

Boot settings, such as automatic startup with AutoRun and automatic login with AutoLogon, are configured on the system node using ConsumeXml. They correspond to the options in the TwinCAT system tray and take effect at the next system startup.

Requirements

C# sample

ITcSmTreeItem systemNode = sysManager.LookupTreeItem("TISY");

string xmlBootSettings = @"<TreeItem>
  <System>
    <BootSettings>
      <AutoRun>true</AutoRun>
      <AutoLogon>true</AutoLogon>
      <LogonUserName>Administrator</LogonUserName>
      <LogonPassword>MyPassword</LogonPassword>
      <BootFileEncryptionType>None</BootFileEncryptionType>
    </BootSettings>
  </System>
</TreeItem>";

systemNode.ConsumeXml(xmlBootSettings);

// Read current settings
string currentSettings = systemNode.ProduceXml();
Configuring boot settings 1:

AutoRun controls whether TwinCAT automatically switches to Run Mode at system startup. AutoLogon enables automatic user login when Windows starts, so that TwinCAT can be launched without manual interaction. The password for AutoLogon is stored in the project. For security-critical applications, access to the project file must be appropriately secured. BootFileEncryptionType accepts None or the corresponding encryption type.