주요 콘텐츠

이 페이지는 기계 번역을 사용하여 번역되었습니다. 최신 내용을 영문으로 보려면 여기를 클릭하십시오.

C 데이터 및 함수 인터페이스

모델 데이터 요소 및 함수를 모델에 독립적인 코드 정의에 매핑합니다.

코드 표준 및 지침을 준수하고, 생성된 코드를 외부 코드와 통합하고, 메모리 요구 사항을 해결하고, 코드 생성을 위한 모델 데이터 요소와 진입점 함수의 표현을 구성합니다. 제품에서 미리 정의하거나 Embedded Coder 사전으로 만든 코드 정의에 매핑하여 모델 데이터 요소와 함수를 구성합니다. 데이터 요소의 경우 사용자 지정 스토리지 클래스 디자이너를 사용하여 패키지에서 생성된 코드 정의에 매핑하는 옵션도 있습니다.

이에 대한 소개는 C Data Code Interface Configuration for Model Interface Elements 항목을 참조하십시오.

코드 매핑 편집기 – CAssociate model elements with code interface definitions

객체

coder.mapping.api.CodeMappingModel data and function interface configuration for C code generation
coder.mapping.api.CoderDictionaryQuery and set the code settings of dictionary defaults in an Embedded Coder dictionary within a Simulink data dictionary (R2021a 이후)

함수

모두 확장

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

코드 매핑 만들기 및 찾기

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

디폴트 구성

getDataDefaultGet default storage class or storage class property setting for model data category
getFunctionDefaultGet default function customization template or memory section for model functions category
setDataDefaultSet default storage class and storage class property values for model data category
setFunctionDefaultSet default function customization template and memory section for model functions category

함수 구성

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

루트 수준 인포트 및 아웃포트 구성

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 (R2022a 이후)
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 (R2022a 이후)

파라미터 구성

getModelParameterGet code and calibration configuration from code mappings for model parameters
getModelVariantControlGet code configuration from code mappings for Simulink.VariantControl object (R2025a 이후)
getModelVariantVariableGet code configuration from code mappings for Simulink.VariantVariable object (R2025a 이후)
setModelParameterConfigure model parameter for code and calibration file (a2l) generation
setModelVariantControlConfigure Simulink.VariantControl object for code generation (R2025a 이후)

신호, 상태, 데이터 저장소 구성

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

코더 사전 구성

setDataDefaultSet default code settings for data category (R2021a 이후)
getDataDefaultGet default code settings for data category (R2021a 이후)
setFunctionDefaultSet default function customization template and memory section for model functions category (R2021a 이후)
getFunctionDefaultGet default function customization template or memory section for model functions category (R2021a 이후)

도움말 항목

구성 기본 사항

C 데이터 구성

C 함수 구성

데이터 액세스 및 초기화

추천 예제