Sample Program Using An Interrupt Routine - Siemens Simatic S7-200 CPU 210 System Manual

Table of Contents

Advertisement

Basic Concepts for Programming the CPU 210
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.
Heater operation
Counts per 5 seconds
(relates to temperature)
30000
OFF
15200
0
3.
The power contactor controls the
resistance heating element.
Figure 4-13 Sample Application Using the Hardware Interrupt
4-14
1.
Temperature measurement (using a PT100 RTD sensor)
The RTD module converts the temperature to a pulse train.
ON
Pulse train waveform
(up to 3 kHz)
2.
The program in the CPU 210 monitors
the temperature and controls the heat
source.
S7-200 Programmable Controller, CPU 210
C79000-G7076-C235-01

Hide quick links:

Advertisement

Table of Contents
loading

Table of Contents