Plc_prg, L-force | plc designer – Lenze PLC Designer PLC Designer (R2-x) User Manual

Page 46

Advertising
background image

L-force | PLC Designer

What is What in PLC Designer

44

DMS 3.2 EN 02/2011 TD29



Example for a possible call sequence for PLC_PRG:

See the program PRGexample shown in the picture at top of this chapter:

LD 0

ST PRGexample.PAR (*Default setting for PAR is 0*)

CAL IL call (*ERG in IL call results in 1*)

CAL ST call (*ERG in ST call results in 2*)

CAL FBD call (*ERG in FBD call results in 3*)

If the variable PAR from the program PRGexample is initialized by a main program
with 0, and then one after the other programs are called with above named program
calls, then the ERG result in the programs will have the values 1, 2, and 3. If one
exchanges the sequence of the calls, then the values of the given result parameters
also change in a corresponding fashion.

4.1.8

PLC_PRG

The PLC_PRG is a special predefined POU. Each project must contain this special
program. This POU is called exactly once per control cycle.

The first time the 'Project' 'Object Add' command is used after a new project has been
created, the default entry in the POU dialog box will be a POU named PLC_PRG of the
program type. You should not change this default setting!

If tasks have been defined, then the project may not contain any PLC_PRG, since in
this case the procedure sequence depends upon the task assignment.



Stop!

Do not delete or rename the POU PLC_PRG (assuming you are not using a Task
Configuration)! PLC_PRG is generally the main program in a single task program.

Advertising