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 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 in the context menu. Result: The 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 list box: 
 See also section Project Protection. | 
| 5 | Select the functional module to which the section is allocated from the tab if necessary. See also section Functional module. | 
| 6 | Define a variable of BOOL or EBOOL type in the 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: 
 Only for EBOOL variable, activate the check box when you want to force the variable. | 
| 7 | Enter a comment in the tab if desired. | 
| 8 | Confirm the entries with and the Program Unit is automatically created in the directory with the following structure: 
 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 menu command from the shortcut menu. Result: The dialog box for the Program Unit opens. | 
| 3 | Implement the desired changes. | 
| 4 | Confirm all entries with . | 
Importing/exporting Program Units
See:

 
						