MATLAB REAL-TIME WORKSHOP EMBEDDED CODER - S Manuale Utente Pagina 15

  • Scaricare
  • Aggiungi ai miei manuali
  • Stampa
  • Pagina
    / 76
  • Indice
  • SEGNALIBRI
  • Valutato. / 5. Basato su recensioni clienti
Vedere la pagina 14
7
3 Code generation
3.1 TargetLink
TargetLink makes it easy to generate code since everything related to the code
generation is gathered in one place. It is one tool for both scaling and code
generation. For fixed-point in Simulink environment the user can specify scaling
by choosing the type of the signal, or the parameter, and the maximum and
minimum ranges or by simply choosing the type of the signal/parameter, the
scaling factor and the offset. The maximum and minimum of the block will then
be automatically calculated.
3.1.1 Automatic Scaling
Automatic scaling can be performed on the whole model. This is done by feeding
the model with as much information as possible. The user should enter maximum
and minimum ranges of all known signals and parameters. Since all inputs and
outputs ranges are known, these are propagated to adjacent blocks following the
signal lines forward and backward. The automatic scaling tool, called autoscaling
in TargetLink, can then be chosen and a worst case scaling is determined. A
limitation for TargetLink automatic scaling is that closed loops in the model will
stop the automatic scaling process unless at least one block ranges are specified
by the user.
Simulation based scaling is also supported in TargetLink. This gives the user the
responsibility to enter the worst case simulation inputs to obtain useful results.
3.1.2 Generating Code for One Subsystem
TargetLink makes it possible to generate code for one subsystem by choosing to
generate a separate file for the subsystem during code generation. This is done by
adding a Function block which is a TargetLink block that makes it possible to
generate separate code for the chosen subsystem. Code can also be generated for
the subsystem only, without needing to generate code for the whole model. All of
these are possible via the Function block [2].
3.1.3 Code Interface
The user of TargetLink has the freedom to influence the interface of the generated
code in an easy and practical way. The user can choose the output value for any
subsystem in the model to be a reference variable, a return value, a pointer
parameter or a global variable, see Table 1 [3]. There is also flexibility in
choosing the generated function parameters since every signal and parameter can
be chosen to fulfil certain functionality in the generated code, see Table 1.
Vedere la pagina 14
1 2 ... 10 11 12 13 14 15 16 17 18 19 20 ... 75 76

Commenti su questo manuale

Nessun commento