Designing The Control Logic; Defining The Operation Of The Program - Siemens Simatic S7-200 CPU 210 System Manual

Table of Contents

Advertisement

Getting Started with a Sample Program
3.2

Designing the Control Logic

Creating a program is more involved than just entering the instructions into a file. Individual
elements or tasks make up the control logic contained within the program. These elements
relate to the various instructions, which are then arranged into networks.
This section provides an insight into how the sample program was structured.

Defining the Operation of the Program

Before entering the instructions into a program, you must plan the tasks that the program is
to perform. For the home security system described in Section 3.1, the program must
evaluate the status of the four inputs and respond by turning on or off the four outputs. As
shown in Figure 3-4, the control logic of the program must perform the following tasks:
If the system is not armed, the program flashes the LED (Q0.0) on and off when either
Zone 1 (I0.0) or Zone 2 (I0.1) is open.
When the system is armed (by turning the key to the "on" or "arm" position, which turns
on I0.2), the program must start a delay timer which allows 90 seconds for the owner to
exit the house. During this delay time, the program does not respond when either zone
(I0.0 or I0.1) opens.
If the system has been armed and the delay time for exiting the house has been
achieved, the program evaluates the status of both zones. If either zone (I0.0 or I0.1)
opens, the program starts a notification sequence that turns on the low-level alert buzzer
(Q0.2) and starts a timer. This allows a reminder (and time) for the owner to disarm the
system after returning home.
Once the notification sequence has started, the program has two possible actions:
– If the system is disarmed (by turning the key to the "off" or "disarm" position, which
turns off I0.2), the program turns off the outputs (Q0.0 and Q0.2) and resets the
timers.
– If the system has not been disarmed within 60 seconds, the program turns on the
alarm and the modem dialer (Q0.1 and Q0.3).
If the panic alarm (I0.3) is turned on, the program turns on the alarm and the modem
dialer (Q0.1 and Q0.3). The program performs this task regardless of the state of the
arm/disarm switch (I0.2) and does not perform the notification sequence that provides a
delay time for disarming the system.
If the system is disarmed (by turning the key to the "off" or "disarm" position, which turns
off I0.2) after the alarm (Q0.1) has been turned on, the program turns off the outputs
(Q0.1 and Q0.3) and resets the timers.
Each of these tasks can be expressed as a sequence of instructions: the conditions of the
logic determine the action to be taken.
Because the CPU 210 provides immediate outputs, the program uses the internal memory
bits (M memory) to store the interim states of the logic relating to the physical outputs. After
evaluating the control logic, the program uses the states of these memory bits to turn the
outputs on or off.
3-4
S7-200 Programmable Controller, CPU 210
C79000-G7076-C235-01

Hide quick links:

Advertisement

Table of Contents
loading

Table of Contents