搜索
汉力达液压金币充值官方微信群液压资料下载
查看: 9417|回复: 6

AMEsim与simulink联合仿真 求助

[复制链接]
发表于 2015-2-5 18:10:51 | 显示全部楼层 |阅读模式
我打算把路面白噪声模块用sl2amecosim函数转化成AMESim的模块,,可是sl2amecosim函数运行的时候,老提示错误{:9_221:}。。各位大神,好网友能不能帮忙看看,感激不尽啊
>> sl2amecosim('yuncai','D:\AMETest\libsl2ame','auto')

====> STARTING SL2AMECOSIM CODE GENERATION FOR MODEL YUNCAI...
====> Step #1: Checking system and model...
INFO : Forcing SingleTasking Mode.
====> Step #2: Generating code & building OBJ file
### Starting Real-Time Workshop build procedure for model: yuncai
### Generating code into build directory: E:\abc\yuncai_grt_malloc_rtw
### Invoking Target Language Compiler on yuncai.rtw
### Using System Target File: D:\Program Files\MATLAB\R2010b\rtw\c\grt_malloc\grt_malloc.tlc
### Loading TLC function libraries
.....
### Initial pass through model to cache user defined code
.
### Caching model source code
...........
### Generating TLC interface API.
......
### Writing source file yuncai_capi.c
..
### Writing header file yuncai_capi.h
....................................
### Writing header file yuncai.h
### Writing header file yuncai_types.h
### Writing header file yuncai_private.h
.
### Writing header file rtwtypes.h
### Writing source file yuncai.c
### Writing header file rt_nonfinite.h
.
### Writing source file rt_nonfinite.c
### Writing header file rtGetInf.h
### Writing source file rtGetInf.c
.
### Writing header file rtGetNaN.h
### Writing source file rtGetNaN.c
### Writing header file rtmodel.h
.
### TLC code generation complete.
.
### Processing Template Makefile: D:\AMESim\v1300\interfaces\sl2ame\ame_cosim_dll_grt_malloc_vc.tmf
### yuncai.mk which is generated from D:\AMESim\v1300\interfaces\sl2ame\ame_cosim_dll_grt_malloc_vc.tmf is up to date
### Building yuncai: .\yuncai.bat

E:\abc\yuncai_grt_malloc_rtw>set MATLAB=D:\Program Files\MATLAB\R2010b  

E:\abc\yuncai_grt_malloc_rtw>set MSVCDir=d:\program files\microsoft visual studio\vc98  

E:\abc\yuncai_grt_malloc_rtw>set MSDevDir=d:\program files\microsoft visual studio\common\msdev98  

E:\abc\yuncai_grt_malloc_rtw>"D:\Program Files\MATLAB\R2010b\rtw\bin\win32\envcheck" INCLUDE "d:\program files\microsoft visual studio\vc98\include"  

E:\abc\yuncai_grt_malloc_rtw>if errorlevel 1 goto vcvars32  

E:\abc\yuncai_grt_malloc_rtw>"D:\Program Files\MATLAB\R2010b\rtw\bin\win32\envcheck" PATH "d:\program files\microsoft visual studio\vc98\bin"  

E:\abc\yuncai_grt_malloc_rtw>if errorlevel 1 goto vcvars32  

E:\abc\yuncai_grt_malloc_rtw>set VSCommonDir=d:\program files\microsoft visual studio\common  

E:\abc\yuncai_grt_malloc_rtw>call "D:\Program Files\MATLAB\R2010b\toolbox\rtw\rtw\private\vcvars32_600.bat"  
Setting environment for using Microsoft Visual C++ tools.

Microsoft (R) Program Maintenance Utility   Version 6.00.8168.0
Copyright (C) Microsoft Corp 1988-1998. All rights reserved.

### Compiling rtGetInf.c
        cl -Od   -DUSE_RTMODEL -DMODEL=yuncai -DRT -DNUMST=2  -DTID01EQ=1 -DNCSTATES=1  -DRT_MALLOC -DMT=0 -DHAVESTDIO  -DMODEL_CFILE=yuncai.c  -DRT_MEMORY_ALLOCATION_ERROR=RT_MEMORY_ALLOCATION_ERROR_yuncai  -Drt_ODECreateIntegrationData=rt_ODECreateIntegrationData_yuncai  -Drt_ODEUpdateContinuousStates=rt_ODEUpdateContinuousStates_yuncai  -Drt_ODEDestroyIntegrationData=rt_ODEDestroyIntegrationData_yuncai   -c -W3 -DCRTAPI1=_cdecl -DCRTAPI2=_cdecl -nologo -D_X86_=1 -D_WINNT -D_WIN32_WINNT=0x0400 -D_WIN32_IE=0x0300 -DWINVER=0x0400 -DWIN32  -D_WIN32 -D_MT -MT /Op rtGetInf.c
rtGetInf.c
### Compiling rtGetNaN.c
        cl -Od   -DUSE_RTMODEL -DMODEL=yuncai -DRT -DNUMST=2  -DTID01EQ=1 -DNCSTATES=1  -DRT_MALLOC -DMT=0 -DHAVESTDIO  -DMODEL_CFILE=yuncai.c  -DRT_MEMORY_ALLOCATION_ERROR=RT_MEMORY_ALLOCATION_ERROR_yuncai  -Drt_ODECreateIntegrationData=rt_ODECreateIntegrationData_yuncai  -Drt_ODEUpdateContinuousStates=rt_ODEUpdateContinuousStates_yuncai  -Drt_ODEDestroyIntegrationData=rt_ODEDestroyIntegrationData_yuncai   -c -W3 -DCRTAPI1=_cdecl -DCRTAPI2=_cdecl -nologo -D_X86_=1 -D_WINNT -D_WIN32_WINNT=0x0400 -D_WIN32_IE=0x0300 -DWINVER=0x0400 -DWIN32  -D_WIN32 -D_MT -MT /Op rtGetNaN.c
rtGetNaN.c
### Compiling yuncai_capi.c
        cl -Od   -DUSE_RTMODEL -DMODEL=yuncai -DRT -DNUMST=2  -DTID01EQ=1 -DNCSTATES=1  -DRT_MALLOC -DMT=0 -DHAVESTDIO  -DMODEL_CFILE=yuncai.c  -DRT_MEMORY_ALLOCATION_ERROR=RT_MEMORY_ALLOCATION_ERROR_yuncai  -Drt_ODECreateIntegrationData=rt_ODECreateIntegrationData_yuncai  -Drt_ODEUpdateContinuousStates=rt_ODEUpdateContinuousStates_yuncai  -Drt_ODEDestroyIntegrationData=rt_ODEDestroyIntegrationData_yuncai   -c -W3 -DCRTAPI1=_cdecl -DCRTAPI2=_cdecl -nologo -D_X86_=1 -D_WINNT -D_WIN32_WINNT=0x0400 -D_WIN32_IE=0x0300 -DWINVER=0x0400 -DWIN32  -D_WIN32 -D_MT -MT /Op yuncai_capi.c
yuncai_capi.c
### Compiling "D:\AMESim\v1300\interfaces\sl2ame\ame_cosim_dll_grt_malloc_main.c"
        cl -Od   -DUSE_RTMODEL -DMODEL=yuncai -DRT -DNUMST=2  -DTID01EQ=1 -DNCSTATES=1  -DRT_MALLOC -DMT=0 -DHAVESTDIO  -DMODEL_CFILE=yuncai.c  -DRT_MEMORY_ALLOCATION_ERROR=RT_MEMORY_ALLOCATION_ERROR_yuncai  -Drt_ODECreateIntegrationData=rt_ODECreateIntegrationData_yuncai  -Drt_ODEUpdateContinuousStates=rt_ODEUpdateContinuousStates_yuncai  -Drt_ODEDestroyIntegrationData=rt_ODEDestroyIntegrationData_yuncai   -c -W3 -DCRTAPI1=_cdecl -DCRTAPI2=_cdecl -nologo -D_X86_=1 -D_WINNT -D_WIN32_WINNT=0x0400 -D_WIN32_IE=0x0300 -DWINVER=0x0400 -DWIN32  -D_WIN32 -D_MT -MT /Op "D:\AMESim\v1300\interfaces\sl2ame\ame_cosim_dll_grt_malloc_main.c"
ame_cosim_dll_grt_malloc_main.c
D:\AMESim\v1300\interfaces\sl2ame\ame_cosim_dll_grt_malloc_main.c(2034) : error C2065: 'ExternalInputs_yuncai' : undeclared identifier
D:\AMESim\v1300\interfaces\sl2ame\ame_cosim_dll_grt_malloc_main.c(2077) : warning C4018: '==' : signed/unsigned mismatch
D:\AMESim\v1300\interfaces\sl2ame\ame_cosim_dll_grt_malloc_main.c(2244) : warning C4018: '!=' : signed/unsigned mismatch
D:\AMESim\v1300\interfaces\sl2ame\ame_cosim_dll_grt_malloc_main.c(2256) : warning C4018: '!=' : signed/unsigned mismatch
D:\AMESim\v1300\interfaces\sl2ame\ame_cosim_dll_grt_malloc_main.c(2345) : warning C4018: '==' : signed/unsigned mismatch
NMAKE : fatal error U1077: 'cl' : return code '0x2'
Stop.
The make command returned an error of 2
'An_error_occurred_during_the_call_to_make' 不是内部或外部命令,也不是可运行的程序
或批处理文件。
### Real-Time Workshop build procedure for model: 'yuncai' aborted due to an error.
??? Error using ==> RTW.makertw.make_rtw at 352
Error(s) encountered while building model "yuncai"

Error in ==> make_rtw at 22
buildResult = h.make_rtw(varargin{:});

Error in ==> D:\Program Files\MATLAB\R2010b\toolbox\simulink\simulink\private\build_target.p>RunBuildCmd at
93


Error in ==> D:\Program Files\MATLAB\R2010b\toolbox\simulink\simulink\private\build_target.p>build_target at
6


Error in ==> D:\Program
Files\MATLAB\R2010b\toolbox\simulink\simulink\private\build_standalone_rtw_target.p>build_standalone_rtw_target
at 51


Error in ==> D:\Program
Files\MATLAB\R2010b\toolbox\simulink\simulink\private\slbuild_private.p>loc_codegenentry at 494


Error in ==> D:\Program
Files\MATLAB\R2010b\toolbox\simulink\simulink\private\slbuild_private.p>slbuild_private at 292


Error in ==> sl at 16
[varargout{1:nargout}]=feval(varargin{:});

Error in ==> slbuild at 62
    sl('slbuild_private', mdl, varargin{:});

Error in ==> rtwbuild at 162
          slbuild(sys, 'StandaloneRTWTarget', ...

Error in ==> sl2amecosim at 251
    rtwbuild(model),

 楼主| 发表于 2015-2-5 18:13:23 | 显示全部楼层
从这开始就是错误了{:9_221:}求助啊
??? Error using ==> RTW.makertw.make_rtw at 352
Error(s) encountered while building model "yuncai"

Error in ==> make_rtw at 22
buildResult = h.make_rtw(varargin{:});

Error in ==> D:\Program Files\MATLAB\R2010b\toolbox\simulink\simulink\private\build_target.p>RunBuildCmd at
93


Error in ==> D:\Program Files\MATLAB\R2010b\toolbox\simulink\simulink\private\build_target.p>build_target at
6


Error in ==> D:\Program
Files\MATLAB\R2010b\toolbox\simulink\simulink\private\build_standalone_rtw_target.p>build_standalone_rtw_target
at 51


Error in ==> D:\Program
Files\MATLAB\R2010b\toolbox\simulink\simulink\private\slbuild_private.p>loc_codegenentry at 494


Error in ==> D:\Program
Files\MATLAB\R2010b\toolbox\simulink\simulink\private\slbuild_private.p>slbuild_private at 292


Error in ==> sl at 16
[varargout{1:nargout}]=feval(varargin{:});

Error in ==> slbuild at 62
    sl('slbuild_private', mdl, varargin{:});

Error in ==> rtwbuild at 162
          slbuild(sys, 'StandaloneRTWTarget', ...

Error in ==> sl2amecosim at 251
    rtwbuild(model),

回复

使用道具 举报

  • 打卡等级:常驻居民
  • 打卡总天数:365
  • 打卡总奖励:2062
发表于 2015-2-7 20:57:51 | 显示全部楼层
这错误没法看,去交流群问问吧
回复

使用道具 举报

 楼主| 发表于 2015-2-8 18:45:13 | 显示全部楼层
醉乐清风 发表于 2015-2-7 20:57
这错误没法看,去交流群问问吧

谢谢斑竹大人。。问题解决了。。因为我在matlab输出模型到AMESIM的时候电脑上有两个AMESIM版本,所以遇到了这样的错误,删了一个之后,问题没有了
回复

使用道具 举报

发表于 2015-4-8 21:29:01 | 显示全部楼层
请问你的白噪声搞定了吗
回复

使用道具 举报

发表于 2017-3-29 14:29:57 | 显示全部楼层
请问你的matlab版本,是否08版本以上不能将simulink导入amesim
回复

使用道具 举报

  • 打卡等级:偶尔看看
  • 打卡总天数:115
  • 打卡总奖励:349
发表于 2017-3-29 16:40:06 | 显示全部楼层
太复杂了,看不懂
回复

使用道具 举报

您需要登录后才可以回帖 登录 | 立即注册

本版积分规则