Using the Auto Declare dialog
- A programming object (POU or GVL) of a project is open.
- 1. Select the Auto Declare command in the Edit menu or in the context menu of the editor.
- The dialog Auto Declare opens.
- 2. Select the required validity range for the variable from the Scope selection list.
- 3. Enter a variable name in the Name field.
- 4. Select the required data type from the Type selection list.
- 5. To use an initialization value that differs from the standard initialization value, enter an initialization value for the variable.
- 6. Finish your entries by clicking OK.
- TwinCAT lists the newly declared variable in the declaration part of your programming object.
![]() | You can use pragmas in the declaration part to influence the processing of the declaration by the compiler. (See section “Using pragmas”) |
See also:
- TC3 User Interface documentation: Command Auto Declare