wenny.wang 发表于 2010-10-23 10:49:41

请教adams与matlab联合仿真问题(天线雷达例子)

我才开始学习adams与matlab联合仿真,就做天线雷达的例子熟悉下过程

不知道有用adams 2007 R3和matlab 7.0 R14联合仿真成功的吗,我按adams帮助文档一步步做天线雷达的例子,也将adams和matlab的工作路径设置在同一个目录下了,并将adams_plant.mexw32,adams_server.py,decode.m都放在该目录下了,但是就出现了下面的错误:
Error in S-function 'untitled/adams_sub/ADAMS Plant/S-Function':
S-Function 'adams_plant' does not exist
看过一些帖子后,我将adams生成的m文件里的某些路径里的“\”改为“/”,但是还是会出现一样的错误。

希望各位高手的帮忙

wenny.wang 发表于 2010-10-23 11:05:13

1# wenny.wang

其实刚开始的时候我用的是adams 2007 R3和matlab R2009b做的,但是同样的过程,再打开matlab R2009b 的时候就先提示以下内容:
Warning: Function c:\MSC.Software\MD_Adams\R3\win32\amd.dll has the same name
as a MATLAB builtin. We suggest you rename the function to avoid a potential
name conflict.

MATLAB desktop keyboard shortcuts, such as Ctrl+S, are now customizable.
In addition, many keyboard shortcuts have changed for improved consistency
across the desktop.
To customize keyboard shortcuts, use Preferences. From there, you can also
restore previous default settings by selecting "R2009a Windows Default Set"
from the "Active settings" drop-down list. For more information, see Help.
Click here if you do not want to see this message again.

Mex file entry point is missing.Please check the (case-sensitive)
spelling of mexFunction (for C MEX-files), or the (case-insensitive)
spelling of MEXFUNCTION (for FORTRAN MEX-files).
Warning: Initializing Handle Graphics failed in matlabrc.
This indicates a potentially serious problem in your MATLAB setup,
which should be resolved as soon as possible.Error detected was:
MATLAB:invalidMEXFile
Invalid MEX-file 'c:\MSC.Software\MD_Adams\R3\win32\dot.dll': .
> In matlabrc at 102
(紫色的部分都涉及到adams)

然后我在输入ant_test后,先出现下面的内容:
ans =
23-Oct-2010 11:06:35
Warning: Function c:\MSC.Software\MD_Adams\R3\win32\amd.dll has the same name
as a MATLAB builtin. We suggest you rename the function to avoid a potential
name conflict.
> In path at 110
In addpath at 87
In ant_test at 30
Warning: Function c:\MSC.Software\MD_Adams\R3\win32\amd.dll has the same
name as a MATLAB builtin. We suggest you rename the function to avoid a
potential name conflict.
> In path at 110
In addpath at 87
In ant_test at 32
Warning: Function c:\MSC.Software\MD_Adams\R3\win32\amd.dll has the same
name as a MATLAB builtin. We suggest you rename the function to avoid a
potential name conflict.
> In path at 110
In addpath at 87
In ant_test at 34
Warning: Function c:\MSC.Software\MD_Adams\R3\win32\amd.dll has the same
name as a MATLAB builtin. We suggest you rename the function to avoid a
potential name conflict.
> In path at 110
In addpath at 87
In ant_test at 36

然后才是:
%%% INFO : ADAMS plant actuators names :
1 control_torque
%%% INFO : ADAMS plant sensors   names :
1 rotor_velocity
2 azimuth_position

我就先没管这些,再输入adams_sys,然后都还正常,但到了仿真时就会出现以下错误:
Error reported by S-function 'adams_plant' in 'ant/adams_sub/ADAMS Plant/S-Function':Adams model file ant_test.cmd does not exist!!

同样的过程版本不一样错误都不同,请教高手帮忙解决。

wenny.wang 发表于 2010-10-23 11:09:09

不好意思,刚才的帖子里
错误是:
Error reported by S-function 'adams_plant' in 'ant/adams_sub/ADAMS Plant/S-Function':
Adams model file ant_test.cmd does not exist!!
不是
Error reported by S-function 'adams_plant' in 'ant/adams_sub/ADAMS Plant/S-Function':Adams model file ant_test.cmd does not exist!!

hndxzhoulei 发表于 2010-10-25 08:29:52

和楼上遇到同样的问题,现在没搞清,有没有高手过来帮忙?

wenny.wang 发表于 2010-11-4 14:49:42

终于用adams 2007 R3和matlab R2009b联合仿真成功了,当然是靠老师帮忙
要把杀毒软件和防火墙都关了
首先仿真成功的是李增刚的ADAMS 入门详解与实例 那本书上的联合仿真例子,老师把他仿真成功的文件夹发给我,第一次打开matlab时会报错(Error reported by S-function 'adams_plant' in 'control_pid/adams_sub/ADAMS Plant/S-Function':Could not connect to ADAMS server),但关闭再打开matlab后就成功了。不过在一次仿真成功后再按Start键,就又出错了,关了再重打开就好了。
后面再仿真了天线雷达和ball_beam的例子,也都可以了,不过也是类似问题。
不需要考adams_plant.mexw32,adams_server.py,plant.lib文件在工作路径下adams 2007 R3和matlab R2009b也是可以仿真成功的。
我的经验就是碰到Could not connect to ADAMS server这样的错误时,不用太担心,只要模型不出错,adams和matlab的工作路径设在同一目录下,一次不行,就关了matlab再打开试试,说不定就成功了(可以多试几次的)。
还有就是发现联防出错后,工作路径下会出现两个文件adamsctl.bat和controlsctl.bat,再仿真一次时就消失了。不知道这两个文件有什么作用,高手们可以给我们这些新手一些解答哦。

cgy123000 发表于 2010-11-4 16:36:50

这两个文件就是批处理文件,里面是一些批处理命令.都是通过内部宏命令生成一个批处理文件,再调用系统命令运行相应的批处理文件.运行完毕就没用了,所以删除.

gale715 发表于 2011-5-29 16:20:28

我也碰到了这样的问题,学习了!

meiguo7758521 发表于 2011-6-23 20:59:55

我也遇到这样的问题,但是始终解决不了?谁能不能说详细点啊?

py0330 发表于 2011-6-24 11:54:10

Error reported by S-function 'adams_plant' in 'ant/adams_sub/ADAMS Plant/S-Function':
Adams model file ant_test.cmd does not exist!!
是不是因为matlab当前目录下没有那个cmd文件?

andyhuwen 发表于 2016-3-9 18:36:11

Error reported by S-function 'adams_plant' in 'control_model/adams_sub/ADAMS Plant/S-Function':
Error in Adams(server) simulation startup.AEI_Initialize: Error in initialization.
新手求解答!

shll 发表于 2024-3-5 16:09:30

wenny.wang 发表于 2010-11-4 14:49
终于用adams 2007 R3和matlab R2009b联合仿真成功了,当然是靠老师帮忙
要把杀毒软件和防火墙都关了
首先仿 ...

请问修改工作路径是在属性里面修改么
页: [1]
查看完整版本: 请教adams与matlab联合仿真问题(天线雷达例子)