FAQ 237: Enhancing Simulink Blocks to TargetLink Blocks with Simulink Parameters

Question

How to inherit data types from Simulink during system preparation?

Solution

When a Simulink block is enhanced or taken from the TargetLink library, its TargetLink production code options are set to the TargetLink defaults. However, some of the TargetLink production code options correspond to Simulink properties. Consequently, you can synchronize the values of the TargetLink production code options with the values of their corresponding Simulink properties. Synchronization can also be performed as a separate process, independently of system preparation.

  • Open TargetLink Preferences Editor and enable all Synchronizations Properties in the TL/SL Synchronization pane.
  • If you then want to perform a preparation, the checkboxes for the mapping properties are specified automatically in the GUI, and the TargetLink type corresponds to the Simulink type specified during the model preparation. When you start the preparation process via the tl_prepare_system API command, the mapping properties can be set manually as parameters, or the default settings form the TargetLink preferences are used.
NOTE
  • Mapping rules are specified in M files that are executed during system preparation or clearance. TargetLink provides some default mapping rules for Simulink/TargetLink properties. Customization files derived from these templates let you define custom mapping rules. As TargetLink cannot determine all Simulink data types accurately, you must explicitly specify the Simulink data types to avoid errors.
  • If there are errors with the mapping of fixed-point data types, you must check the Simulink data type values are synchronized with TargetLink data type values as specified in the Default mapping rules.
  • You can derive templates for such mapping customization files, such as tl_map_*.m or tl_remap_*.m, via the tlCustomizationFiles API command. These files let you define how Simulink parameters and data are mapped to TargetLink production code options. For details on the different files, refer to the following chapters in the user documentation: "Files Related to System Preparation, Synchronization, and Clearance" and "Synchronizing Simulink and TargetLink Data".
  • System preparation differs from enhancing single blocks. The latter is preferred when it is less practical to prepare an entire subsystem. In this case, the rules for mapping Simulink parameters to TargetLink properties do not apply because the Simulink block is enhanced with TargetLink default values.
  • The default TargetLink data type is defined in the TargetLink Data Dictionary by the DefaultDataType property of the /Config/TargetLink object. If this property does not exist, Int16 is used.

Tags

Date 2026-05-22
製品 TargetLink
インフォメーション FAQ
情報カテゴリー 初めての方へ, 詳細, トラブルシューティング

ニュースレターサービスで最新情報をお届けします。

dSPACEのニュースレターサービスでは、最新の使用事例、新しいソリューションや製品、トレーニングやイベントに関する情報をお届けします。無料購読のお申し込みはこちらから。

Enable form call

At this point, an input form from Click Dimensions is integrated. This enables us to process your newsletter subscription. The form is currently hidden due to your privacy settings for our website.

External input form

By activating the input form, you consent to personal data being transmitted to Click Dimensions within the EU, in the USA, Canada or Australia. More on this in our privacy policy.