Enabling and disabling an Independent Project File
The Independent Project File option saves a configuration element in its own .xti file instead of in the central .tsproj file. This simplifies version management because changes to individual elements can be tracked in separate files.
This property is controlled via ITcSmTreeItem6.SaveInOwnFile. The interface must be obtained from the Tree Item using a cast. After setting the property, you must save the project so that the .xti file is created.
Requirements
- TwinCAT XAE is installed and started.
- A DTE connection to the target instance is active.
ITcSysManageris initialized in an STA thread.- A TwinCAT solution containing at least one configuration element is open.
C# sample
// SaveInOwnFile corresponds to the "Independent Project File" option in XAE
ITcSmTreeItem6 item = (ITcSmTreeItem6)sysManager.LookupTreeItem("TIID^Device 1 (EtherCAT)");
if (!item.SaveInOwnFile)
item.SaveInOwnFile = true;
// To deactivate:
// item.SaveInOwnFile = false;
sysManager.SaveProject();
PowerShell sample
$etherCatMaster = $systemManager.LookupTreeItem("TIID^Device 1 (EtherCAT)")
if ($etherCatMaster.SaveInOwnFile -eq $false)
{
$etherCatMaster.SaveInOwnFile = $true
}
![]() |
|
