How to generate a TLC file for a MEX file externally obtained?
3 vues (au cours des 30 derniers jours)
Afficher commentaires plus anciens
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:
- Use Level-2 MATLAB S-function: https://www.mathworks.com/help/simulink/slref/level2matlabsfunction.html
- TLC Files: https://www.mathworks.com/help/rtw/tlc/tlc-files.html
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!
0 commentaires
Réponses (1)
Pratyush
le 14 Août 2024
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.
0 commentaires
Voir également
Catégories
En savoir plus sur Target Language Compiler dans Help Center et File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!