beckhoff TE1000 TwinCAT 3 — 6.3.4 From offline to online configurations

Samples | System Working with PLC templates PLC templates are available in two ways: You can either use the complete PLC projects as a whole or each POU individually as a template. For integration into an existing TwinCAT project, simply use the CreateChild() method of the ITcSmTreeItem interface. Code snippet (C#): ITcSmTreeItem plc = systemManager.LookupTreeItem("TIPC"); plc.CreateChild("NewPlcProject", 0, null, pathToTpzipOrTcProjFile); Code snippet (PowerShell):

$plc = $systemManager.LookupTreeItem("TIPC") $plc.CreateChild("NewPlcProject", 0, $null, $pathToTpzipOrTcProjFile) Further options for importing existing PLC projects can be found in the best practice article on "Accessing, creating and handling PLC projects". The next level of granularity for importing template files for the PLC is to import existing POUs, such as function blocks, structures, enumerations, global variable lists, etc. One of the reasons why a developer may opt for individual POUs as templates is that it is easier to build up a pool of existing functionalities and group them into separate POUs, e.g. different function blocks covering different sorting algorithms.

When creating a project, the developer simply chooses the functionality he needs in his TwinCAT project and accesses the template tool to retrieve the corresponding POU and import it into the PLC project. Code snippet (C#): ITcSmTreeItem plcProject = systemManager.LookupTreeItem("TIPC^Name^Name Project"); plcProject.CreateChild("NameOfPou", 58, null, pathToPouFile); plcProject.CreateChild(null, 58, null, stringArrayWithPathsToPouFiles); Code snippet (PowerShell):

$plcProject = $systemManager.LookupTreeItem("TIPC^Name^Name Project") $plcProject.CreateChild("NameOfPou", 58, $null, $pathToPouFile) $plcProject.CreateChild($null, 58, $null, $stringArrayWithPathsToPouFiles) Importing one or more templates The POU template file may be a .TcPou file, or the corresponding DUT/GVL files. The above example shows two common ways of importing POU template files. The first is to import a single file, the second is to import multiple files at once by storing the file paths in a string array and using this string array as the vInfo parameter of CreateChild().

6.3.3 Accessing TwinCAT Remote Manager | Accessing TwinCAT Remote Manager This article describes how to access the TwinCAT Remote Manager functionality via the Automation Interface. The TwinCAT Remote Manager enables switching between TwinCAT 3 XAE versions installed on the same development computer. To access the Remote Manager via the Automation Interface, the following code snippets must be executed. Code snippet (C#): ITcRemoteManager remoteManager = dte.GetObject("TcRemoteManager"); remoteManager.Version = "3.1.4026.12"; Code snippet (PowerShell):

$remoteManager = $dte.GetObject("TcRemoteManager") $remoteManager.Version = "3.1.4026.12" 6.3.4 From offline to online configurations | From offline to online configurations This article explains how to convert a TwinCAT configuration, which has been created 'offline', via TwinCAT Automation Interface to an online configuration. The term "offline" means that no physical I/Os are present at the time of configuration creation and therefore the real address information is not available, e.g. for an EtherCAT Master . The following topics are part of this article: General information TE1000 200 Version: 1.7.0