beckhoff TE1000 TwinCAT 3 — 6.3.2 Using Templates

Samples | System Inserting input/output variables Input and output variables can be added to process images (task "With Image"). These can then be linked with the various I/O devices or variables of other tasks. You can use the corresponding TwinCAT XAE dialog to select the data type and the address of the input/output variables in the process image, for example. Click on "Ok" to add the variable to the process image. This procedure can also be triggered via the Automation Interface using the ITcSmTreeItem::CreateChild() method with the corresponding variable data type as vInfo. In this case, SubType specifies the "Start Address" as shown in the dialog above. Code snippet (C#):

ITcSmTreeItem task1 = systemManager.LookupTreeItem("TIRT^Task 1 (With Image)^Inputs"); task1.CreateChild("bInput", -1, null, "BOOL"); Code snippet (PowerShell): $task1 = $systemManager.LookupTreeItem("TIRT^Task 1 (With Image)^Inputs") $task1.CreateChild("bInput", -1, $null, "BOOL") If SubType = -1, TwinCAT automatically appends the new variable to the end of the variable list. 6.3.2 Using Templates | Using Templates The following article describes how to use templates instead of configuring each individual setting separately via the Automation Interface. The use of templates offers many advantages:

they are easier to maintain, easier to replace with new templates and they offer more options when working with several teams on a TwinCAT project. This document describes the use of templates and covers the following topics: The general idea behind templates and their different levels Working with I/O templates Working with movement templates (axes) Working with PLC templates The general idea behind templates and their different levels The idea behind the use of templates is as simple as the Automation Interface code and the use of the Automation Interface itself. Most users are not aware that templates can exist at different levels in a TwinCAT configuration. These include:

TE1000 197 Version: 1.7.0