Highlighted

Amesim to Simulink Co-sim mex issue

Experimenter
Experimenter

Hello,

 

I'm successfully created co-simulation AMESim and simulink models and I can execute fine when the amesim model is in the current folder in matlab.  However, our simulation architecture requires it be several folders beneath the current folder.  This causes an abnormal exit from the s-function mex.

 

Also, I moved the simulink model and the mex file to a sub-folder location and the simulation executed fine.

 

Thanks,

Joe

3 REPLIES 3

Re: Amesim to Simulink Co-sim mex issue

Siemens Phenom Siemens Phenom
Siemens Phenom

I think it's possible to have your mex file in a subfolder, but that folder needs to be in MATLAB path.

Have you tried this?

 

Re: Amesim to Simulink Co-sim mex issue

Experimenter
Experimenter

Yes, I have moved the mex file to another folder on the path and that works.  However, the *.ame file alway needs to be in the matlab current directory, being in another folder on the path does not work.  I've dug into the c-file amesim makes to create the mex and there appears to be a function that hard codes this into the compiled mex.  I'm currently trying to pass an absolute path into the amemex.exe comiler program to get around this.

Re: Amesim to Simulink Co-sim mex issue

Siemens Phenom Siemens Phenom
Siemens Phenom
You're right, I didn't know the current folder was that critical! Not sure why it was done like this...