Using the input wizard

TwinCAT offers functionalities and wizards that facilitate code input during programming.

Dialog Input Assistant

The dialog offers all programming elements, which you can add at the current cursor position. Open the Input Assistant dialog with the command Input Assistant in the Edit menu, from the context menu, or with the keyboard shortcut [F2].

See also:

Auto Declare dialog

A dialog provides support for declaring variables. Open the Auto Declare dialog with the Auto Declare command in the Edit menu or via the context menu.

See also:

List components

The function List components is an input support feature in the text editor, which facilitates entering valid identifiers. The function can be enabled as follows:

1. Select the command Options in the Tools menu and then the category TwinCAT > PLC Environment > Smart coding.
2. Enable the option List components after typing a dot (.).
Using the input wizard 1:

The pragma attribute 'hide' can be used to exclude variables from List components function. (Attribute 'hide')

Examples:

Entering a structure variables:

Using the input wizard 2:

Calling a function block:

Using the input wizard 3:

Shortcut mode

Shortcut mode enables entering shortcuts for the variable declaration in the declaration editor and in the text editors, in which variable declarations are possible. You can enable this mode by ending a declaration line with the shortcut [Ctrl] + [Enter].

TwinCAT supports the following shortcuts:

Examples:

Example 

Shortcut

resulting declaration

1

bA

bA: BOOL;

2

nA nB I 2

nA, nB: INT := 2;

3

sC S 2; C string

sC: STRING(2); // C string

4

X %MD12 R 5

X AT %MD12: REAL := 5.0;

5

bE !

bE: BOOL;

Smart tag functions

Using the input wizard 4:

Available from TC3.1 Build 4026

Smart tags facilitate the creation of program code by providing suitable commands for selection directly at the programming element. If you place the cursor on a programming element for which a smart tag function is available, the symbol Using the input wizard 5: appears. Clicking on Using the input wizard 6: will display the commands you can select. Available Smart Tags:

See also: