S Function related error

Hi,
I get the following error when I try to run a simulink model that uses a Matlab/Simulink toolbox called TNO Delft( privately obtained).
" Error in 'test_delfttyre_cpi/CPI tyre/S-Function' while executing C MEX S-function 's_delfttyre_cpi', (mdlStart), at time 0.0. "
What could be the probable reasons for such an error.?
[I have installed the following C compiler "Microsoft Visual C++ 2010 express.] [ Matlab Version :7.12.0(R2011a); 64bit]
Thank you.

12 个评论

It looks like the S-function itself might be throwing an error. Do you see any other information about the actual error? If you have access to the source code, you may want to look into how the mdlStart function is implemented. If not, please try contacting the vendor.
The source code is protected and cannot be accessed. I did contact the vendor before posting here but I got no response from them. The model started to work when I updated my Matlab to R2013a and reinstalled the compiler.
Thank you.
Great! Could you please post your solution as an Answer and accept it, so we know this is resolved? Thanks!
Hello again,
The problem I had earlier has returned again. Now it shows the same error as before: " Error in 'test_delfttyre_cpi/CPI tyre/S-Function' while executing C MEX S-function 's_delfttyre_cpi', (mdlStart), at time 0.0.
Caused by: Error opening tyre property file "TNO_car205_60R15.tir"
-I have the s_delfttyre_cpi file in both .mexw32 and .mexw64 formats(given by vendor). However, these files do not show up in the s-function browser that pops up when you click the 'edit' button in the Simulink Model block.
-There are no faults with the "TNO_car205_60R15.tir" file.
When I had upgraded to R2013a from R2011a the model worked fine. However, whenever I tried to open the s-function file before running the model, it generated the same error as above. Then I had to quit Matlab and restart it to make the model work, only this time I hadn't touched any file prior to running the model. The same trick is no longer working.
I currently have Matlab R2013a version, with C++Microsoft Visual Studio2010 compiler.
Could you please help me with this peculiar case? Thank you for your time.
Alexander: It is difficult to help in this situation because I don't know anything about the S-function. If you have the source code, I would recommend debugging it. In the absence of the source code, it might be best to contact the vendor.
I understand. Thank you for your time.
Hello Ms Kaustubha!
The model is now working! There is something strange going on(atleast to me). The model works when I navigate in the 'current folder window'(double click open) to the Folder containing the Simulink Demo. However, when I navigate back to the main folder in which all other folders exists, the same model doesnt run.
-Path C:\Users\Win7\Documents\MATLAB [Model doesn't work]
-Path C:\Users\Win7\Documents\MATLAB\MF-Tyre MF-Swift 6.1.2.1\MATLAB\Simulink_demos [Model Works!]
I have specified all the \MF-Tyre MF-Swift 6.1.2.1\ subfolders from the 'set path' option too and they are highlighted in the current folder window as well.
What could be the reason behind this?
Thank you.
Are there any DLLs in \MF-Tyre MF-Swift 6.1.2.1\?
Yes, there are .dll files in one of the folders in \MF-Tyre MF-Swift 6.1.2.1\Common\Win64\
However, all these files are on the path. I also observed that the files stored in \MF-Tyre MF-Swift 6.1.2.1\ also doesnt work. It has to be stored specifically in \MF-Tyre MF-Swift 6.1.2.1\MATLAB\Simulink_demos
Could you please explain a little why this happens? Even a link providing the explanation would be helpful.
Thank you.
I would like to clarify one of the above sentences a little. "I also observed that the files stored in \MF-Tyre MF-Swift 6.1.2.1\ also don't work". By files I mean the Simulation Models. The same error appears.
Have the DLL files been added to the System PATH environment variable as well?
Hello,
I too have been facing the same issue. I get an error saying:
while executing C MEX S-function...(mdlstart), at time 0.0
caused by error opening road data file.
Can someone help me with this.

请先登录,再进行评论。

回答(0 个)

产品

Community Treasure Hunt

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

Start Hunting!

Translated by