User-defined Tasks (Additional Tasks)

Overview

In addition to the four configurable tasks in the PLC runtime systems, the TwinCAT system also supports other (non-PLC) software tasks that can have I/O variables. These tasks are managed in the TwinCAT System Manager under the ”Additional Tasks” option (below ”SYSTEM Configuration” in TwinCAT v2.9). These tasks can be used if a PLC is not available. Variables of these tasks can be accessed directly from applications, such as the TwinCAT OPC Server, Visual Basic, Delphi, VB.NET, VC++, C#.NET, etc., via ADS-OCX, ADS-Dll, or TcADS-DLL.

User-defined Tasks (Additional Tasks) 1:

Settings carried out under this option require more advanced knowledge of the TwinCAT system.

Context Menu

User-defined Tasks (Additional Tasks) 2:

Append Task

Adds another task.

Import Task

Integrates previously created and exported task into the existing system.

Paste

Inserts additional tasks from the clipboard.

Paste with Links

Inserts additional tasks with variable links from the clipboard.

The following dialogue appears after opting to Add a task:

User-defined Tasks (Additional Tasks) 3:

The Name should be selected descriptively at this point. The nature of the user-defined task may also be outlined in a few sentences under Comment.

The new task then appears in the tree. This automatically contains the sub-menu options Process Image, Inputs and Outputs.

User-defined Tasks (Additional Tasks) 4:

Further information about the inputs and outputs is given under: Variable Configuration.

Task Context Menu

A right mouse click on the selected task displays the following context menu:

User-defined Tasks (Additional Tasks) 5:

Export Task

Exports the task configurations with sub-elements and links into a file with the suffix *.tce. It can be thereby imported, as described earlier, into other projects.

Export Header File

Exports the configured input and output variables of the task into a C/C++ header file, for further use in TwinCAT Ring 3 I/O applications.

Cut

Copies the task to the clipboard and removes it from the current configuration.

Copy

Copies the task to the clipboard.

Disabled

Excludes the current task from calculation and editing by the TwinCAT system. Configurations and links are retained and are reactivated when this function is selected once more.

"Task" Dialog

There are different settings options for the tasks in the TwinCAT system. The effects and functions of these options are explained under Task Settings. The following option descriptions are for typical TwinCAT I/O applications.

User-defined Tasks (Additional Tasks) 6:

Port

The ADS Port number of the specific ADS device. At the first additional task this is usually ADS Port number 301.

Auto-Start

Forces the TwinCAT System Manager to create the start command for this task. After start/restart of TwinCAT, this task is going to be started automatically with configured settings.

Cycle ticks

The interval time for this task (with its attached variables) is to be configured here. A mapped Fieldbus (network) adaptor will be refreshed with this task interval then.

Create symbols

Should be activated to enable the symbol upload mechanism for this task e.g. for TwinCAT OPC Server v4 or TwinCAT Scope View. If this taks has e.g. the port number 301, an application like TwinCAT OPC Server v4 can upload the variables by name from this ADS Port number (with AutoCfg option type = 5).

"Online" Tab

For information about this dialog, see: Online Display of Task Load.