User`s guide
13 Incorporating Fortran Code into the xPC Ta rget™ Environment
Your next task is to validate the Fortran code and wrapper S-function. See
“Validating the Fortran Code and Wrapper S-Function” on page 13-14.
Validating the Fortran Code and Wrapper S-Function
Validate the generated C-MEX S-function, sfu n_a tmos.mex.BindtheC-MEX
S-function to an S-function block found in the Simulink block library. You
can mask the S-function block like any other S-function block to give it a
specific dialog box.
This topic assumes that you have com piled and linked a wrapper S-function.
See “Compiling and Linking the Wrapper S-Function” on page 13-12.
The Atmosphere model example has a Simulink model associated with it.
1 In the MATLAB window, type
fortran_atmos_xpc
This opens the Simulink model associated w ith the A tmosphere model.
This model includes the correct S-function block that is bound to
sfun_atmos.mex.
2 Select the Simulation menu Start option to simulate the model.
3 Examine the behavior of the Atmosphere model by looking at the signals
traced by the Scope block.
Your next task is to prepare the model to build an xPC Target application. See
“Preparing the M odel for the xPC Target Application Build” on page 13-14.
Preparing the Model for the xPC Target Application
Build
Before you build the Atmosphere model for xPC Target, define the following
build dependencies:
• The build procedure has access to
sfun_atmos.sub.obj for the link stage.
13-14