beckhoff TE1000 TwinCAT 3 — 6.3.1 Creating and handling Tasks

Samples | System Inserting Tasks Inserting input/output variables General Information Two task types can be configured in TwinCAT XAE and therefore also with the Automation Interface: tasks with and without a process image. When you insert a new task in TwinCAT XAE, you can decide whether you want to insert a process image or not by selecting or deselecting the corresponding checkbox in the "Insert Task" dialog box. The inserted task then either contains three further subordinate nodes (image, inputs, outputs) or not - as shown in the following example (task 1 = with image, task 2 = without image).

Inserting Tasks To insert a Task via Automation Interface, you can make use of the ITcSmTreeItem::CreateChild() method and the corresponding SubTypes for "With Image" (SubType = 0) and "Without Image" (SubType = 1). Code Snippet (C#) ITcSmTreeItem tasks = systemManager.LookupTreeItem("TIRT"); tasks.CreateChild("Task 1 (With Image)", 0, null, null); Code Snippet (Powershell): $tasks = $systemManager.LookupTreeItem("TIRT") $tasks.CreateChild("Task 1 (With Image)", 0, $null, $null) Code Snippet (C#) ITcSmTreeItem tasks = systemManager.LookupTreeItem("TIRT"); tasks.CreateChild("Task 2 (Without Image)", 1, null, null); Code Snippet (Powershell):

$tasks = $systemManager.LookupTreeItem("TIRT") $tasks.CreateChild("Task 1 (Without Image)", 1, $null, $null) TE1000 196 Version: 1.7.0