MATLAB XPC TARGET 4 - API GUIDE Guida Utente Pagina 203

  • Scaricare
  • Aggiungi ai miei manuali
  • Stampa
Vedere la pagina 202
Step-by-Step Example of Fortran and xPC Target
11-9
Creating a C-MEX Wrapper S-Function
This section assumes that you have compiled your Fortran code. See
“Compiling Fortran Files” on page 11-7.
Write the wrapper S-function for
sfun_atmos_sub.f. A wrapper S-function is
code that incorporates existing Fortran code into a Simulink S-Function block.
For details on writing such wrapper functions, refer to the writing S-Functions
Simulink documentation.
The wrapper S-function calls the Fortran subroutine
Atmos with the
appropriate calling convention:
atmos_. (Refer to “Creating Fortran
S-Functions” in the writing S-Functions documentation for further information
about calling conventions.) The wrapper S-function file for this example is
called
sfun_atmos.c.
1 Change directory to <MATLAB root>\simulink\src.
2 Copy the file sfun_atmos.c into your Fortran working directory, for
example,
xpc_fortran_test.
Your next task is to compile and link the wrapper S-function. See “Compiling
and Linking the Wrapper S-Function” on page 11-9.
Compiling and Linking the Wrapper S-Function
Create (compile and link) a DLL (C-MEX DLL) from the sfun_atmos.c file. Use
the
mex command with a C/C++ compiler such as Microsoft Visual C/C++
Version 6.0.
Before you start, copy the following run-time library files from the Fortran
compiler installer directory, such as
C:\Program Files\Microsoft Visual
Studio\DF98\lib
, into the working directory, xpc_fortran_test. Copying
these files simplifies the build process.
dfor.lib
dformd.lib
dfconsol.lib
dfport.lib
This section assumes that you have created a C_MEX wrapper S-function. See
“Creating a C-MEX Wrapper S-Function” on page 11-9.
Vedere la pagina 202
1 2 ... 198 199 200 201 202 203 204 205 206 207 208 ... 371 372

Commenti su questo manuale

Nessun commento

KitchenAid KUIS15NRHT5 manuály

Uživatelské manuály a uživatelské příručky pro Mrazničky KitchenAid KUIS15NRHT5.
Poskytujeme 1 manuály pdf KitchenAid KUIS15NRHT5 ke stažení zdarma podle typů dokumentů: Uživatelský manuál






Další produkty a příručky pro Mrazničky KitchenAid

Modely Typ Dokumentu
KUIS15NRHW8 Uživatelský manuál   KITCHENAID KUIS15NRHW8 User Manual, 9 stránky
KUIS15PRHB5 Uživatelský manuál   KITCHENAID KUIS15PRHB5 User Manual, 8 stránky
KUIC15PRTS1 Uživatelský manuál   KITCHENAID KUIC15PRTS1 User Manual, 9 stránky
KUIS185FWH1 Uživatelský manuál   KITCHENAID KUIS185FWH1 User Manual, 8 stránky