33
Another issue that was a problem in both TargetLink and Real-Time Workshop
Embedded Coder was the definition of the base data types. Depending on the
target microprocessor every base data type is defined differently, e.g. integers are
defined as int or short depending on the type of the microprocessor used in the
target. Haldex Traction has its own defined base types. A specific code is
developed for the purpose of defining data base types depending on whether the
code is running in the PC or on the target.
In TargetLink the base data types are defined in a header file and the user can
rename them easily. All base data types in TargetLink were renamed so that they
match those of Haldex Traction. TargetLink declaration of those data types were
manually removed from the generated code and instead Haldex Traction base data
type declarations were used.
Real-Time Workshop Embedded Coder works in the same way as TargetLink.
The user can rename the base data types that are declared in a header file that can
be modified in the same way described above. The user can also choose to
generate code for a specific microprocessor and thus the right declaration of all
base data types is achieved. This option is available in TargetLink too but it does
not change the declaration of the base data types as required. However the user
can change the declaration for all base data types manually in the TargetLink base
files and in that way the base data types will be declared as desired. This need to
be done only once and the changes made will be applicable every time code is
generated.
One of the problems that were faced with RTW EC was choosing the right option
in some blocks to obtain the desired simulation results. The simulation gave a
graph with a lot of variations in the signal due to sampling. A small change in the
properties of the blocks of multiplications, divisions and look-up tables gave the
expected result, which was a smooth graph that followed the set points. By simply
choosing to round to simplest, see Figure 11, the whole result changed and a
smooth graph was obtained. This option also saves 30-40 rows of code for every
block.
Kommentare zu diesen Handbüchern