User`s guide
7 Creating Custom Drivers Using the xPC Target™ D river Authoring Tool
You can iteratively change the configuration and resave the MAT-file a s often
as you like.
Reloading the Configuration
The xPC Target Driver Authoring Tool allows you to reload your configuration
session as a MAT-file.
1 In the xPC Target Driver Authoring Tool, click the Main tab.
2 Click Load settings.
The tool loads the
testdriver.mat file into the tool.
Creating the C File Template
To generate a template for the driver C source code file:
1 In the xPC Target Driver Authoring Tool, click the Main tab.
2 Select Generate C file template.
3 Click the Build button.
The tool creates the following files:
•
testdriver.c
• testdriv er.h
• sfcn_tes tdriver.c
• sfcn_tes tdriver.tlc
4 With your favorite editor, open the testdriver .c file and edit i t. This is the
source C code for your driver. The S-function code in
sfcn_testdriver.c
will reference this C file.
Creating a C MEX File for the Driver
To create a C MEX file for the driver, yo u can use either the xPC Target
Driver A u tho ring Tool or the
mex function.
7-8