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!