Filter löschen
Filter löschen

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

3 Ansichten (letzte 30 Tage)
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 Kommentare
Kaustubha Govind
Kaustubha Govind am 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 am 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

Melden Sie sich an, um zu kommentieren.

Akzeptierte Antwort

Kaustubha Govind
Kaustubha Govind am 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 Kommentare
Carlos
Carlos am 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 am 17 Sep. 2013
Carlos: Sorry, this is beyond my expertise. You could try posting a new question or contact MathWorks Tech Support.

Melden Sie sich an, um zu kommentieren.

Weitere Antworten (0)

Kategorien

Mehr zu Simulink Coder finden Sie in Help Center und File Exchange

Community Treasure Hunt

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

Start Hunting!

Translated by