MATLAB Answers

error to open library networkdevice.dll

18 views (last 30 days)
James
James on 4 May 2015
Commented: Niklaus Lim on 2 Dec 2020
Hello everybody, i did a simulink model with udp send and udp receive, after i generate the code with the embadded coder in my genertaed folder there are .c and .h files and a makefile. i copy all .c .h files in a project visual c++ i genereate the .exe file and a copied the networkdevice.dll in the same directory. But whene i execute my programe, he didn't find the networdevice.dll the message in terminal is ""Could not open library: networkdevice.dll"
i have matlab r2014a, and visual studio 2013
please helpe :) thanks

Answers (2)

Shogo Ida
Shogo Ida on 3 Apr 2018
You can use packNGo to include networkdevice.dll in the generated zip folder.
see https://www.mathworks.com/help/dsp/ug/how-to-run-a-generated-executable-outside-matlab.html https://www.mathworks.com/help/rtw/ref/packngo.html https://www.mathworks.com/help/dsp/ref/udpsend.html?s_tid=gn_loc_drop

Stefanie Schwarz
Stefanie Schwarz on 23 Apr 2019
Please make sure that not only the "networkdevice.dll" file is copied to the same directory as the EXE file, but all DLLs contained in the packNGo archive.
See below MATLAB Answers post for more information:
  1 Comment
Niklaus Lim
Niklaus Lim on 2 Dec 2020
Hi, I am using Windows 7 & Matlab 2014a due to the equipment I am using.I am trying to use UDP block to send the data from Simulink to Python. I faced the same problem!!
Error occurred while executing External Mode MEX-file 'quarc_comm':
Could not open library: networkdevice.dll.
To run the generated code outside the MATLAB environment, use the packNGo function.
I tried the simplest block with a input source(constant block with a fixed value) and a UDP block. It works!!!
I managed to solve it but the method above.
But I faced the other problem
Caused by:
Error using exosuit_quanser_imu_v1 (line 147)
Error occurred while executing External Mode MEX-file 'quarc_comm':
ExtFlushTargetPkt() call failed for ExtSendGenericPkt().
Ensure target is still running
Error using exosuit_quanser_imu_v1 (line 147)
Unexpected error(s) encountered while evaluating 'Control_Kieran_quanser_imu_TTSH/val1' parameters for registration at the top of
the model execution loop. The parameters installed in the dialog need to be corrected. Model execution will continue using the
old values

Sign in to comment.

Community Treasure Hunt

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

Start Hunting!

Translated by