Matlab crashes on calllib

11 views (last 30 days)
Ahmed Rehan
Ahmed Rehan on 6 Nov 2021
Commented: Chris on 27 Nov 2024
Hello,
I am running a code of Dynamxel Motor. It uses built-in libraries of C created by the manufacturers (so i might not read or modify them) located here. When I execute the following, the Matlab exits all of a sudden with no error, or warning:
VALUE = calllib(lib_name, 'portHandler', DEVICE_NAME)
Will appreciate any help, thanks alot..
AR
  2 Comments
Junjie Lv
Junjie Lv on 20 Jul 2023
Have you solve the issue ? i also meet with this problem when calling Nimotion's Nim_init(const char* strSdkPath) function, it just crashes repeatedly. Why does MATLAB crash when I make a function call on a DLL in MATLAB 7.6 (R2008a)? - MATLAB Answers - MATLAB Central (mathworks.com) does not work for this issue
Chris
Chris on 27 Nov 2024
While troubleshooting a similar issue, an option we did not have to pursue (solved the issue by using 2019a instead of MATLAB 2024a) was using a parallel process to run the DLL. If the DLL took a certain amount of time (in our case, 1-2 seconds was enough to know there was a problem), then the parallel process could be killed and move on. At least that was the principle. Maybe someone out there could make that a reality for their issue/workaround.
Another part of the problem was that initially my inputs exceded what the DLL could handle. So the DLL could perhaps have been coded better, but that part at least was my error.
See also

Sign in to comment.

Answers (1)

Sarthak
Sarthak on 26 Apr 2024

Categories

Find more on Startup and Shutdown in Help Center and File Exchange

Products


Release

R2021b

Community Treasure Hunt

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

Start Hunting!