Load a .dll file in Simulink

25 visualizaciones (últimos 30 días)
vithuran
vithuran el 30 de Sept. de 2013
Comentada: Kaustubha Govind el 1 de Oct. de 2013
Hi everyone,
Like mention the title I would like to know if is it possible to load a .dll file in Simulink (with a S-function for example). I'm a beginner at Simulink so please be as specific as you can.
Best regards
Vithuran

Respuestas (1)

Kaustubha Govind
Kaustubha Govind el 30 de Sept. de 2013
Editada: Kaustubha Govind el 30 de Sept. de 2013
Yes, this should be possible. I would recommend that you first achieve the interface using plain MATLAB code. For help, see Calling Functions in Shared Libraries. Once you have written the MATLAB code to call into your DLL, you can then place the same code in a Level-2 MATLAB S-function to create a Simulink block for it.
Alternatively, you can write standard C code to call into the DLL, and use C S-functions instead.
  2 comentarios
vithuran
vithuran el 1 de Oct. de 2013
Thanks a lot for your answer. It's maybe a stupid question, but to use the 'loadlibrary' function you need to have the .dll and also a file .h, but I don't have the last one. I only have a .dll file. How am I going to use the loadlibrary function without this file?
Vithuran
Kaustubha Govind
Kaustubha Govind el 1 de Oct. de 2013
Not sure, but I think people usually rig up their own header file with the function declarations of the functions exported from the DLL (please feel free to create a new question for this). Alternatively, you might be able to use C code to call into the library.

Iniciar sesión para comentar.

Categorías

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

Etiquetas

Productos

Community Treasure Hunt

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

Start Hunting!

Translated by