Activate or deactivate IndependentProjectFile setting
To enhance engineering experience with regard to Source Control integration, TwinCAT 3 provides the possibility to store settings in separate project files – called “IndependentProjectFile”. This tree item based setting can also be activated/deactivated via TwinCAT Automation Interface. The interface ITcSmTreeItem6 provides the necessary property.
The following code snippet demonstrates how to activate this setting if it is deactivated, e.g. on an EtherCAT Master device.
Code Snippet (C#):
ITcSmTreeItem6 etherCatMaster = (ITcSmTreeItem6)systemManager.LookupTreeItem("TIID^Device 1 (EtherCAT)");
if (etherCatMaster.SaveInOwnFile == false)
etherCatMaster.SaveInOwnFile = true;
Code Snippet (Powershell):
$etherCatMaster = $systemManager.LookupTreeItem("TIID^Device 1 (EtherCAT)")
if ($etherCatMaster.SaveInOwnFile -eq $false)
{
$etherCatMaster.SaveInOwnFile = $true
}