MATLAB REAL-TIME WORKSHOP 7 - TARGET LANGUAGE COMPILER Guía de usuario Pagina 267

  • Descarga
  • Añadir a mis manuales
  • Imprimir
  • Pagina
    / 386
  • Tabla de contenidos
  • MARCADORES
  • Valorado. / 5. Basado en revisión del cliente
Vista de pagina 266
Implementing Device Drivers
10-9
- Reading values from an I/O device and assigning these values to the
block’s output vector
y (ifitisanADC)
- Writing values from the block’s input vector
u,toanI/Odevice(ifitisa
DAC)
Terminating the program (e.g., zeroing the DAC outputs)
Required Functions
The S-function API requires you to define these functions:
Functions called during initialization
mdlInitializeSizes
mdlInitializeSampleTimes
mdlInitializeConditions
Function called to calculate block outputs
mdlOutputs
Function called to reset the hardware when the program terminates
mdlTerminate
The sections that follow describe how to implement these functions.
S-Function File Format
S-functions also require certain defined values and include files. The diagram
on the next page illustrates the format of a device driver S-function.
Vista de pagina 266
1 2 ... 262 263 264 265 266 267 268 269 270 271 272 ... 385 386

Comentarios a estos manuales

Sin comentarios