フィルターのクリア

How to generate a TLC file for a MEX file externally obtained?

27 ビュー (過去 30 日間)
Roop
Roop 2024 年 8 月 8 日 16:27
回答済み: Pratyush 2024 年 8 月 14 日 9:07
Hello,
I have a Simulink simulation utilizing an S-Function block tied to an externally generated MEX file, which I am trying to make code generation compatible.
I have reviewed these articles about the topic:
However, I was wondering how I would generate a TLC file if the MEX was auto-generated by an external modeling software. Do I need access to the source C Code before MEX file generation? Is there a way to manually build it without knowledge of how the MEX is built?
Just looking for information on what information/access I would need.
Thanks!

回答 (1 件)

Pratyush
Pratyush 2024 年 8 月 14 日 9:07
Hi Roop,
To generate a TLC file for an MEX file created by external modeling software, ideally, you should have access to the source C code. This allows you to understand the function signatures, data structures, and algorithms used, making it easier to write a TLC file that mirrors the MEX function's behavior.
If you don't have the source code, you need to understand the MEX function's interface, including input/output arguments and data types, and its behavior, possibly through documentation or testing. You should also understand the Simulink S-Function block's interaction with the MEX function.
Steps to Create a TLC File:
1. Document the Interface: Note input/output ports, data types, and parameters.
2. Write the TLC File: Mimic the MEX function's behavior in the TLC file, defining input/output ports.
3. Test the TLC File: Ensure the generated code behaves like the original MEX function by comparing results.

カテゴリ

Help Center および File ExchangeTarget Language Compiler についてさらに検索

Community Treasure Hunt

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

Start Hunting!

Translated by