Understanding The Scan Cycle Of The Cpu - Siemens Simatic S7-200 System Manual

Programmable controller
Hide thumbs Also See for Simatic S7-200:
Table of Contents

Advertisement

Basic Concepts for Programming an S7-200 CPU
6.5

Understanding the Scan Cycle of the CPU

The S7-200 CPU is designed to execute a series of tasks, including your program,
repetitively. This cyclical execution of tasks is called the scan cycle. During the scan cycle
shown in Figure 6-8, the CPU performs most or all of the following tasks:
Reading the inputs
Executing the program
Processing any communication requests
Executing the CPU self-test diagnostics
Writing to the outputs
Executing the CPU self-test diagnostics
Figure 6-8
The series of tasks executed during the scan cycle is dependent upon the operating mode of
the CPU. The S7-200 CPU has two modes of operation, STOP mode and RUN mode. With
respect to the scan cycle, the main difference between STOP and RUN mode is that in RUN
mode your program is executed, and in STOP mode your program is not executed.
Reading the Digital Inputs
Each scan cycle begins by reading the current value of the digital inputs and then writing
these values to the process-image input register.
The CPU reserves the process-image input register in increments of eight bits (one byte). If
the CPU or expansion module does not provide a physical input point for each bit of the
reserved byte, you cannot reallocate these bits to subsequent modules in the I/O chain or
use them in your program. The CPU resets these unused inputs to zero in the image register
at the beginning of every scan. However, if your CPU module can accommodate several
expansion modules and you are not using this I/O capacity (have not installed the expansion
modules), you can use the unused expansion input bits as additional memory bits.
The CPU does not automatically update analog inputs as part of the scan cycle and does not
maintain an analog input image register. You must access the analog inputs directly from
your program.
6-10
One Scan Cycle
Writing to the outputs
Processing any communications requests
Scan Cycle of the S7-200 CPU
Reading the inputs
Executing the program
S7-200 Programmable Controller System Manual
C79000-G7076-C230-02

Advertisement

Table of Contents
loading

Table of Contents