Can be imported a .dll file to Simulink?
5 visualizzazioni (ultimi 30 giorni)
Mostra commenti meno recenti
Hello,
I'm having some questions and hope to find some answears/tips here. Any advice is appreciated.
I have a model in Simulink that contains a Library, I've generated C Code out of the model and now I'm trying to complile the generated C Code with headers and other files into a .dll file with a gcc compiler.
My problem is how to include/import the .dll file back in Simulink, and is it possible to import the .dll inside a block (an S-Function for example) having all the inputs and outputs of the original library?
Thanks, Alex
0 Commenti
Risposte (1)
Kaustubha Govind
il 20 Set 2012
Technically you should be able to bring any generic DLL into Simulink via an S-function block, but I'm not completely confident that you won't have any issues doing so with a Simulink Coder generated DLL. You will mostly likely be able to get this done for normal mode simulation, but I'm afraid that there might be multiple definitions of types that will clash when you generate code from the model and use the S-function in non-inlined mode. Essentially, you might see a file called rtwtypes.h created with the DLL - a header will the same name is produced when generating code from any model. The trouble is that rtwtypes.h contains generic platform-independent types, but may also include user-defined types, fixed-point types, etc. So you might need to combine the 2 rtwtypes.h files. (Please take my advice with a grain of salt because I haven't tried this myself - this is mostly speculation)
Is there a reason why you can't simply generate an S-function from the first model and use the generated S-function in the second model?
2 Commenti
Kaustubha Govind
il 24 Set 2012
Alexandru: You will need to specify build rules in the Simulation Target>Custom Code pane for model compilation or simulation, and check the Use the same custom code settings as Simulation Target in the Code Generation>Custom Code pane for the same settings to be applied for code generation.
Vedere anche
Categorie
Scopri di più su Simulink Coder in Help Center e File Exchange
Prodotti
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!