User Manual

Operation
12/06 AWB2724-1584GB
50
Interrupt inputs I1 … I4
Inputs I1 to I4 can be configured as interrupt inputs. An edge at
the input generates an interrupt signal (a page 52) that calls the
program routine assigned to it.
X First define the edge of the input signal in the PLC configurator.
X Assign the program routine to the input in the task
configuration.
The inputs are prioritised. I1 has the highest priority, followed by
I2, I3 and I4.
Counter interrupt
When using the High-speed counter function, the controller
continuously compares the actual value with the reference preset
value of the counter. If both are the same, an interrupt is
generated (a page 52) which calls the program routine (POU)
you have created.
To do this you first have to define the counter type in the PLC
configurator. You then have to assign the input receiving the count
pulses to the POU in the task configuration.
Timer interrupt
You can create a program routine that is called at a fixed time
interval. The TIMERINTERRUPTENABLE function is started by a
Boolean variable or an external input. The program routine is
assigned to the timer interrupt in the task configuration. The
interval can be set from 500 – 2500000 microseconds. This period
duration is programmed by adding the TIMERINTERRUPTENABLE
function from the EC_Util.lib library to your user program.
Enter the interval time at the dwTimerTickUS input.
The value is accepted with the start of the timer and can not be
modified for the run time. If the value assigned is outside the 500
- 2500 000 range, the function outputs FALSE as a return value
and the timer is not run.
For example, to set an interval time of 2 seconds to be started by
the external input I0.0, you must enter the following line in the
user program:
TimerInterruptEnable(%IX0.0,2000000)
Figure: 48: The TimerInterruptEnable function
Figure: 49: Periodic calling of the program routine
Figure: 50: Including the function in the program
TIMERINTERRUPTENABLE
BOOL xEnable TimerInterruptEnable BOOL
DWORD dwTimerTickUS
xEnable
p
p = TimerTickUS
Call
Program
routine