Can I use custom libraries (.dll/.lib/.so/.a) with Simulink Real-Time?
30 visualizaciones (últimos 30 días)
Mostrar comentarios más antiguos
MathWorks Support Team
el 16 de Mayo de 2022
Editada: MathWorks Support Team
el 4 de Jul. de 2024
Are custom Windows libraries (.dll/.lib) or Unix libraries (.so/.a) supported for integration with my real-time model running on Speedgoat hardware when using Simulink Real-Time (SLRT)?
Respuesta aceptada
MathWorks Support Team
el 4 de Jul. de 2024
Editada: MathWorks Support Team
el 4 de Jul. de 2024
Custom libraries are generally supported with Simulink Real-Time (SLRT), as long as they are compiled with the same compiler used by Simulink Real-Time. The specific details depend on the MATLAB release you are using:
Simulink Real-Time has adopted the QNX Neutrino 64-bit Real-Time Operating System (RTOS) and supports both dynamic (.so) and static libraries (.a). Windows libraries (.dll/.lib) are not supported in these versions.
These .so and .a libraries must be compiled with the QNX C/C++ compiler (qcc) compiler matching the version included in the Simulink Real-Time Target Support Package. To utilize shared dynamic libraries (.so), these must be transferred to the target's filesystem before use. Static libraries (.a), on the other hand, are directly integrated into the real-time application file on the host.
For a detailed guide on integrating external code and libraries, refer to the link below. The "Additional C/C++ Project for Simulink Real-Time" section at the bottom of the page has a reference to a full example hosted on GitHub:
Additionally, you can learn how to compile source code into a library using the QNX compiler (QCC) within the context of FMUs from this documentation:
Simulink Real-Time operates on a Win32 API-compatible 32-bit RTOS. Only static libraries (.lib) are supported. Windows dynamic libraries (.dll) and Unix libraries (.so/.a) are not supported.
To use these libraries with your S-Function on a Speedgoat target, they must be compiled as 32-bit libraries using Visual Studio. Ensure you have both 32-bit (for the target) and 64-bit (for the host) versions of your libraries. You can then use the "rtwmakecfg.m" method to add the libraries to the build process.
For more information on customizing generated makefiles and adding build dependencies, see:
0 comentarios
Más respuestas (0)
Ver también
Categorías
Más información sobre Troubleshooting in Simulink Real-Time en Help Center y File Exchange.
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!