Interrupt services routines (ISR) are realized by connecting the outputs of the VxWorks Interrupt Block to the control input of a function-call subsystem, the input of a VxWorks Task Block(a function-call subsystem) or the input to a StateFlow Chart which is configured for a function-call input event.
This block installs the connected output as an ISR in VxWorks and enables the specified interrupt level. The current implementation of the VxWorks interrupt block supports VME interrupts 1-7 and uses the VxWorks system calls sysIntEnable(), sysIntDisable(), intConnect(), intLock() and intUnlock(). Ensure that your target architecture(BSP) supports these functions. There can only be 1 VxWorks Interrupt Block in a model and all desired interrupts should configured by it.
It is important to realize that when a function-call subsystem is connected to an Interrupt Block output, the generated code for that subsystem becomes the ISR. For large subsystems, this can have a large impact on interrupt response time for interrupts of equal and lower priority in the system. As a general rule, it is best to keep ISRs as short as possible, and thus you should only connect function-call subsystems that are small. A better solution is to use the Task Block to run a function-call subsystem. The Task Block is placed between the Interrupt Block and the function-call subsystem(or Stateflow Chart). The Interrupt Block then installs the Task Block as the ISR which simply performs a semGive() to the function-call subsystem and returns. See the VxWorks Task Block for more information.
NOTE: The hardware that will be generating the interrupt is not configured by this block. Typically, the interrupt source is a VME I/O board which will generate interrupts for specific events (ex: end of A/D conversion). The VME interrupt level and vector are setup in registers or using jumpers on the board. The mdlInitialConditions function of a user written device driver(s-function) can be used to setup the registers and enable interrupt generation on the board. It is required that the user matches the interrupt level and vector specified in the Interrupt block dialog to the level and vector setup on the I/O board.