Samples | PLC 6.5.12 Installing the library in the standard repository | Installing the library in the standard repository Compiled PLC libraries can be installed in the standard repository via the Automation Interface. This enables automated build processes that require libraries to be available before compilation. The call is made via InstallLibrary on the References node of the PLC project. The method expects the repository name, the file path to the library, and a boolean overwrite parameter. With overwrite = false , the call is canceled if the library is already installed. overwrite = true will overwrite an existing version.
The repository name "System" refers to the default TwinCAT repository. Requirements TwinCAT XAE is installed and started. A DTE connection to the target instance is active. ITcSysManager is initialized in an STA thread. A compiled library is available as a .compiled-library or .library file. A PLC project containing a References node is included in the solution.
C# sample ITcSmTreeItem references = sysManager.LookupTreeItem(@"TIPC^PLC1^PLC1 Project^References"); // Install into the default repository references.InstallLibrary( "System", // repository name @"C:\Libraries\MyLib_A.compiled.library", // library file path false); // do not overwrite PowerShell sample # Look up the References node of the PLC project $references = $sysManager.LookupTreeItem("TIPC^Untitled1^Untitled1 Projekt^References") # Install library into the default repository ("System") # Parameters:
repository name, file path, overwrite (bool) $references.InstallLibrary("System", "C:\Libraries\MyLib_A.compiled.library", $false) # $false = do not overwrite if already installed 6.5.13 Opening an existing PLC project | Opening an existing PLC project This chapter explains how to open and further process an existing PLC project using the TwinCAT Automation Interface. Topics:
Opening an existing PLC project Saving a PLC project as a library Using online functions (Login, StartPlc, StopPlc) Setting boot project options Saving a project and/or solution as an archive Opening an existing PLC project To open an existing PLC project via the Automation Interface, navigate to the PLC node and select CreateChild() with the path to the .plcproj file. There are three possible values for SubType: 0 : Copy project to the solution directory TE1000 239 Version: 1.7.0