4-5
S7-200 Programmable Controller, CPU 210
C79000-G7076-C235-01
Organizing the Program
As shown in Figure 4-3, a program for the CPU 210 is structured into the following
organizational elements: the main program and an optional hardware interrupt routine.
S
The main program stores the instructions that control your application. The instructions in
the main program are executed sequentially once per scan of the CPU. To terminate the
main program, use an Unconditional End coil in ladder or a main program end instruction
(MEND) in STL.
S
The CPU 210 also allows one optional hardware interrupt routine. If you use the interrupt
routine in your program, the CPU executes these instructions on a specific hardware
event (the rising edge when
I0.0
turns on). Place the interrupt routine after the end of
the main program (following the Unconditional End (MEND) instruction). Use a Return
From Interrupt (RETI) instruction to terminate the interrupt routine.
Section 4.6 provides an example of a program using an interrupt routine. The interrupt
routine is not executed as part of the normal scan cycle, but is executed when the
interrupt event occurs (which may be at any point in the scan cycle).
For additional information about designing and entering a program, see the sample
application in Chapter 3.
Main Program
.
.
.
MEND
Interrupt Routine (optional)
RETI
Main Program:
Executed once per scan
Interrupt Routine:
Executed on each occurrence of the
interrupt event
User Program
Figure 4-3
Program Structure for the CPU 210
Basic Concepts for Programming the CPU 210
Содержание Simatic S7-200 CPU 210
Страница 10: ...x S7 200 Programmable Controller CPU 210 C79000 G7076 C235 01 Contents ...
Страница 68: ...3 28 S7 200 Programmable Controller CPU 210 C79000 G7076 C235 01 Getting Started with a Sample Program ...
Страница 116: ...A 16 S7 200 Programmable Controller CPU 210 C79000 G7076 C235 01 CPU 210 Data Sheets ...
Страница 126: ...F 2 S7 200 Programmable Controller CPU 210 C79000 G7076 C235 01 CPU 210 Order Numbers ...
Страница 138: ...Index 12 S7 200 Programmable Controller CPU 210 C79000 G7076 C235 01 Index ...