s function feedthrough problem

1 view (last 30 days)
ander
ander on 3 Mar 2015
Commented: Yongliang Lee on 6 Apr 2020
Good morning for everybody. first of all excuse me for my english.
I am working with S-functions and everything is going ok but suddenly matlab crashes and it give me this error:
------------------------------------------------------------------------------------------------------------------------------------------- _This error was detected while a MEX-file was running. If the MEX-file is not an official MathWorks function, please examine its source code for errors. Please consult the External Interfaces Guide for information on debugging MEX-files.
If this problem is reproducible, please submit a Service Request via: http://www.mathworks.com/support/contact_us/
A technical support engineer might contact you with further information.
Thank you for your help. MATLAB may attempt to recover, but even if recovery appears successful, we recommend that you save your workspace and restart MATLAB as soon as possible.
------------------------------------------------------------- This segmentation violation occurred while executing the S-function 'DI1' in block 'simulador_tren/VarDBs/DI'. A common cause of this segmentation violation is an incorrect input port direct feedthrough setting. Each input port of the S-function that is read (accessed) in mdlOutputs and/or mdlGetTimeOfNextVarHit must specify that it needs its input signal in these routines by setting direct feedthrough for these input ports. 1) To debug your C-MEX S-function, you can enable diagnostics by compiling the S-function source with the -g flag, e.g., mex -g sfunction_name.c 2) You can ask Simulink to try assuming your S-function has direct feedthrough using: set_param('modelname','TryForcingSFcnDF','on') If Simulink can find a valid sorting mode that does not result in algebraic loops involving your S-function, your model will execute (assuming that the cause of this segmentation violation is an incorrect direct feedthrough setting on an input port). See matlabroot/simulink/src/sfuntmpl_directfeed.txt ------------------------------------------------------------- -----------------------------------------------------------------------------------------------------------------------------------_
I don`t understand why it gives me this error after 600 seconds working fine. All the inputs in the S-function has the direct feedthrough on true. Using other S-function everything is fine but with this i have this error. Please help me because i cannot understand it. thanks.
  1 Comment
Yongliang Lee
Yongliang Lee on 6 Apr 2020
yeah,good friend,have you handled this problem?

Sign in to comment.

Answers (0)

Categories

Find more on Simulink Coder in Help Center and File Exchange

Products

Community Treasure Hunt

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

Start Hunting!