주요 콘텐츠

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

C 서비스 인터페이스

모델 요소와 함수를 Embedded Coder 사전에 정의된 서비스 인터페이스에 매핑
R2022b 이후

C 서비스 코드 인터페이스 구성을 사용하는 컴포넌트 모델에서 코드를 생성하는 경우, 모델 데이터 요소를 서비스 인터페이스에 매핑합니다. 서비스 인터페이스는 타깃 플랫폼 서비스의 요구대로 생성 코드에 대한 함수 프로토타입 정보와 데이터 통신 방법(직접 액세스, 실행 중이 아닐 때 또는 실행 중일 때)을 지정합니다. 코드 생성기는 서비스 인터페이스 코드를 생성할 때 제약 조건을 적용하여 특정 타깃 환경에서 사용할 코드를 더 쉽게 통합할 수 있도록 해 줍니다. 매핑에 사용할 수 있는 서비스 인터페이스 목록은 모델에 연결된 공유 Embedded Coder 사전에 정의되어 있는 인터페이스에 따라 결정됩니다. 사전 디폴트 서비스 인터페이스가 타깃 플랫폼 서비스 요구 사항과 일치하는 경우 매핑을 변경할 필요가 없으며 컴포넌트 인터페이스 코드 생성 및 검토를 건너뛸 수 있습니다.

코드 매핑 편집기 – 서비스 인터페이스Associate model elements with code interface definitions

객체

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

함수

모두 확장

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

함수 구성

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
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

파라미터 구성

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

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

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

데이터 전송 구성

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

도움말 항목

구성 기본 사항

호출 가능 함수 구성

서비스 인터페이스 구성

데이터 액세스 및 초기화

추천 예제