convert USB TC08 coding to Serial TC08

Post general discussions on using our drivers to write your own software here
Post Reply
shnteb001
Newbie
Posts: 0
Joined: Fri Sep 17, 2010 9:32 am

convert USB TC08 coding to Serial TC08

Post by shnteb001 » Tue Sep 21, 2010 3:22 pm

Hi
Im not so good with matlab. But I found a program for a USB TC-08 and need to convert it to be able to use with serial TC-08.
Here is the code. If anyone has code or somthing that could help pls pm me. Thanks
---start here---
if ~libisloaded('usbtc08')
disp('Matlab: Load usbtc08.dll')
loadlibrary('C:\TC08\usbtc08.dll','C:\TC08\usbtc08.h')
disp('Matlab: dll loaded')
disp('')
else
disp('Matlab: dll already loaded')
disp('')

end


htemp=calllib('usbtc08', 'usb_tc08_open_unit') % open communication with TC-08

ok=calllib('usbtc08','usb_tc08_set_channel', htemp,int16(1),int8('T')) %setup a single channel

%-------------------------------------------------------------------------
x=single(3);
y=int16(3);
xp = libpointer('voidPtr',x);
yp = libpointer('voidPtr',y);
for loop =1:100
[a,data(loop),cthing]=calllib('usbtc08','usb_tc08_get_single',htemp, xp,yp, 0);
pause(0.01)
end
%-------------------------------------------------------------------------

ok=calllib('usbtc08','usb_tc08_close_unit',htemp);%close comms with TC-08

Post Reply