필터 지우기
필터 지우기

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

조회 수: 3 (최근 30일)
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
Kaustubha Govind
Kaustubha Govind 2013년 9월 10일
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 2013년 9월 11일
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

댓글을 달려면 로그인하십시오.

채택된 답변

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

댓글을 달려면 로그인하십시오.

추가 답변 (0개)

카테고리

Help CenterFile Exchange에서 Simulink Coder에 대해 자세히 알아보기

Community Treasure Hunt

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

Start Hunting!

Translated by