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
Produkt TargetLink
Informationstyp FAQ (Häufig gestellte Fragen)
Informationskategorie Erste Schritte, Arbeiten mit, Problembehandlung

Immer auf dem neuesten Stand mit unserem Newsletter-Service.

Mit unserem Newsletter-Service informieren wir Sie über aktuelle Anwendungsbeispiele, neue Lösungen und Produkte sowie über Schulungen und Veranstaltungen. Hier geht's zur Anmeldung.

Formularaufruf freigeben

An dieser Stelle ist ein Eingabeformular von Click Dimensions eingebunden. Dieses ermöglicht es uns Ihr Newsletter-Abonnement zu verarbeiten. Aktuell ist das Formular ausgeblendet aufgrund Ihrer Privatsphäre-Einstellung für unsere Website.

Externes Eingabeformular

Mit dem Aktivieren des Eingabeformulars erklären Sie sich damit einverstanden, dass personenbezogene Daten an Click Dimensions innerhalb der EU, in den USA, Kanada oder Australien übermittelt werden. Mehr dazu in unserer Datenschutzbestimmung.