Borrar filtros
Borrar filtros

How to call a .dll and .h into Simulink Realtime?

5 visualizaciones (últimos 30 días)
Ahmed Ben Amer
Ahmed Ben Amer el 3 de En. de 2024
Respondida: Mark McBroom el 9 de En. de 2024
Hello,
I have some functionality I would like to use with Simulink. This functionality is in a .dll and .h files (I do not have access to the C code). I have used matlab loadlibrary function with my .dll and header files and it appears to work well. My question is how do I import this functionality into Simulink? Would it work in a matlab function block in Simulink?
I also understand I might be able to use a C- function block in Simulink but I am also unsure that would work as i do not have access to the original C files. I might have incorrect information so I am open to suggestions.
Thanks

Respuestas (1)

Mark McBroom
Mark McBroom el 9 de En. de 2024
You can use the C Caller block to do this. Rather than source code, provide the .dll in the "Libraries" tab of the Custom Code settings. You will need the header file that is used by the C Caller block to obtain the function prototype for the function in the .dll you want to call.

Categorías

Más información sobre Simulink Coder en Help Center y File Exchange.

Productos


Versión

R2023b

Community Treasure Hunt

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

Start Hunting!

Translated by