The Math Forum

Search All of the Math Forum:

Views expressed in these public forums are not endorsed by NCTM or The Math Forum.

Math Forum » Discussions » Software » comp.soft-sys.matlab

Notice: We are no longer accepting new posts, but the forums will continue to be readable.

Topic: Matlab Crash
Replies: 3   Last Post: Feb 24, 2014 9:40 AM

Advanced Search

Back to Topic List Back to Topic List Jump to Tree View Jump to Tree View   Messages: [ Previous | Next ]
Saravanan Mani

Posts: 78
Registered: 6/3/11
Re: Matlab Crash
Posted: Feb 24, 2014 2:51 AM
  Click to see the message monospaced in plain text Plain Text   Click to reply to this topic Reply

"Steven Lord" <> wrote in message <le7rde$8ef$>...
> "Saravanan Mani" <> wrote in message
> news:le7839$igp$

> > Dear All,
> >
> > During simulation matlab has encountered on internal problem, I don't know
> > how to resolve this issue, Please let me know how to resolve this issue.

> *snip most of the crash log file*

> > -------------------------------------------------------------
> > This segmentation violation occurred while executing the S-function
> > 'SF_Comp_I_330_SWF_HVSMBWP' in block 'Composition_Signal_Test/S-Function
> > Builder'.
> > 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
> > -------------------------------------------------------------

> Did you try these two steps? If you don't know how to do so, or if you've
> tried them and it hasn't resolved the problem, send your model and the crash
> log file to Technical Support (see the instructions in my signature for how
> to contact them.)
> --
> Steve Lord
> To contact Technical Support use the Contact Us link on

Dear Steve Lord,

Thanks for your reply, sorry for delaying.

I have tried those two methods for your reference Please see below.

>> mex -g SF_G11_I330_SW_F_wrapper.c
LINK : error LNK2001: unresolved external symbol mexFunction
C:\Users\qxf8933\AppData\Local\Temp\mex_W1PQbQ\templib.x : fatal error LNK1120: 1 unresolved externals

C:\PROGRA~1\MATLAB~1\BIN\MEX.PL: Error: Link of 'SF_G11_I330_SW_F_wrapper.mexw32' failed.

??? Error using ==> mex at 208
Unable to complete successfully.

Model 'UnitTest_BMW_MOD_FuSiLDFwp_G11_G12' has specified
This setting enables a special execution mode found in Simulink 4.0 and earlier that attempts to compensate for S-functions that:
(1) Specify in mdlInitializeSizes that they don't have direct feedthrough on their input ports; and
(2) In their mdlOutputs or mdlGetTimeOfNextVarHit methods they then access the corresponding input signals.
This compensation mode can result in incorrect block execution orders for models involving S-functions within nonvirtual subsystems. Please update any S-functions in your model to specify direct feedthrough for any input port signals that are accessed in mdlOutputs() or mdlGetTimeOfNextVarHit() and then run set_param('UnitTest_BMW_MOD_FuSiLDFwp_G11_G12','TryForcingSFcnDF','off');
Note, the term 'direct feedthrough' can be misleading. To reduce the confusion, you can think of the direct feedthrough setting as a 'needs input' setting. Specifically, if the S-function access an input signal in either mdlOutputs() or mdlGetTimeOfNextVarHit(), then the direct feedthrough flag must be set to 1 (true). For more information see matlabroot/simulink/src/sfuntmpl_directfeed.txt

I can't share you my model, I asked my manager, No way to share our model.

I am doing unit test, Model has generated the code. I want to test the generated code. So i am testing with help of S-Function builder via. I am setting all the input/output ports and data types in the Data properties pane tab, like library pane, output pane I have given all the info. S-sunction builder is builded successfully.
Once done build, If i do simulation matlab went crashing.

I am in very difficult situation now, other people are saying for Generated C code testing they are suggesting other tools to management , but I am only one person saying we can able to do test in Matworks tool/ S-function builder block. Matworks very easy to understand compare than other tools I am saying. but I can't produce some output to them because I am facing this issue. I belive Matworks/ Matlab can do anying, Please I have over confidence with our tool. My confident want to success to the management Please do the needful, I need your support. I Want to success with Matlab Tool No need to use other tools.

I hope you understand my situation.

Best Regards,

Point your RSS reader here for a feed of the latest messages in this topic.

[Privacy Policy] [Terms of Use]

© The Math Forum at NCTM 1994-2018. All Rights Reserved.