User`s guide
1 Customizing xPC Target™ Drivers
4 Open the Simulink Library Browser and create a new library, for example,
your_company_namelib.mdl (see “Creating Block Libraries” in the
“Working with Block Libraries” in the chapter of Simulink User’s Guide).
Use a unique library name to prevent conflicts w ith other libraries.
5 In the new library, create an S-function block. From the Simulink Library
Browser, drag an S-Function block to the ne w library.
6 Configure the S-Function block.
a In the new library, right-click the S-Function block and select
S-Function Param eters.
b In S-function name, enter the name, without extension, of the driver.
For example,
addiamondmm32. (This is the driver C-file you created in
step 1).
c In S-function param eters, enter the paramete rs y ou define d for the
driver. The parameter names you enter here must match the names you
will later enter for the driver block mask (through the Parameters
and Initialization panes of the Mask Editor dialog box). For example,
firstChan, numChans, range, sampleTime, baseDec.Step7
describes the block mask creation.
d Leave the S-function mod ules parameter with the default value,
unless you need to separate your driver C-fil e into mult ip le file s. If that
is the case, see “Specifying Additional Source Files for an S-Function”
in the “Integrating E xternal Code With Generated C and C++ C ode”
chapter of the Real-Time Workshop U ser’s G uide .
1-12