Hauptinhalt

C Dienstschnittstellen

Zuordnen von Modellelementen und Funktionen zu in einem Embedded Coder Dictionary definierten Dienstschnittstellen
Seit R2022b

Beim Generieren von Code aus einem Komponentenmodell, das eine C Dienstcode-Schnittstellenkonfiguration verwendet, ordnen Sie die Modelldatenelemente entsprechenden Dienstschnittstellen zu. Eine Dienstschnittstelle legt Funktionsprototypen-Informationen und eine Datenkommunikationsmethode (direkter Zugriff, außerhalb der Ausführung oder während der Ausführung) für den generierten Code fest, je nach Anforderungen der Zielplattformdienste. Der Codegenerator wendet bei der Erzeugung von Dienstschnittstellencode Beschränkungen an, sodass dieser einfacher zur Verwendung in einer bestimmten Zielumgebung integriert werden kann. Die Liste der zum Mapping verfügbaren Dienstschnittstellen wird von den im geteilten Embedded Coder Dictionary definierten Schnittstellen bestimmt, das dem Modell angehängt ist. Wenn die Standard-Dienstschnittstellen des Dictionary Ihren Zielplattform-Dienstanforderungen entsprechen, müssen Sie das Mapping nicht ändern und können direkt mit der Generation und Überprüfung des Komponenten-Schnittstellencodes fortfahren.

Tools

Code Mappings Editor – Service InterfaceAssociate model elements with code interface definitions

Objekte

coder.mapping.api.CodeMappingModel data and function interface configuration for C code generation

Funktionen

alle erweitern

model_initializeGenerated C/C++ entry-point function that contains initialization code for a Simulink model
model_resetGenerated C/C++ entry-point function that contains reset code for a Simulink model
model_stepGenerated C/C++ entry-point function that contains execution code for each step in a Simulink model
model_terminateGenerated C/C++ entry-point function that contains termination code for a Simulink model

Erstellen und Suchen von Code-Mappings

coder.mapping.api.getGet code mappings for model
coder.mapping.utils.createCreate code mappings object for configuring data and function interface for C and C++ code generation
findGet model elements for the category of model code mappings

Funktionskonfiguration

getFunctionGet code configuration from code mappings for model function
setFunctionSet coder mapping information for model function

Inport- und Outport-Konfiguration auf Rootebene

getInportGet code and calibration configuration from code mappings for root-level inport
getOutportGet code and calibration configuration from code mappings for root-level outport
getDeploymentTypeGet deployment type of model
setInportConfigure root-level inports for code and calibration file (a2l) generation
setOutportConfigure root-level outport for code and calibration file (a2l) generation
setDeploymentTypeSet deployment type of model

Parameterkonfiguration

getModelParameterGet code and calibration configuration from code mappings for model parameters
setModelParameterConfigure model parameter for code and calibration file (a2l) generation

Signal-, Zustands- und Datastore-Konfiguration

addSignalAdd block output signal to model code mappings
getDataStoreGet code and calibration configuration from code mappings for local or shared local data store
getSignalGet code and calibration configuration from code mappings for block output signal
getStateGet code and calibration configuration from code mappings for block state
removeSignalRemove block output signal from model code mappings
setDataStoreConfigure local or shared local data store for code and calibration file (a2l) generation
setSignalConfigure block signal data for code and calibration file (a2l) generation
setStateConfigure block states for code and calibration file (a2l) generation

Datentransfer-Konfiguration

getDataTransferGet code configuration from code mappings for signal representing data transfer
setDataTransferSet code configuration in code mappings for signal representing data transfer

Themen

Grundlagen der Konfiguration

Konfiguration einer aufrufbaren Funktion

Dienstschnittstellen-Konfiguration

Datenzugriff und Initialisierung

Verwandte Informationen

Enthaltene Beispiele