Good afternoon! Halp please, I try to connect s-function, but there is a following error... I do not know as with it to struggle. I will be grateful for any help :)
Error in ' modl/S-Function ' while executing MATLAB S-function ' my ', flag = 3 (output), at time 0.0.
Invalid MEX-file ' C:\Program Files\MATLAB\R2010b\work\tiphak.dll ':.
I have Windows 7 32-bit, Matlab r2010b

 채택된 답변

Natalia
Natalia 2011년 2월 27일

0 개 추천

the source code http://depositfiles.com/files/pmt4tccyy
I used a template simfeatures/src/csfunc.c
I used an example. Made mex. And then, has created dll in deploytool.
Excuse, I do for the first time s-function. Probably, I do something incorrectly :)

댓글 수: 3

Andreas Goser
Andreas Goser 2011년 2월 28일
From what I see, you are mixing two technologies that should not be mixed. On the one hand, there is the Simulink technology to create C MEX S-Functions from c code. You can use them in you simulation and also for the generated code. On the other hand, there is the MATLAB / MATLAB Compiler technology, where you can create e.g. stand-alone applictions and libraries from MATLAB code. You shouldd not mix them.
My recommendation is to get in touch with Technical Support and first discuss the goal of your application, then decide on which technologies and products to use and then apply them.
Kaustubha Govind
Kaustubha Govind 2011년 2월 28일
To add to Andreas' comment, it seems like you are mixing MATLAB S-functions with C-MEX S-functions (your error message suggests so). You need to directly call the generated MEX function (.mexw32 extension) from the S-function block.
Natalia
Natalia 2011년 2월 28일
Thank you very much. I am very grateful. You helped me to understand :)

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

추가 답변 (2개)

Andreas Goser
Andreas Goser 2011년 2월 27일

0 개 추천

On Win32 and R2010b, the extension of a MEX file / C MEX S-Function should be MEXW32.
If you have a DLL instead, this could be an S-Function from an older relase you either created yourself or retrieved from somebody else. Please re-generate the S-Function with the MEX command and the C source code.
Natalia
Natalia 2011년 2월 27일

0 개 추천

My dll has been made on WinXP, Matlab R2010b. Has tried to make simulink model on the same computer where has been made dll. The error remains :(

댓글 수: 2

Andreas Goser
Andreas Goser 2011년 2월 27일
"Has been made"? Maybe in is not an S-Function at all, but a "generic DLL"? Do you have the source code and is it of S-Function syntax?
Natalia
Natalia 2011년 2월 27일
Yes I have the source code. I used a template simfeatures/src/csfunc.c

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

카테고리

도움말 센터File Exchange에서 Simulink Coder에 대해 자세히 알아보기

제품

질문:

2011년 2월 27일

Community Treasure Hunt

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

Start Hunting!

Translated by