4-14
S7-200 Programmable Controller, CPU 210
C79000-G7076-C235-01
4.6 Sample Program Using an Interrupt Routine
You can use the hardware interrupt of the CPU 210 to control tasks that require high-speed
counting functions. For example, you can use the CPU 210 to count a pulse train from an
RTD sensor instrument and control a resistance heater. Figure 4-13 shows a sample
application for the following tasks:
1. An instrument (such as a PT100 RTD sensor) measures the temperature, and an RTD
module generates an output pulse train that is proportional to the temperature.
2. Using the hardware interrupt event (the rising edge of I0.0), the CPU 210 counts the
pulses that it receives over a period of time (5 seconds). Based on the count (which
relates to the temperature), the CPU 210 turns a digital output on or off.
3. The power contactor turns the resistance heater on or off, based on the state of the
output of the CPU 210.
Figure 4-14 shows a sample program for this application example. This example counts up
to 3 kHz.
Pulse train waveform
(up to 3 kHz)
1.
Temperature measurement (using a PT100 RTD sensor)
The RTD module converts the temperature to a pulse train.
Counts per 5 seconds
(relates to temperature)
OFF
ON
0
15200
30000
Heater operation
2.
The program in the CPU 210 monitors
the temperature and controls the heat
source.
3.
The power contactor controls the
resistance heating element.
Figure 4-13 Sample Application Using the Hardware Interrupt
Basic Concepts for Programming the CPU 210