Program, L-force | plc designer – Lenze PLC Designer PLC Designer (R3-1) User Manual

Page 69

Advertising
background image

L-force | PLC Designer

Concepts and Base Components

DMS 4.1 EN 03/2011 TD29

67

3.7.1

Program
A program is a POU which returns one or several values during operation. All values are
retained from the last time the program was run until the next.
A program POU can be added to the project via the Add Object command. To assign
the program to an existing application, select the application entry in the Devices view
and use the command from the context menu. Otherwise it will be added to the POUs
view. In the 'Add POU' dialog choose type 'Program', enter a name for the program and
set the desired implementation language. After confirming the settings with button
Open the editor window for the new program will open and you can start editing the
program:
The syntax for declaring a program:
PROGRAM <program name>
This is followed by the variable declarations of input, output and program variables,
optionally also access variables.

Abb. 5

Example of a program


Program calls:
A program can be called by another POU. But: A program call in a function is not
allowed. There are also no instances of programs.
If a POU has called a program and if thereby the values of the program have been
changed, these changes will be retained until the program gets called again, even if it
will be called from within another POU. Regard that this is different from calling a
function block, where only the values in the given instance of the function block are
changed and so the changes only are of effect when the same instance will be called
again.

Advertising