▲
■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■
TargetLink Data Types Application Note September 2004
■
▼
4
■■■■■■■■■■■■■■■▼
The precondition for this mode is that the model can be initialized.
This is the main reason why Simulink-to-TargetLink conversion of
subsystems in models requires that the model can be initialized, and
why conversion does not proceed if the Conversion Tool detects that
the model is not initializable. This mode is also used to evaluate signal
widths.
Simulink libraries cannot be set to compiled mode. Thus, if a library (or
a part of a library) is converted to TargetLink, data types cannot be
evaluated using compiled mode. The same problem arises with signal
widths.
Evaluating data types in compiled mode has a big advantage: inherited
data types can be considered as well as data types which are explicitly
set. In compiled mode, it makes no difference, for example, whether
the output type of a Product block is
int16
because it has been
explictly set, or because the block context and inheritance rules result
in an
int16
output type.
Evaluating compiled data types also has a big disadvantage (Simulink
Version 5 and 6 only): The resulting types depend on whether Simulink
runs with or without a Fixed-Point license. With a license, all fixed-
point settings are taken into account, and signals can be fixed-point
with or without scaling. Without a license, the user must set model-
specific settings so that all signals are double, as otherwise the model
fails to initialize. Thus, without a license, Simulink fixed-point settings
have no impact on the types in compiled mode. Moreover, this
behavior differs in some details between Simulink 5 and Simulink 6.
In other words, which scaling parameters are set during Simulink-to-
TargetLink conversion depends on whether there is a Fixed-Point
license or not. If Simulink fixed-point types are used, it is therefore
strongly recommended to invoke conversion on Simulink installations
with Fixed-Point licenses.
Kommentare zu diesen Handbüchern