xPC Target | ![]() ![]() |
Adding an Asynchronous Event
When developing a model in Simulink that runs in the xPC Target environment, an Interrupt Server Routine (ISR) is modeled by using a Function-Call Subsystem. Additionally, you need to add an IRQ Source block connected to the Function-Call Subsystem block. This subsystem is then executed when an interrupt occurs and the CPU is ready to accept it.
After you install an I/O board with interrupt support into your target PC, you can add xPC Target asynchronous blocks to your Simulink model.
The Library: xpclib/Asynchronous Event window opens.
getxpcpci
.
-1
to let xPC Target determine the number.
For more information about the IRQ Source block, see Async IRQ Source Block.
If you need to transfer data from your ISR, add an Async Transition Block or Async Read/Write blocks to your Simulink model. See Async Rate Transition Block, Async Buffer Write and Read Blocks, and Asynchronous Interrupt Examples.
If you are using a CAN fieldbus with interrupts, see Asynchronous Interrupt Examples.
![]() | Asynchronous Event Support | Async IRQ Source Block | ![]() |