MATLAB REAL-TIME WORKSHOP 7 - TARGET LANGUAGE COMPILER Podręcznik Użytkownika Strona 355

  • Pobierz
  • Dodaj do moich podręczników
  • Drukuj
  • Strona
    / 386
  • Spis treści
  • BOOKMARKI
  • Oceniono. / 5. Na podstawie oceny klientów
Przeglądanie stron 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.
Przeglądanie stron 354
1 2 ... 350 351 352 353 354 355 356 357 358 359 360 ... 385 386

Komentarze do niniejszej Instrukcji

Brak uwag