xPC Target    

Setting the Polling Mode

Polling mode is an alternative to the default interrupt mode of the real-time kernel. This means that the kernel on the bootable floppy disk created the xpcsetup GUI allows running the target application in both modes without the necessity to use another boot floppy disk.

By default the target application executes in interrupt mode. In order to switch to polling mode, you need to pass an option to the System target file command.

  1. In the Simulink window, and from the Tools menu, point to Real-Time Workshop, and then click Options.
  1. The Simulation Parameters dialog box opens with the Real-Time Workshop pane open.

  1. In the System target file edit field, specify the option
  1. The assignment of the clock rate of the target PC's CPU is necessary because the Pentium's on-chip counter used for polling mode counts up with the CPU clock rate. If the clock rate is provided, the kernel knows how to convert clock ticks to seconds and vice versa. If an incorrect clock rate is provided, the target application executes at an incorrect base sample time. You can find out about the CPU clock rate of the target PC by rebooting the target PC and checking the screen output during BIOS execution time. The BIOS usually displays the CPU clock rate in MHz right after the target PC has been powered up.

    For example, if your target PC is a 1.2 GHz AMD Athlon, specify option

  1. If you want to execute the target application in interrupt mode again, either remove the option or assign a CPU clock rate of 0 to the option:

If you make a change to the System target file field, you need to rebuild the target application for the change to take effect. Building the target application, downloading it, and preparing it for a run then works exactly the same way as it did with default interrupt mode.

After the download of the target application has succeeded, the target screen displays the mode, and if polling mode is activated, it additionally displays the defined CPU clock rate in MHz. This allows checking for the correct setting.


  Polling Mode Restrictions Introduced by the Polling Mode