User`s guide
Step-by-Step Example of Fortran and xPC Target™
Step-by-Step Exam ple of Fortran and xPC Target
In this section...
“In This Example” on page 13-5
“Creating an xPC Target Atmosphere Model for Fortran” on page 13-5
“Compiling Fortran Files” on page 13-7
“Creating a C-MEX Wrapper S-Function” on page 13-8
“Compiling and Linking the Wrapper S-Function” on page 13-12
“Validating the Fortran Code and Wrapper S-Function” on page 13-14
“Preparing the Model for the xPC Target Application Build” on page 13-14
“Building and Running the xPC Target Application” on page 13-16
In This Example
This example uses the demo Atmosphere model that comes with the Simulink
product. The following procedures require you to know how to write Fo rtran
code appropriate for the Simulink and xPC Target software. See “Creating
Fortran S-Functions” in the Developing S-Functions guideforthesedetails.
Before you start, create an x PC Target Simulink model for the Atmosphere
model. See “Creating an xPC Target Atmosphere Model for Fortran” o n page
13-5.
Creating an xPC Target Atmosphere Model for
Fortran
To create an xPC Target Atmosphere model for Fortran, you need to add an
xPC Target Scope block to the
sfcndemo_atmos model. Perform this procedure
if you do not already have an xPC Target Atmosphere model for Fortran.
1 From the M ATLAB window, change folder to the working folder, for
example,
xpc_fortran_test.
13-5