running builded file returns error message

2 Ansichten (letzte 30 Tage)
Alex
Alex am 2 Mai 2012
Kommentiert: Stefanie Schwarz am 23 Apr. 2019
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

Antworten (2)

Egon
Egon am 1 Okt. 2012
I have the same problem.

Ketan
Ketan am 8 Okt. 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 Kommentare
Iain
Iain am 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 am 23 Apr. 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:

Melden Sie sich an, um zu kommentieren.

Kategorien

Mehr zu Simulink Coder finden Sie in Help Center und File Exchange

Community Treasure Hunt

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

Start Hunting!

Translated by