Operation
05/06 AWB2724-1584GB
44
Example
• Create a program with a function call
Create a program with the function TIMERINTERRUPTENABLE like
in figure 41.
• Creating the program routine
X Open the “Task Configuration” sub-directory with a double
click in the “Resources directory”.
X Click here the “System Events” folder. The “System events” tab
is active.
X Activate the “timer interrupt” required by activating the check
box on the left of its name.
X In the “Called POU” column enter the name of the program
routine, e. g “Time_Int”.
X Click again on the name “Timer Interrupt”. Now the Create
“POU button” becomes active and indicates the name of the
POU.
X Click this button. A POU with the name “Time_Int” will be
added under “PLC_PRG” in the POU window.
X Open the POU and write your program routine:
If input IX0.0 is activated, the “Time_Int” POU is called
periodically and the variable “uiCount” is incremented.
Figure 42: Creating the program routine
Figure 43: Writing a program routine
h
The interrupt can be interrupted by higher-priority system
interrupts. Cycle time monitoring is active during
execution of the timer interrupt.
If timer interrupts occur too frequently, this may cause the
selected program cycle time to be exceeded. In this case
the controller will switch from RUN to STOP.
The timer interrupt can be disabled and enabled from the
user program. The functions “DisableInterrup and
“EnableInterrupt” are provided for this purpose in the
library EC_UTIL.lib.