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

  • Descarga
  • Añadir a mis manuales
  • Imprimir
  • Pagina
    / 386
  • Tabla de contenidos
  • MARCADORES
  • Valorado. / 5. Basado en revisión del cliente
Vista de pagina 354
Getting Started
14-11
The times2 model contains a simple S-function, called timestwo,thattakesthe
input sine wave signal and doubles its amplitude. The TLC file corresponding
to the S-function is shown below:
%% Copyright (c) 1994-98 by The MathWorks, Inc.
%%
%% Abstract:
%% TLC file for timestwo.c used in Real-Time Workshop
%% S-Function test.
%implements "timestwo" "Ada"
%% Function: Outputs
==========================================================
%function Outputs(block, system) Output
-- %<Type> Block: %<Name>
-- Multiply input by two
%<LibBlockOutputSignal(0, "", "", 0)> := ...
%<LibBlockInputSignal(0, "", "", 0) > * 2.0;
%endfunction
%% [EOF] timestwo.tlc
The key line in this TLC file is the assignment of two times the
LibBlockInputSignal to the LibBlockOutputSignal. This line directs the
Target Language Compiler to place the algorithm directly into the generated
Ada code.
This TLC file is located in
matlabroot/toolbox/simulink/blocks/tlc_ada/timestwo.tlc.
Generating the Ada Code
The build process is similar to the case where your model does not contain any
S-functions. The only additional requirement for generating Ada code for
models containing S-functions is to provide a TLC file with the same name as
the S-function. Otherwise, the build procedure is exactly the same.
Vista de pagina 354
1 2 ... 350 351 352 353 354 355 356 357 358 359 360 ... 385 386

Comentarios a estos manuales

Sin comentarios