f



Error while obtaining sizes from MEX S-function 'forward' in block 'dummy/Dynamic_Model/S-Function'. MATLAB error message:.

Hi to everybody,

I created the file forward.dll using the command:

mex -DWIN32 -output forward model_d.c model_s.c sdlib.c assigns.c contact.c
derivs.c gmc.c impact.c inits.c invert.c lcp_solver.c lmdif_c.c mathtools.c
object.c output.c pipetools.c readmuscles.c readtools.c sdfor.c
spring_based.c wrapping.c gcvspl.c user_def.lib forward.lib acpp.lib
qhull.lib solid.lib wrap.lib

I need to run the command:

set_param([subsystemname,'/','S-Function'],'function
name','forward','parameters','[0],[0],[0],[0],[0],[0],[1 0 0 0 20],[0]');

but i receive the below message:

------------------------------------------------------------------------
       Segmentation violation detected at Feb 14 20:14:16 2004
------------------------------------------------------------------------

Configuration:
  MATLAB Version:   6.1.0.450 (R12.1)
  Operating System: Microsoft Windows 2000
  Window System:    Version 5.1 (Build 2600)
  Processor ID:     x86 Family 6 Model 4 Stepping 4, AuthenticAMD
  Virtual Machine:  Java 1.1.8 from Sun Microsystems Inc.

Register State:
  EAX = ffffffff  EBX = 00000000
  ECX = 00000000  EDX = 16b6e0c4
  ESI = 16b6e0a4  EDI = 16404010
  EBP = 0149ca60  ESP = 0149ca1c
  EIP = 77f7e2ad  FLG = 00010212

Stack Trace:
  [0] ntdll.dll:0x77f7e2ad(0x16b6e0a4, 0x16b72994 "Unable to load input
parameters:..", 0x16b7a420 "C:\Documents and Settings\vassil..", 1)
  [1] forward.dll:0x16b5c462(0x16b74a48 "simulink_only_sfcn", 0x16404010, 0,
0x166cef00)
  [2] forward.dll:0x16b5f8c9(2, 0x166dedd0, 0x168b2bd0, 0x19041368)
  [3] forward.dll:0x16b5f3ad(1, 0x1904df10, 0, 0x166dedd0)
  [4] forward.dll:0x16b5ddee(1, 0x1904df10, 12, 0x166dedd0)
  [5] libmex.dll:_mexRunMexFile(1, 0x1904df10, 12, 0x166dedd0) + 71 bytes
  [6] m_interpreter.dll:_inCallMexFunction(1, 0x1904df10, 12, 0x166dedd0) +
476 bytes
  [7] m_interpreter.dll:_inRunMexFile(1, 0x1904df10, 12, 0x166dedd0) + 121
bytes
  [8] m_interpreter.dll:_inCallMexFile(1, 0x1904df10, 12, 0x166dedd0) + 28
bytes
  [9] m_interpreter.dll:_inCallFunctionGeneral(1, 0x1904df10, 12,
0x166dedd0) + 46 bytes
  [10] m_interpreter.dll:_inCallFunction(1, 0x1904df10, 12, 0x166dedd0) + 30
bytes
  [11] m_interpreter.dll:_inDoMatlabFcnCall(1, 0x1904df10, 12, 0x166dedd0) +
169 bytes
  [12] simulink.dll:_IssueSFcnSizesCall(0x19041368, 0x1904de00, 0x08dcae48,
0x16404010) + 74 bytes
  [13] simulink.dll:_GetSizesFromMexSFcn(0x16883180, 0x0149cf1c, 0x08dcae48,
0x1904def0) + 31 bytes
  [14] simulink.dll:_MexSFcnInitializeSizes(0x1904def0, 0x08dcae48,
0x02794cb0, 0x16883180) + 22 bytes
  [15] simulink.dll:_InitSFcnInfo(0, 0x01a20bf0, 0x08dcae48, 0x0266ac98) +
394 bytes
  [16] simulink.dll:_InitSFcnInfoForSFcn(0x16883180, 34128, 1, 0x16883180) +
126 bytes
  [17] simulink.dll:_SfcnEvalParamsGraphical(0, 0x02794cb0, 0x165d7418,
0x16883100) + 198 bytes
  [18] simulink.dll:_SFcnEvalParamsFcn(0x16883100, 0x0149d27c, 0x026f51f0,
0) + 299 bytes
  [19] simulink.dll:_BlockEvalParams(0x16883180, 0, 2, 0x0174577c) + 696
bytes
  [20] simulink.dll:_matl_set_param(0, 0x0149d0a0, 0x01000005, 0x0149d268) +
1606 bytes
  [21] simulink.dll:void __cdecl slFullSetParam(int,struct mxArray_tag * *
const,int,struct mxArray_tag * * const)(0, 0x0149d0a0, 5, 0x0149d268) + 24
bytes
  [22] m_interpreter.dll:_inExecuteInternalFcn(144, 5, 0, 0) + 1122 bytes
  [23] m_interpreter.dll:_inInterPcode(2, 0x0149dce0, 0, 0) + 2320 bytes
  [24] m_interpreter.dll:_in_local_call_eval_function(0, 0x0174d840,
0x0149dce0, 0x0149dd74) + 174 bytes
  [25] m_interpreter.dll:_inEvalStringWithIsVarFcn(0x18ff1010
"set_param([subsystemname,'/','S-..", 126, 0, 0) + 340 bytes
  [26] m_interpreter.dll:_inEvalString(0x18ff1010
"set_param([subsystemname,'/','S-..", 126, 0, 0) + 50 bytes
  [27] m_interpreter.dll:_inEvalCmdWithLocalReturnandtype(0x18ff1010
"set_param([subsystemname,'/','S-..", 0, 2, 0x0149dea4) + 68 bytes
  [28] m_interpreter.dll:_inEvalCmdNoEnd(0x18ff1010
"set_param([subsystemname,'/','S-..", 0x13d612d1, 0, 11) + 16 bytes
  [29] matlab.exe:_mnParser(0, 271244, 0, 39) + 980 bytes
  [30] matlab.exe:_WinMain@16(0x00400000 "MZ?", 0, 271244, 1) + 3136 bytes
  [31] matlab.exe:_WinMainCRTStartup(0, 1, 0x7ffdf000, 0xf4b5acf4) + 308
bytes
  [32] kernel32.dll:0x77e7eb69(0x0043e930, 0, 0x00905a4d, 3)

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.


 -------------------------------------------------------------
 This segmentation violation occurred while executing the
 S-function 'forward' in block 'dummy/Dynamic_Model/S-Function'.
 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
 -------------------------------------------------------------

Error in ==> C:\Documents and Settings\vassilis\My
Documents\arm_hope\forward.dll
??? Error using ==> set_param
Error while obtaining sizes from MEX S-function 'forward' in block
'dummy/Dynamic_Model/S-Function'. MATLAB error message:.

I do not know how to find and check the input ports in the forward.dll if
this is a solution.

Thanks in advance.

Vassilis





0
vassilis (6)
2/14/2004 8:12:43 PM
comp.soft-sys.matlab 211266 articles. 19 followers. lunamoonmoon (257) is leader. Post Follow

0 Replies
1688 Views

Similar Articles

[PageSpeed] 39

Reply: