Azzera filtri
Azzera filtri

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

27 visualizzazioni (ultimi 30 giorni)
Roop
Roop il 8 Ago 2024 alle 16:27
Risposto: Pratyush il 14 Ago 2024 alle 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!

Risposte (1)

Pratyush
Pratyush il 14 Ago 2024 alle 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.

Community Treasure Hunt

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

Start Hunting!

Translated by