Installation manual
CNC 8055
CNC 8055i
INTRODUCTION TO THE PLC
8.
SOFT: V02.2X
·429·
Modular structure of the program
8.4 Modular structure of the program
The program to be executed by the PLC consists of a series of modules which are appropriately
defined by means of directing instructions.
The modules that may make up the program are:
• Main module (PRG)
• Periodic execution module (PE)
• First Cycle module (CY1)
Each module must begin with the directing instruction which defines it (PRG, PE, CY1) and end with
the directing instruction END.
Should the main program contain the main module only it is not necessary to place the instructions
PRG and END.
8.4.1 First Cycle module (CY1)
This module is optional and will only be executed when the PLC is turned on. It is used to initialize
the different resources and variables with their initial values, before proceeding to execute the rest
of the program.
This module operates by default with the real values of resources I, O, M.
It is not necessary for this to be at the beginning of the program, but must always be preceded by
the instruction CY1.
8.4.2 Main module (PRG)
This module contains the user program. It will be executed cyclically and will be given the task of
analyzing and modifying CNC inputs and outputs. Its execution time will be limited by the value of
PLC parameter WDGPRG (P0).
This module operates by default with the image values of resources I, O, M.
There can only be one main program and this must be preceded by the instruction PRG, it is not
necessary to define it if it starts on the first line.