EasyManua.ls Logo

Moeller EC4-200 - Interrupt Processing; Steps for Interrupt Processing; Example of Interrupt Processing

Moeller EC4-200
82 pages
To Next Page IconTo Next Page
To Next Page IconTo Next Page
To Previous Page IconTo Previous Page
To Previous Page IconTo Previous Page
Loading...
05/06 AWB2724-1584GB
Interrupt processing
45
Interrupt processing
If an interrupt occurs, the program is interrupted and the program
routine associated with the system event is processed. figure 44
shows a list of interrupt sources.
The program routine called by the interrupt can be interrupted by
a new interrupt (different channel).
If the current interrupt is followed by a new interrupt (same
channel), the new interrupt is not executed until the processing of
the current one has been completed.
The interrupts are enabled in the RUN state of the CPU and
disabled in the STOP state. Interrupt sources which are not
enabled in the configuration do not initiate an interrupt.
You can disable or enable the interrupt inputs I1....I4 and the timer
interrupt from the program. The functions “DisableInterrup” and
“EnableInterrupt” are provided for this purpose. A call parameter
determines whether a single interrupt or all interrupts are to be
disabled/enabled. A disabled interrupt must be enabled with the
same parameter that was used for the disable.
DiThe two functions “DisableInterrup” and “EnableInterrupt” are
provided as part of the library “EC_Util.lib.” This library must be
included if necessary in your project by the Library Manager of the
programming software.
DisableInterrupt: This function deactivates a configured physical
interrupt from the user program.
EnableInterrupt: This function activates a previously deactivated
physical interrupt from the user program.
Steps for interrupt processing
X Define the interrupt properties:
X Create the program routine (POU)
Another program routine (POU) must be added to the existing POU
PLC_PRG . This is of type PRG and calls an interrupt.
X Assign the program routine to an interrupt source:
To do this call the PLC configurator and click Task
Configuration l System Events. The interrupt sources (names)
are listed in the “System Events” tab with a free entry field
for the name of the “Called POU”.
Enable the interrupt by clicking the box next to the required
interrupt and entering the name of the POU in the same line.
Further details on this are described in the Example of
interrupt processing.
Example of interrupt processing
A “PLC_PRG” POU has to be processed continuously. An
additional POU “Fastprog” has to be processed when a rising
edge (L l H) at input I3 generates an interrupt.
X Create the POUs “PLC_PRG” and “Fastprog” as shown in
figure 45.
X Move to the PLC configuration, click on the Local I/O[SLOT]
folder and open the “Other Parameters” tab
X Assign the “Rising edge” type to input I3.
Figure 44: Interrupt sources
h
The execution time of the program routines is monitored.
START/STOP COLD START
WARM START (start of
controller) TIMER
INTERRUPT (periodic)
Interrupt inputs (voltage at
I1, I2, I3, I4) High-speed
counter (Actual value =
Preset)
Program for
processing the
interrupt
Startup behaviour Select type
TIMER INTERRUPT Call function
TIMERINTERRUPTENABLE
Interrupt inputs Define edges
High-speed counters Select type
Figure 45: Creating the program

Table of Contents

Related product manuals