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

조회 수: 3 (최근 30일)
Roop
Roop 2024년 8월 8일
답변: Pratyush 2024년 8월 14일
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일
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 CenterFile Exchange에서 Target Language Compiler에 대해 자세히 알아보기

Community Treasure Hunt

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

Start Hunting!

Translated by