User`s guide
1 Customizing xPC Target™ Drivers
xPC Target Exported Functions
The xPC Target software provides kernel functions that y ou can use when
writing your device drivers. These functions enable you to input and output
data, configure PCI devices, a nd specify time-out intervals. Use only the
functions documented in this guide. The guidelines in this document are
not applicable if you are using an xPC Target software version prior to xPC
Target software version 3.2 (R2007a). See Chapter 11, “I/O Functions —
Alphabetical List”, for a description of these functions.
Third-Party Directory
The xPC Target software provides the following directory to help you integrate
your custom driver.
matlabroot\toolbox\rtw\targets\xpc\target\build\xpcblocks\thirdpartydrivers
This directory provides template files that you copy and customize for your
drivers. Place all files that support your drivers in this directory.
What Makes Up an xPC Target Driver?
An xPC Target device driver is an S-function with functions that access an
I/O board.
Like any device driver, an xPC Target driver interfaces between the user and
an I/O device. U n like typical device drivers, xPC Target device drivers:
• Can have the following parts
- Driver code, that is C code written as an S-function using exported xPC
Target kernel functions (see “xPC Target E xported Functions” on page
1-6)
- Optional Simulink block interface (Simulink mask) that users use to
configure the device and a cces s output
- Optional MATLAB code that you can w rite to perform operations such as
cross-block checking or parameter value range checking. You reference
this file through the Simulink mask.
• Can be included in a Simulink library
• Are configured like any other Simulink block
1-6