필터 지우기
필터 지우기

How to generate c code for simulink example model, but just for a certain block.

조회 수: 3 (최근 30일)
I am using simulink example model titled "Grid tied inverter optimal current control" and i want to generate the c code for hardware implementation for the TI F28379D device. The issue is , the c code generted create dmany lines of code for the whole model but i just want the controller (DSP) code. how do i do that?

답변 (1개)

Aditya
Aditya 2024년 6월 4일
Hi Andrew,
One way to achieve this is through atomic subsystems. Here are the steps:
  1. Wrap the block in a subsystem if it is not already one, and make it atomic. If your block is not already a subsystem, select the block(s) you wish to include, right-click, and choose Create Subsystem from Selection. Then, make this subsystem atomic.
  2. Change the function packaging of this subsystem to 'Nonreusable'. This can be done by right-clicking on the subsystem > Block Parameters > Code Generation > Function Packaging.
  3. Optionally, configure the function name (name of the function that will represent the subsystem in the generated code) and the file name (if you would like this function to be in a separate file).
  4. Generate code from the top-level model.
For more detailed information, you can refer to the following link: Generate Code and Executables for Individual Subsystems - MATLAB & Simulink - MathWorks India
Hope this helps!

카테고리

Help CenterFile Exchange에서 Deployment, Integration, and Supported Hardware에 대해 자세히 알아보기

제품


릴리스

R2024a

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by