Manual – IPOSplus®
47
5
Interrupts for MOVIDRIVE
®
A and B
Task Management and Interrupts
Sample
fnErrorInterrupt()
{
H2++;
while( !(StatusWord & 0b10))
{
//only leave while-loop when drive is fault-free
H1++;
}
}
main()
{
_SetInterrupt(SI_ERROR,
fnErrorInterrupt);
while(1)
{
H0++;
}
}
H0 is incremented as long as the inverter is functioning correctly. If a fault occurs, H2 is
increased by one and H1 is incremented until the inverter functions correctly. Depending
on the fault response set, the system either continues processing with the current values
in task 1, or IPOS is restarted using the values from the EEPROM.
5.6.3
Touch probe DI02 interrupt
The entire interrupt routine is run through once if the touch probe has been released with
the command _TouchProbe (condition) or TOUCHP and the edge condition is fulfilled.
Then processing for task 1 continues. The interrupt routine is only called a second time
when the touch probe is released again and the condition is fulfilled. (See also the com-
mand _TouchProbe or TOUCHP).
Sample
fnTouchInterrupt()
{
H0++;
}
/*=============================================
Main function (IPOS initial function)
===============================================*/
main()
{
_SetInterrupt( SI_TOUCHP1,fnTouchInterrupt); //Act. interrupt routine
TouchProbe(
TP_EN1
);
while (1) {H1 = H1 +1;}
}
H0 is increased by 1 once.
If the touch probe command is also called in the while loop or in the fnTouchInterrupt,
the interrupt would respond to all changes in edge signal on DI02.
Typical applications for the touch probe are: Relative positioning for de-stacking equip-
ment or register loop control for processes with a continuous material flow.
P
i
f
kVA
Hz
n
P
i
f
kVA
Hz
n