Executing The User Program - Siemens SIMATIC S7 System Manual

Hide thumbs Also See for SIMATIC S7:
Table of Contents

Advertisement

PLC concepts
4.1 Execution of the control logic
4.1.3

Executing the user program

During the execution phase of the scan cycle, the CPU executes your main program, starting
with the first instruction and proceeding to the last instruction. The immediate I/O instructions
give you immediate access to inputs and outputs during the execution of either the main
program or an interrupt routine.
If you use subroutines in your program, the subroutines are stored as part of the program.
The subroutines are executed when they are called by the main program, by another
subroutine, or by an interrupt routine. Subroutine nesting depth is 8 levels deep from the
main and 4 levels deep from an interrupt routine.
If you use interrupts in your program, the interrupt routines that are associated with the
interrupt events are stored as part of the program. The interrupt routines are not executed as
part of the normal scan cycle, but are executed when the interrupt event occurs (which could
be at any point in the scan cycle).
Local memory is reserved for each of 14 entities: the main program, eight subroutine nesting
levels when initiated from the main program, one interrupt routine, and four subroutine
nesting levels when initiated from an interrupt routine. Local memory has a local scope in
that it is available only within its associated program entity, and cannot be accessed by the
other program entities. For more information about Local memory, refer to Local Memory
Area: L in this chapter.
72
System Manual, V2.3, 07/2017, A5E03822230-AF
S7-200 SMART

Hide quick links:

Advertisement

Table of Contents
loading

This manual is also suitable for:

Simatic s7-200 smart

Table of Contents