Matlab R2018b control prolems


#1

Definite PTP move commands doesn’t work stable (sometime it’s executed, sometime PTP command doesn’t performed) under Matlab R2018b 64bit control. Dobot studio IDE performs it perfectly.

May be someone have come across with that trouble ?
Thanks for advanced


#2

Sorry about I can’t solve your problem, but I have a matlab control problem too.
My problem is I can’t load the head file and dll into matlab, so I can’t use matlab to directly control my M1.
Maybe you know how to solve it. Can you help me? Maybe email is a better communicate way.
Here is my email: system.down1108@gmail.com
Thanks for advanced


#3

%take a try with matlab 2019b 64

if ~libisloaded(‘DobotDll’)
[notfound, warnings]=loadlibrary(‘DobotDll.dll’,‘DobotDll.h’);
end
ch=blanks(128);
[~,str2]=calllib(‘DobotDll’,‘SearchDobot’,ch,128);
str2ptr=libpointer(‘cstring’,str2);
[str3,str4]=calllib(‘DobotDll’,‘ConnectDobot’,str2ptr,115200);

queue_index=0;
% ptp.ptpMode=0;ptp.x=200;ptp.y=20;ptp.z=0;
ptp.ptpMode=0;
ptp.x=250.0;
ptp.y=0.0;
ptp.z=-48.0;
ptp.r=0.0;
ptpstruct=libstruct(‘tagPTPCmd’,ptp);
ptpstructptr=libpointer(‘tagPTPCmdPtr’,ptpstruct);
queue_index_ptr=libpointer(‘uint64Ptr’,queue_index);
calllib(‘DobotDll’,‘SetQueuedCmdStartExec’);
calllib(‘DobotDll’,‘SetPTPCmd’,ptpstructptr,true,queue_index_ptr);
calllib(‘DobotDll’,‘SetEndEffectorSuctionCup’,1,1,true,queue_index_ptr);
calllib(‘DobotDll’,‘SetQueuedCmdStopExec’);
pause(3)

queue_index=0;
% ptp.ptpMode=0;ptp.x=220;ptp.y=10;ptp.z=0;
ptp.x=220.0;
ptp.y=30.0;
ptp.z=-48.0;
ptp.r=0.0;
ptpstruct=libstruct(‘tagPTPCmd’,ptp);
ptpstructptr=libpointer(‘tagPTPCmdPtr’,ptpstruct);
queue_index_ptr=libpointer(‘uint64Ptr’,queue_index);
calllib(‘DobotDll’,‘SetQueuedCmdStartExec’);
calllib(‘DobotDll’,‘SetPTPCmd’,ptpstructptr,true,queue_index_ptr);
calllib(‘DobotDll’,‘SetEndEffectorSuctionCup’,0,1,true,queue_index_ptr)
calllib(‘DobotDll’,‘SetQueuedCmdStopExec’);
pause(3)

queue_index=0;
ptp.ptpMode=0;ptp.x=200;ptp.y=20;ptp.z=-10;
ptpstruct=libstruct(‘tagPTPCmd’,ptp);
ptpstructptr=libpointer(‘tagPTPCmdPtr’,ptpstruct);
queue_index_ptr=libpointer(‘uint64Ptr’,queue_index);
calllib(‘DobotDll’,‘SetQueuedCmdStartExec’);
calllib(‘DobotDll’,‘SetPTPCmd’,ptpstructptr,true,queue_index_ptr);
calllib(‘DobotDll’,‘SetQueuedCmdStopExec’);
pause(3)
calllib(‘DobotDll’,‘DisconnectDobot’);

%clear value
% clear ptpstruct;
% clear ptpstructptr;
% clear str1;
% clear str2;
% clear queue_index_ptr;
clear;