Effacer les filtres
Effacer les filtres

Is possible to access to a MAT-file during the HIL simulation?

3 vues (au cours des 30 derniers jours)
Carlos
Carlos le 3 Sep 2013
Hi, I'm developing a target for a especific hardware. I generate a dll I need to acces to a MAT-file located in the same hardware to change some variables during the simulation. I have seen the files 'matdgns.c' and 'matcreat.c'. But I don't know how can I run this code in my hardware. Thanks in advance
  7 commentaires
Kaustubha Govind
Kaustubha Govind le 10 Sep 2013
Carlos: If you're writing a DLL independent of MATLAB to access the MAT-file, I don't understand why you have included simstruc.h - which is why I was asking if your DLL is an S-function.
Carlos
Carlos le 11 Sep 2013
My dll is not independent of Matlab. I generate it with Simulink Coder and Embedded Coder, and during the dll compilation the file 'simstruc.h' is included by 'rt_sim.c' in the line 32

Connectez-vous pour commenter.

Réponse acceptée

Kaustubha Govind
Kaustubha Govind le 11 Sep 2013
It appears that you are integrating MAT-file reading/creation code into code generated from Simulink Coder. Would it be possible to put the MAT-file related code in a separate C-file, so you don't see clashes between simstruc.h, and mat.h and matrix.h? I think you can "extern" the MAT-file function from the other C-file and call it from the file generated using Simulink Coder.
  6 commentaires
Carlos
Carlos le 17 Sep 2013
I have read this document. But when I try to implement it I have this error:
Error: Simulink Coder does not support both External Mode and the C API at the same time.
And I can't clear the external mode due to my requeriments
Kaustubha Govind
Kaustubha Govind le 17 Sep 2013
Carlos: Sorry, this is beyond my expertise. You could try posting a new question or contact MathWorks Tech Support.

Connectez-vous pour commenter.

Plus de réponses (0)

Catégories

En savoir plus sur Simulink Coder dans Help Center et File Exchange

Community Treasure Hunt

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

Start Hunting!

Translated by