MATLAB XPC TARGET 4 - API GUIDE Guide de l'utilisateur Page 204

  • Télécharger
  • Ajouter à mon manuel
  • Imprimer
  • Page
    / 372
  • Table des matières
  • DEPANNAGE
  • MARQUE LIVRES
  • Noté. / 5. Basé sur avis des utilisateurs
Vue de la page 203
11 xPC Target and Fortran
11-10
Invoking the mex command includes the following steps:
1 Compile the wrapper C file sfun_atmos.c. Be sure to link in the following:
- Compiled wrapper file:
sfun_atmos.obj
- Compiled Fortran code: sfun_atmos_sub.obj
- Necessary Fortran run-time libraries to resolve external function
references and the Fortran run-time environment
2 Type
mex -v LINKFLAGS#"$LINKFLAGS dformd.lib dfconsol.lib
dfport.lib" sfun_atmos.c sfun_atmos_sub.obj
Ensure that this whole command is all on one line. This command compiles
and links the
sfun_atmos_sub.c file. It creates the sfun_atmos.dll file in
the same directory.
Note If this command generates a conflict error with libc, you might need to
add the option
/NODEFAULTLIB:libc.lib to the command. For example, mex
-v /NODEFAULTLIB:libc.lib LINKFLAGS#"$LINKFLAGS dformd.lib
dfconsol.lib dfport.lib" sfun_atmos.c sfun_atmos_sub.obj.
Your next task is to validate the Fortran code and wrapper S-function. See
“Validating the Fortran Code and Wrapper S-Function” on page 11-10.
Validating the Fortran Code and Wrapper
S-Function
Validate the generated DLL, sfun_atmos.dll. Bind the S-function DLL 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 section assumes that you have compiled and linked a wrapper S-function.
See “Compiling and Linking the Wrapper S-Function” on page 11-9.
The Atmosphere model example has a Simulink model associated with it.
Vue de la page 203
1 2 ... 199 200 201 202 203 204 205 206 207 208 209 ... 371 372

Commentaires sur ces manuels

Pas de commentaire