User`s guide
10 Interrupts Versus Polling
10-2
Polling Mode
A good understanding of polling mode will help you to use it effectively, and a
better understanding of interrupt mode will help you to decide under which
circumstances it makes sense for you to switch to the polling mode. This section
includes the following topics:
• “xPC Target Kernel Polling Mode” on page 10-2
• “Interrupt Mode” on page 10-2
• “Polling Mode” on page 10-4
• “Setting the Polling Mode” on page 10-6
• “Restrictions Introduced by Polling Mode” on page 10-9
• “Controlling the Target Application” on page 10-12
• “Polling Mode Performance” on page 10-13
xPC Target Kernel Polling Mode
Polling mode for the xPC Target real-time kernel is designed to execute target
applications at sample times close to the limit of the hardware (CPU). Using
polling mode with high-speed and low-latency I/O boards and drivers allows
you to achieve smaller sample times for applications that you cannot achieve
using the interrupt mode of xPC Target.
Polling mode has two main applications:
•
Control applications — Control applications of average model size and I/O
complexity that are executed at very small sample times (Ts = 5 to 50 µs)
•
DSP applications — Sample-based DSP applications (mainly audio and
speech) of average model size and I/O complexity that are executed at very
high sample rates (Fs = 20 to 200 kHz)
Interrupt Mode
Interrupt mode is the default real-time execution mode for the xPC Target
kernel. This mode provides the greatest flexibility and is the mode you should
choose for any application that executes at the given base sample time without
overloading the CPU.
The scheduler ensures real-time single-tasking and multitasking execution of
single-rate or multirate systems, including asynchronous events (interrupts).