running builded file returns error message
조회 수: 2 (최근 30일)
이전 댓글 표시
Hello,
I have used build model option to create windows executable file from Simulink. The executable was successfully created, but when I run it from command line it returns following message: "ErrorStatus set: "Could not open library: networkdevice.dll" My model contains only 2 blocks: sine wave connected to the UDP Send block for windows, taken from Simulink Coder library. Running my model from Simulink environment works correctly. Machine: windows XP ver 5.1 build 2600 SP2, 32 bit. Matlab ver: 7.12.0.635 Simulink coder ver 8.0
Thank you in advance. Yours sincerely, Al
댓글 수: 0
답변 (2개)
Ketan
2012년 10월 8일
Hi Al and Egon,
Some Simulink blocks implement portions of their functionality using shared libraries (DLL files on Windows). Additionally, in some cases EXEs generated from models using these blocks are dependent on these shared libraries as well. In this case it seems like the Simulink UDP Send block has some of these dependencies.
The PACKNGO function can be used to locate the needed shared libraries. Go into your modelname_target_rtw folder and load the 'buildInfo' object into the workspace from the "buildInfo.mat" file. Then you can execute the command
>> packNGo(buildInfo);
This will create compressed folder in the same directory containing the generated EXE. This compressed folder should contain any DLLs that the generated EXE is dependent on. When running the EXE outside of the MATLAB/Simulink environment these DLLs need to be on the system path or within the same directory as the EXE.
댓글 수: 2
Iain
2015년 1월 15일
I have done all this and the .dll is in the correct folder but when I step through the code I still get the error message "Could not open library: networkdevice.dll". Any ideas?
Stefanie Schwarz
2019년 4월 23일
Make sure that not only the "networkdevice.dll" file is copied to the same directory as the EXE, but all DLLs contained in the packNGo archive.
See below MATLAB Answers post for more information:
참고 항목
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!