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
- A TwinCAT solution is open.
- Administrator rights may be required to configure AutoLogon.
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();
![]() |
|
