Introduction

Subroutine sections can be created:

  • in offline and online mode

Subroutines are expansions to IEC 61131-3 and must be explicitly enabled via the Tools > Project Settings dialog box, in the Language extensions tab by activating the Allow subroutines check box.

Information for creating LD sections

An LD section contains 11-63 columns and 17-3998 lines.

The number of columns is set in the Tools > Project Settings dialog box, in the Program > Languages > LD tab, in the Number of Columns text box.

This setting only applies to sections to be created, not existing sections. Always define the number of columns before you create a new LD section.

(The number of lines can be increased or reduced during the creation of section contents.)

Creating subroutine sections

Creating subroutines:

Step

Action

1

Left-click the SR Sections directory for the target task, or place the cursor on this directory using the arrow keys.

2

Select (right-click or Shift+F10 key combination) the New SR Section menu command from the shortcut menu.

Result: The New dialog box for the section opens.

3

Enter the section name.

The section name must be unique in the entire project and conform to the general naming conventions.

4

Select the programming language of the section.

5

Enter a comment in the Comment tab if desired.

6

If you wish to create additional sections, confirm the entries with Apply . In this case, the New dialog box will remain open and you can generate additional sections.

If you do not wish to create additional sections, confirm the entries with OK . In this case, the New dialog box will close and the generated section will open automatically.

View or edit section properties

Displaying or modifying section properties:

Step

Action

1

Left-click on the desired section, or place the cursor on this section with the arrow keys.

2

Click the right mouse button or press Shift+F10 to select the Properties ... menu command from the shortcut menu.

Result: The Properties of dialog box for the section opens.

3

Implement the desired changes.

4

Confirm all entries with OK.

Importing/exporting sections

See sections: