User`s guide
Introduction
When to Write You
rOwnDrivers
Consider writin
g your own device drivers for the xPC Target block library if:
• No xPC Ta rge t dr
iver exists for your I/O needs.
• You are unable
to use a bo ard that the xPC Target software supports.
• You need to ext
end the functionality of an existing xPC Target driver.
• The MathWorks
xPC Target team will not wr ite a d evice driver for yo ur
board.
Restrictio
ns on Customizing xPC Target Drivers
The xPC Targ
et software has its own kernel, and you will be writing device
drivers aim
ed at that kernel. An x PC Target driver is therefore different
from a driv
er for another en vironment, such as Microsoft Windows. The xPC
Target ker
nel is optimized and small, and does not have the operating system
layers tha
t traditional kernels do.
The xPC Ta
rget software installs its own kernel on the target PC. This kernel
runs to th
e e xclus ion of any other operating system. W hen w riting your
own driv
er:
• You cann
ot use a driver DLL that accompanies the I/O board from
the manu
facturer. A manufacturer-supplied DLL will have external
depend
encies that the xPC Target kernel cannot resolve. The xPC Target
execut
able will not be able to load the DLL.
• Do not c
reate your own driver DLL.
• If you
do not have access to the register programming information, neither
you no
r MathWorks can write a device driver for the board. If you have
acces
s to the source code of an existing driver for the board, you m ig ht be
able
to port it to the xPC Target kernel.
Expe
cted Background
Thi
s guide assumes that you are already know le dg eable about writing device
dri
vers. It describes the steps specific to writing device drivers f or the xPC
Tar
get environment. To write your own device drivers for the xPC Target
sys
tem, you need the following background:
1-3