how to import C code files or precompiled libraries into Simulink

How to import external C-code(.c) and precompiled libraries (.a) from files into Simulink with Embedded Coder?
I found the S-block in the documentation, but I don’t want to copy and paste the C code into the modules manually, I would rather prefer a block that could point to files in disk.
The reason behind is we alread hava a C toolchain based repository, with multiple users commiting code changes, and I don't want to have to manually update all the S blocks on my model manually with the C code from our repository every time we have a change. I want Embedded Coder to pick the files from disk automatically and compile them with the model.
Is it any other easy way to export a project from ETAS ASCET into Simulink/Embedded Coder ?
Regards.

回答 (1 件)

Fangjun Jiang
Fangjun Jiang 2020 年 1 月 9 日

0 投票

Use "C Caller" block
https://www.mathworks.com/help/releases/R2019b/simulink/slref/ccaller.html

2 件のコメント

Jose Peral
Jose Peral 2020 年 1 月 9 日
編集済み: Jose Peral 2020 年 1 月 9 日
great thanks!
Is it any way to import precompiled libraries (.a files) ?
Regards.
Fangjun Jiang
Fangjun Jiang 2020 年 1 月 9 日
Try it. I've been able to import .lib files with matching .h files.

サインインしてコメントする。

カテゴリ

ヘルプ センター および File ExchangeSimulink Coder についてさらに検索

製品

リリース

R2019b

質問済み:

2020 年 1 月 9 日

コメント済み:

2020 年 1 月 9 日

Community Treasure Hunt

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

Start Hunting!

Translated by