PLC 4
PLC 4
I0.3 T37
IN TON
150 PT
T37 Q0.1
Retentive On-Delay (TONR) The Retentive On-Delay timer (TONR) functions in a similar
manner to the On-Delay timer (TON). There is one difference.
The Retentive On-Delay timer times as long as the enabling
input is on, but does not reset when the input goes off. The
timer must be reset with a RESET (R) instruction.
67
The same example used with the On-Delay timer will be
used with the Retentive On-Delay timer. When the switch is
closed at input I0.3, timer T5 (Retentive timer) begins timing.
If, for example, after 10 seconds input I0.3 is opened the timer
stops. When input I0.3 is closed the timer will begin timing at
10 seconds. The light will turn on 5 seconds after input I0.3
has been closed the second time. A RESET (R) instruction
can be added. Here a pushbutton is connected to input I0.2.
If after 10 seconds input I0.3 were opened, T5 can be reset by
momentarily closing input I0.2. T5 will be reset to 0 and begin
timing from 0 when input I0.3 is closed again.
I0.2 T5
I0.3
T5
IN TONR
150 PT
T5 Q0.1
Off-Delay (TOF) The Off-Delay timer is used to delay an output off for a fixed
period of time after the input turns off. When the enabling bit
turns on the timer bit turns on immediately and the value is set
to 0. When the input turns off, the timer counts until the preset
time has elapsed before the timer bit turns off.
TXXX
IN TOF
PT
68
S7-200 Timers The S7-200s have 256 timers. The specific T number chosen
for the timer determines its time base and whether it is TON,
TONR, or TOF.
Timer Example In the following example a tank will be filled with two
chemicals, mixed, and then drained. When the Start Button is
pressed at input I0.0, the program starts pump 1 controlled by
output Q0.0. Pump 1 runs for 5 seconds, filling the tank with
the first chemical, then shuts off. The program then starts pump
2, controlled by output Q0.1. Pump 2 runs for 3 seconds filling
the tank with the second chemical. After 3 seconds pump 2
shuts off. The program starts the mixer motor, connected to
output Q0.2 and mixes the two chemicals for 60 seconds. The
program then opens the drain valve controlled by output Q0.3,
and starts pump 3 controlled by output Q0.4. Pump 3 shuts off
after 8 seconds and the process stops. A manual Stop switch is
also provided at input I0.1.
69
Review 5
1. Analog signals are converted into a ____________
format by the PLC.
70
Counters
71
Counters are represented by boxes in ladder logic. Counters
increment/decrement one count each time the input transitions
from off (logic 0) to on (logic 1). The counters are reset when
a RESET instruction is executed. S7-200 uses three types of
counters: up counter (CTU), down counter (CTD), and up/down
counter (CTUD).
S7-200 Counters There are 256 counters in the S7-200, numbered C0 through
C255. The same number cannot be assigned to more than
one counter. For example, if an up counter is assigned number
45, a down counter cannot also be assigned number 45. The
maximum count value of a counter is ±32,767.
XXX
CTU
CU
PV
72
Down Counter The down counter counts down from the preset value (PV) each
time CD transitions from a logic 0 to a logic 1. When the current
value is equal to zero the counter output bit (Q) turns on (not
shown). The counter resets and loads the current value with the
preset value (PV) when the load input (LD) is enabled.
XXX
CTD
CD
LD
PV
Up/Down Counter The up/down counter counts up or down from the preset value
each time either CD or CU transitions from a logic 0 to a logic 1.
When the current value is equal to the preset value, the output
QU turns on. When the current value (CV) is equal to zero, the
output QD turns on. The counter loads the current value (CV)
with the preset value (PV) when the load input (LD) is enabled.
Similarly, the counter resets and loads the current value (CV)
with zero when the reset (R) is enabled. The counter stops
counting when it reaches preset or zero.
XXX
CTUD
CD
CU
R
LD
PV
73
Counter Example A counter might be used to keep track of the number of
vehicles in a parking lot. As vehicles enter the lot through an
entrance gate, the counter counts up. As vehicles exit the lot
through an exit gate, the counter counts down. When the lot is
full a sign at the entrance gate turns on indicating the lot is full.
74
High-Speed Instructions
75
Definition Boxes and The high-speed counter definition boxes are used to assign
High-Speed Counters a mode to the counter. High-speed counters can be defined
by the definition box to operate in any of the twelve available
modes. It should be noted that not all counters can operate
in all of the available modes. Refer to the S7-Programmable
Controller System Manual for definitions available for each
counter. Each counter has dedicated inputs for clocks, direction
control, reset, and start where these functions are supported.
0 1 2 3 4 5 6 7 8 9 10
Encoder Motor
Starter
1. Communications
2. I/O Interrupts
3. Time-Based Interrupts
76
PTO Pulse Train Output (PTO) is used to provide a series of pulses
to an output device, such as a stepper motor driver. The PTO
provides a square wave output for a specified number of pulses
and a specified cycle time. The number of pulses can be from
1 to 4,294,967,295 pulses. PTOs have a 50% duty cycle. This
means the pulse is off for the same amount of time it is on. The
number of pulses and the cycle time can be changed with an
interrupt. In the following example each pulse is on for 500 ms,
and off for 500 ms. After four pulses an interrupt occurs which
changes the cycle time to 1000 ms.
Q0.0
4 Pulses 4 Pulses
500 milliseconds Each 1000 milliseconds Each
Interrupt
Occurs
On Off On Off
Q0.0
10% 50%
Duty Cycle Duty Cycle
77
Specialized Expansion Modules
78
Ethernet Communications
CP 243-1 Ethernet
CP 243-1 IT Internet
79
PROFIBUS DP PROFIBUS DP is an open bus standard for a wide range
of applications in various manufacturing and automation
processes. PROFIBUS DP works at the field device level such
as power meters, motor protectors, circuit breakers, and lighting
controls. Through PROFIBUS DP the features of S7-200 PLCs
can be used to their full extent within a distributed system.
An advantage to PROFIBUS DP is the ability to communicate
between PROFIBUS DP devices of different vendors. This
provides uniform communication between all SIMATIC devices
on the PROFIBUS DP network as well as devices from other
manufacturers.
80
PLCs, for example, use I/O modules to receive inputs from
binary devices such as sensors. Binary outputs are used to turn
on or off a process as the result of an input.
Control
Actual Value
Stepper Motor
Power Module
Servo/Stepper
Servo Motor
81
EM 253 Features The EM 253 provides functionality for single-axis, open-loop
position control. Features of the module include:
• Continuous operation
Web Site For more information and sales support on the S7-200 visit our
web site at:
http://www.automation.siemens.com/s7-200/index_76.htm.
82
Review 6
1. The S7-200 supports ____________ counters.
83
Review Answers
84
Final Exam
a. 2 bits b. 8 bits
c. 16 bits d. 32 bits
a. 11 b. 100
c. 101 d. 111
a. analog b. discrete
c. high-speed d. normally open
a. RAM b. ROM
c. firmware d. K memory
85
7. A USB/PPI Multi-Master cable connects a personal
computer’s USB interface to a/an ____________ connector
on an S7-200 CPU.
a. RS-485 b. RS-232
c. Ethernet d. PROFIBUS-DP
a. none b. 7
c. 10 d. 30
a. 4 b. 8
c. 2 d. 5
a. I0.4 b. I0.3
c. Q0.3 d. Q0.4
a. two b. three
c. four d. five
a. 3.2767 b. 32.767
c. 327.67 d. 3276.7
86
15. An S7-200 timer with a time base of 100 ms can count to
a maximum value of ____________ seconds.
a. 3.2767 b. 32.767
c. 327.67 d. 3276.7
a. .1 b. 10
c. 1 d. 100
a. 32,767 b. 65,534
c. 98,301 d. 1,000,000
a. Transmit b. Interrupt
c. High-speed counters d. High-speed outputs
a. Transmit b. Forcing
c. Interrupt d. PLC scan
87
quickSTEP Online Courses
From this site the complete text of all STEP courses can be
downloaded in PDF format. These files contain the most recent
changes and updates to the STEP courses.
88