Programs

Define programs in the
Programs
section of a controller in the
Application View
. Sequential programs must be adjacent within a
Programs
section. Programs belonging to a same section must have different names.
Specify these properties for programs:
Property
Description
Code Generation
Generate Debug Info
Generate information required for debugging with step-by-step execution
Generate Monitoring Symbols
For graphical program organization units (POUs), generate information to graphically display the output values of elements for debugging or simulating
Info
Comment
Plain text
Description
Rich text
Full Name
(Read-only) Full name of the program with the project and controller to which it belongs
Language
(Read-only) Programming language of the POU
Name
(Read-only) Name of the program. Program names are limited to 128 characters beginning with a letter followed by letters, digits, and single underscores. The last character for a program name must be a letter or digit. Program names cannot end with an underscore character. Reserved words, defined words, or data types such as elementary, structures, or arrays are not valid names. The same type of elements within a scope must have unique names.
Order
Position of the program within the execution order
Password Protected
(Read-only) Program is protected by a password controlling its access
Path
(Read-only) Complete path to the program files on the computer
Perform these tasks for programs:
Task
Instruction
Add a program
In the
Application View
, right-click the
Programs
element for a controller, point to
Add Programs
, and then select one of these:
  • New ST: Structured Text
  • New FBD: Function Block Diagram
  • New LD: Ladder Diagram
  • New SFC: Sequential Function Chart
Export a program
Export programs as exchange files (*.pxf).
  1. In the
    Application View
    , right-click the program, and then click
    Export...
    .
  2. In the
    Save <Program> As
    dialog box, browse for the location where to store the program exchange file, and then click
    Save
    .
    TIP: If a user-defined structure contains user-defined structures, create at least one variable for each user-defined structure to support a successful POU export.
Add a program from an exchange file
Import programs previously exported as exchange files (*.pxf).
TIP: For POUs in version control, check out the POU before importing the exchange file (*.pxf).
In the
Application View
, right-click the
Programs
element, point to
Add Programs
, then
Existing Program...
.
  1. In the
    Select Exchange File
    dialog box, locate the exchange file containing the program, and then select
    Open
    .
  2. In the
    Add Existing Program
    dialog box, select the element to import, and then select
    Import
    .
Set properties for a program
In the
Application View
, right-click the program, and then select
Properties
.
Copy and paste a program
  1. In the
    Application View
    , right-click the program, and then select
    Copy
    .
  2. Right-click the
    Program
    element, and click
    Paste
    .
Rename a program
In the
Application View
, right-click the program, then select
Rename
, and then type a name for the program.
Delete a program
In the
Application View
, right-click the program, and then select
Delete
.
Provide Feedback
Have questions or feedback about this documentation? Please submit your feedback here.
Normal