Introduction

Create Program Units for Modicon M340:

  • in the MAST and FAST tasks

  • in offline and online mode

Create Program Units for Modicon M580:

  • in the MAST, FAST, AUX0, and AUX1 tasks

  • in offline and online mode

Creating a Program Unit

Creating a Program Unit:

Step

Action

1

Left-click the Logic directory of the desired task, or place the cursor using the arrow keys on this directory.

2

Click the right mouse button or use Shift+F10 to select New Program Unit... in the context menu.

Result: The New dialog box for the Program Unit opens.

3

Enter the name of the Program Unit. It must be unique in the entire project and conform to the general naming conventions.

4

Select the type of access protection if necessary from the Protection list box:

  • None

    No protection

  • Read only

    Write protection

  • No read & write

    Read and write protection

See also section Project Protection.

5

Select the functional module to which the section is allocated from the Localization tab if necessary.

See also section Functional module.

6

Define a variable of BOOL or EBOOL type in the Condition tab with which the Program Unit can be activated/deactivated (section active when variable=1) if required.

You have the following options to select variables:

  • You can enter the name of the variable/address directly or copy it from the clipboard.

  • Use the command button ... to open an instance selection dialog box.

Only for EBOOL variable, activate the Can be forced check box when you want to force the variable.

7

Enter a comment in the Comment tab if desired.

8

Confirm the entries with OK and the Program Unit is automatically created in the Logic directory with the following structure:

  • Interface & Variables

  • Sections folder

  • Animation Tables folder

    You can refer to the chapter Animation Tables, which refers to the global project, for the implementation of animation tables in the Program Unit.

NOTE: For the animation tables the accessible variable scope is limited to the Program Unit scope.

9

Declare the parameters and variables for the Program Unit.

10

Create sections in FBD, LD, IL, ST or SFC.

Displaying or modifying Program Unit properties

Displaying or modifying Program Unit properties:

Step

Action

1

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

2

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

Result: The Properties of dialog box for the Program Unit opens.

3

Implement the desired changes.

4

Confirm all entries with OK.

Importing/exporting Program Units

See: