이 페이지는 기계 번역을 사용하여 번역되었습니다. 최신 내용을 영문으로 보려면 여기를 클릭하십시오.
C 서비스 인터페이스
모델 요소와 함수를 Embedded Coder 사전에 정의된 서비스 인터페이스에 매핑
R2022b 이후
R2022b 이후
C 서비스 코드 인터페이스 구성을 사용하는 컴포넌트 모델에서 코드를 생성하는 경우, 모델 데이터 요소를 서비스 인터페이스에 매핑합니다. 서비스 인터페이스는 타깃 플랫폼 서비스의 요구대로 생성 코드에 대한 함수 프로토타입 정보와 데이터 통신 방법(직접 액세스, 실행 중이 아닐 때 또는 실행 중일 때)을 지정합니다. 코드 생성기는 서비스 인터페이스 코드를 생성할 때 제약 조건을 적용하여 특정 타깃 환경에서 사용할 코드를 더 쉽게 통합할 수 있도록 해 줍니다. 매핑에 사용할 수 있는 서비스 인터페이스 목록은 모델에 연결된 공유 Embedded Coder 사전에 정의되어 있는 인터페이스에 따라 결정됩니다. 사전 디폴트 서비스 인터페이스가 타깃 플랫폼 서비스 요구 사항과 일치하는 경우 매핑을 변경할 필요가 없으며 컴포넌트 인터페이스 코드 생성 및 검토를 건너뛸 수 있습니다.
툴
코드 매핑 편집기 – 서비스 인터페이스 | Associate model elements with code interface definitions |
객체
coder.mapping.api.CodeMapping | Model data and function interface configuration for C code generation |
함수
도움말 항목
구성 기본 사항
- Service Interface Configuration for Model Interface Elements
Control the representation of model data elements and functions in generated C code by using a service code interface configuration. - Code Definition and Mapping Limitations and Considerations
Restrictions, constraints, and considerations that apply to code definitions and code mappings. - Manage Multiple Code Mappings for a Model
Design models that are platform-neutral and ready to deploy to different run-time environments. - How Generated Code Exchanges Data with an Environment
The generated code exchanges signal, state, and parameter data with the calling environment through a data interface. - Compare Code Mappings of Simulink Models
Compare the mappings of models using the Simulink Comparison Tool.
호출 가능 함수 구성
- Periodic and Aperiodic Function Interfaces
Generate callable entry-point functions for the algorithm represented by a top model. - Startup, Reset, and Shutdown Function Interfaces
Generate callable entry-point functions for startup, reset, and shutdown processing represented by a model.
서비스 인터페이스 구성
- Service Interfaces
Generate C service interface code for components that interact with target environment resources. - Configure Sender and Receiver Service Interfaces for Model Inports and Outports
Configure sender and receiver service intermeafaces for model Inports and Outports. - Configure Data Transfer Service Interfaces for Data Transfer Signals
Configure data transfer service interfaces for signals representing data transfers between functions. - Configure Parameter and Parameter Argument Tuning Service Interfaces for Model Parameters and Model Parameter Arguments
Configure parameter and parameter argument tuning service interfaces for model parameters and model parameter arguments. - Configure Measurement Service Interfaces for Signals, States, and Data Stores
Configure measurement services for signals, states, and data stores. - Configure Measurement Service Interface for Persistent Data for States and Data Stores
Configure measurement services for states and data stores that use persistent data. (R2025a 이후) - Configure Timer Service Interfaces
Configure timer services for export functions.
데이터 액세스 및 초기화
- Reuse Parameter Data in Different Data Type Contexts
Reuse parameter data by creating aSimulink.Parameter
object or numeric MATLAB® variable that you can use in different data type contexts. - Limitations for Block Parameter Tunability in Generated Code
Limitations can prevent a block parameter from appearing in the generated code as tunable, which means you cannot interact with the parameter value after compiling the code. - Access Signal, State, and Parameter Data During Execution
As you iteratively develop a model, capture output signal and state data that model execution generates. Tune parameter values during execution to observe results on the outputs. - Switch Between Sets of Parameter Values During Simulation and Code Execution
Switch between independent sets of values for the same block parameters by storing the sets in an array of structures. - Configure Packaging of Parameter Arguments in Generated Code
Customize the implementation of parameter arguments in generated code. - Control Signal and State Initialization in the Generated Code
Generate code that enables you to store tunable initial conditions in memory, for example, for modeling a system that shuts down and restarts. - Initialization of Signal, State, and Parameter Data in the Generated Code
To match the numerics of a simulation in Simulink®, the generated code assigns initial values to global data, especially for block states and parameters. - Compile Code Conditionally for All Values of Variant Parameters with Same and Different Dimensions
This example shows how to generate a C code that contains all the active and inactive values of variant parameters.