Integration of code composer code in Simulink Model

조회 수: 2 (최근 30일)
Pasquale Salvato
Pasquale Salvato 2018년 11월 8일
댓글: xiaomeng cheng 2020년 5월 20일
I have developed some C code in Code Composer Environment for my c2000 microcontroller exploiting libraries given by Texas Instruments. In particular, I have used Texas Instruments diagnostic library (SafeTI) for Built-In Self Test development. I want to integrate this code in a Simulink model to extend it with TI Embedded Coder blocks. I have tried with Simulink SFunction block, but ccs compiler doesn't seem to be compatible.
Is there a way to do it? Are there Texas Instruments Simulink blocks for Built-in Self Tests development?
  댓글 수: 1
xiaomeng cheng
xiaomeng cheng 2020년 5월 20일
I have the same requirement, and would you please share your solution in Mathworks File Exchange? Thanks
hfmm633@163.com

댓글을 달려면 로그인하십시오.

채택된 답변

Antonin
Antonin 2018년 11월 8일
Hi Pasquale,
In your S-function, use the below construct anywhere needed:
#ifndef MATLAB_MEX_FILE
/* Place here processor specific code that only runs on your target hardware */
#else
/* Place here equivalent code that can be compiled on the host for simulation */
#endif
Here is a doc page that explains the technique: Templates for C S-Functions.
Feel free to post your S-functions on the MathWorks File Exchange once they work, as it sounds like they could be useful to others.
I hope it helps,
Good luck,
Antonin.

추가 답변 (0개)

Community Treasure Hunt

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

Start Hunting!

Translated by