フィルターのクリア

S-function codegeneraton for rtw: error C2065: 'ssGetData​TypeSize_c​annot_be_u​sed_in_RTW​': undeclared identifier

27 ビュー (過去 30 日間)
Hello,
I would like to use this function in an s-function to determine the memory size in bytes of a custom datatype.
// Retrieve the size in bytes of the datatype at the input port
int_T size = ssGetDataTypeSize(S,dtype);
This works fine in simulation, but when generating code for my target, I receive the following error:
error C2065: 'ssGetDataTypeSize_cannot_be_used_in_RTW': undeclared identifier
So probably this is not supported?
This is the only function preventing me to deploy my code on my realtime target.When hardcoding the size, codegeneration and running is succesfull. Therefore I would like to ask if there is an alternative to retrieve the memory size.
Kind regards,
Brecht
  5 件のコメント
Karel Viaene
Karel Viaene 2022 年 2 月 4 日
Hello Benjamin,
Thank you for your reply. I believe this is exactly what I'm looking for. To clarify, we don't use PLC coder, but generate C++ code with simulink coder.
However I have no experience yet with TLC, so I think I need to learn this first. If I understand correctly, the TLC file will contain an alternative implementation which is interpreted differently at compile time. At compile time te compiler will know all sizes of the input ports and can then 'hardcode' the right value at compiletime.
I will come back to you if I played around with this a bit; already thanks for the help.
kr
brecht
Karel Viaene
Karel Viaene 2022 年 2 月 4 日
Hi Benjamin,
I started learning writing tlc using the tutorials. The directive you talked about before works for me. In the generated code it can retrieve the datatype of the input signal on which the sizeof() operator can be applied. Then I was able to generate code with my TLC file corresponding to the S-function c++ code and deploy it on the target.
Still many things to learn about tlc apparently, but it's a start.
thanks for the help!
kr,
Brecht

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

採用された回答

Benjamin Thompson
Benjamin Thompson 2022 年 2 月 4 日
See this documentation for more information on the Target Language Compiler and some tutorials with instruction on how to use this tool and code TLC:

その他の回答 (0 件)

カテゴリ

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

製品


リリース

R2021b

Community Treasure Hunt

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

Start Hunting!

Translated by