Clear Filters
Clear Filters

Calling a method in a library that has an "HandlePtr" argument

2 views (last 30 days)
Hello I am trying to get a Z stage working with matlab. The Vendor (Dover Motion) have shared their dll. This is the first time I've dived into this part of matlab, so please excuse my lack of knowledge (I'm not really a c or c++ programmer either)
So I've read I need to use loadlibrary (and I've used an alias)
loadlibrary(lib_name,h_name, 'alias','lib') % lib is alias name for C-Motion library
libisloaded('lib') % Check to see its loaded OK
libfunctions('lib') % List methods in the command window
libfunctionsview('lib') % List methods in fancy graphic!
This works fine, and I get a nice graphic showing the methods/functions.
One of those functions I want to use is: PMDSetupAxisInterface_Serial
This is where I am stuck - with the argument (tagPMDAxisHandlePtr) - I don't really know what i'm doing but have tried.
I've read that to call a method inside a dll, to use calllib, so I have tried:
handle = libstruct('tagPMDAxisHandle');
%handle = libpointer('tagPMDAxisHandle');
But it cause matlab to crash.
Here's the output of
handle = libstruct('tagPMDAxisHandle');
handle =
handle = libpointer('tagPMDAxisHandle');
handle =
Thnaks for any help

Answers (0)




Community Treasure Hunt

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

Start Hunting!