running builded file returns error message

4 vues (au cours des 30 derniers jours)
Alex
Alex le 2 Mai 2012
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

Réponses (2)

Egon
Egon le 1 Oct 2012
I have the same problem.

Ketan
Ketan le 8 Oct 2012
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 commentaires
Iain
Iain le 15 Jan 2015
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
Stefanie Schwarz le 23 Avr 2019
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:

Connectez-vous pour commenter.

Catégories

En savoir plus sur Deployment, Integration, and Supported Hardware dans Help Center et File Exchange

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by