Generate DLL from Simulink model

Hallo everybody,
I am about to start working on an interface between Simulink modules and GH BLADED, software tailored to simulate the dynamic behavior of wind turbines. Within Simulink, I plan to develop some control strategies. This control model should be then ported as DLL to BLADED and actually command the reaction of the turbine to external inputs.
I'd appreciate knowing if any of you may address me to the easier procedure to generate DLL out of a Simulink model. At the time of writing, I do not have a clear idea about the best way to go.
Perhaps, it would be an option to generate a .tlc file, suited only for BLADED, exactly as it happens with LabView (but LabView already supports such a tlc file, BLADED so far does not).
I really thank you in advance for considering my request.
Kindest regards, FPe

5 comentarios

Hey Francesco,
I have almost the same idea to generate a dll file in Simulink, but
with the slightly difference that i want to use it for the simulation
software FAST. I got the Matlab Simulink version 2016b now and the
embedded coder ert_shrlib.tlc is not available anymore. Only ert.tlc is
available. Do you think it will be the same process, like what Ms.
Kaustubha agreed with? or is there any other way to generate a dll file
in Simulink?
Thank you very much in advance
Kindest Regards, KM
Sven Wolf
Sven Wolf el 24 de Nov. de 2020
I have the same question just from Simulink to PSCAD
I am working in an Institute where we developed a Simulink and a PSCAD model for our electric research topic(both models are similar, just realised in different softwares).
But now we had the idea, that we will use Simulink to calculate our Electric-Controls, but all the other physics we want to do in PSCAD.
Our idea was, that we will generate a DLL-file of our Control-System in Simulink and link it in PSCAD.
But we dont really know how we have to do that. So we have some question, that would really help us:
1.
Is it even possible to calculate some parts of the model in Simulink and link them via DLL-files into PSCAD where all the other calculations take place?
2.
What are the configurations, that we have to do in Simulink first in order to link the DLL-files later into PSCAD? We know roughly how to generate DLL-files from our Simulink-Model, but we have doubts that this configurations, that we have to do for that are enough for later linking it with PSCAD
(how we generate DLL-files in Simulink:
1. selecting "ert_shrlib.tlc" as System Target File
2. and then we just build the model and it generates the c-files and the h-
files and also one dll-file(if its necessary: we also have the Embedded-
Coder license for Simulink)
IS THIS THE RIGHT WAY?! Maybe you know that better)
3.
If the way we generate DLL-files, that we described in 2.) is right, what parts of the generated code is important for the linking in PSCAD? Is it only the DLL-file, or do whe also have to link all the c-files and h-files?
You would really help us with that quetions.
If we can solve the upper questions our next question would be, what and how we are allowed to change the Simulink-Model or the PSCAD-Model while using the DLL in both Proramms? What are the limitations there and after what we have to always update the DLL-file? Maybe this is done automatically?
Thank you very much!
Kind regards
Sven Wolf
Andrea Verdicchio
Andrea Verdicchio el 4 de Mayo de 2021
Hello Sven,
I try to do the same job as you. However, I have various difficulties. Have you succeeded? do you have any documents that I can read or there is a documented process?
Could you help me? Please
Thank you for your time.
Regards,
Andrea Verdicchio
Olatunji Fulani
Olatunji Fulani el 12 de Jun. de 2021
Hello Sven,
Were you able to resolve your SIMULINK-DLL-PSCAD issues? I'd like to know more as I am having similar problems. Thanks.
Daniel Ortiz
Daniel Ortiz el 16 de Ag. de 2024
Hello Olatunji, were you able to solve your problem with PSCAD? I also have a problem with it
Thanks

Iniciar sesión para comentar.

 Respuesta aceptada

Kaustubha Govind
Kaustubha Govind el 7 de Oct. de 2013

1 voto

You can use ert_shrlib.tlc if you have the Embedded Coder product to generate generic DLLs from your Simulink model. The relevant documentation is here: Shared Object Libraries.

5 comentarios

PEF
PEF el 7 de Oct. de 2013
Hallo,
first of all, thanks for your answer.
I was more thinking to go this way:
- Derive a custom TLC from the grt.tlc file using the "Custom Target" example in the RTW Embedded Coder documentation, which does NOT require RTWEC, only RTW.
- Derive a custom TMF from the grt_vc.tmf file.
- Finally derive a C file.
Does it make any sense to you?
Kaustubha Govind
Kaustubha Govind el 7 de Oct. de 2013
Yes, that is exactly the process if you want to create your own custom target. More documentation here.
PEF
PEF el 7 de Oct. de 2013
Would I achieve the same just by employing ert_shrlib.tlc as you suggested?
Tusharkumar Jivani
Tusharkumar Jivani el 1 de Ag. de 2017
Hi everyone,
I would like to generate DLL from Simulink model (which is basically a controller). To do so, I have selected generic real time target (grt.tlc) from modal configuration parameters and build the model. Afterall, It has successfuly generated c files and directories.
Now, I would like to write a wrapper file to allow it to be called from external functions. For that I need grt_main.c file, and according to attached documentation (simulink_dll.pdf)It can be found in ($MATLABHOME)\rtw\c\grt directory. However, I am not able to find updated grt_main.c file inside this directory and It shows only previous files. So could you please provide me some suggestions?
Thank you so much in advance.
best regards, Tushar
Sameer Gadekar
Sameer Gadekar el 20 de En. de 2021
@Tusharkumar Jivani Are you able to find solution for this ? Can you please share your solution ?

Iniciar sesión para comentar.

Más respuestas (1)

Ivo Houtzager
Ivo Houtzager el 11 de Ag. de 2020

0 votos

There is a Simulink controller design example to create DLL for GH Bladed and OpenFAST in github, see

3 comentarios

Rasmus Visgaard
Rasmus Visgaard el 24 de Mzo. de 2021
Hi Ivo, thanks for the link. This seems to be tailored for an earlier version of Bladed. Are you aware if something has been made for later vesions of Bladed such as v4.10?
YIZA SRIKANTH REDDY
YIZA SRIKANTH REDDY el 7 de Oct. de 2022
Hello lvo
Actually i am facing problem to generate .DLL form the model from above link , enenthough model is build successfully. In build directory some .c and.h files were generated, after that how we would gnerate .dll ?
please help me in this. thmaks inadvance
Dusan
Dusan el 6 de En. de 2026
https://www.youtube.com/watch?v=G1OQr9WYKUo

Iniciar sesión para comentar.

Categorías

Más información sobre Deployment, Integration, and Supported Hardware en Centro de ayuda y File Exchange.

Preguntada:

PEF
el 5 de Oct. de 2013

Comentada:

el 16 de Ag. de 2024

Community Treasure Hunt

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

Start Hunting!

Translated by