How can I use an existing Level-2 C S-Function in embedded application?

1 回表示 (過去 30 日間)
Richard Crozier
Richard Crozier 2017 年 11 月 2 日
編集済み: Richard Crozier 2017 年 11 月 2 日
I have a simulink model which incorporates a Level-2 C code S-function. I would like to use Simulink Coder to build the model for an embedded platform (dSpace in this case). Is this possible, and if so, can anyone point me to the relevant documentation? Can I use the existing S-Function for this, or do I need to create something new?
I have tried to do code generation on the model, but I receive an error like: "Unable to acquire handle to MATLAB function 'my_SFunc'". What I really want is for Coder to build my S-Function for the target platform. Is this workflow even possible?

回答 (1 件)

Nick Sarnie
Nick Sarnie 2017 年 11 月 8 日
編集済み: Nick Sarnie 2017 年 11 月 8 日
Hi Richard,
Simulink Coder Code Generation using a model with a Level-2 C S-Function is a supported workflow. You should be able to generate code from the model as normal without changing the S-Function, but please note there are some limitations: https://www.mathworks.com/help/simulink/sfg/s-function-limitations.html
If you are facing an error, I would recommend re-creating the S-Function and trying to generate code again.
If you still face an error when trying to generate code, please contact MathWorks Technical Support for further assistance.

カテゴリ

Help Center および File ExchangeSimulink Coder についてさらに検索

Community Treasure Hunt

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

Start Hunting!

Translated by