RichB19 Newbie
Joined: 02 Nov 2005
Posts: 1
|
Posted: Wed Nov 02, 2005 1:51 pm Post subject: Matlab and Serial TC-08 |
|
|
Hi All,
I'm trying to get the pico TC-08 logger to function in MATLAB. Currently this code runs displaying ans=1 (true) for opening the port when set to the correct com port (4 for this system). It also finds when the logger is ready to send a value when xobj==1. However xp does not change value and so no value for the temperaure is given xp and x are always value 3 as originally set.
I hope this starts some people along programming for this piece of wquipment in matlab and if anyone knows anyway to get these tempvalues please post in this forum.
function []=tco8()
loadlibrary('c:\pico\drivers\win32\tc0832.dll','c:\pico\drivers\win32\tc08.h')
port=4;
calllib('tc0832','tc08_close_unit',port)
calllib('tc0832','tc08_open_unit',port)
calllib('tc0832','tc08_set_channel',port,8,75,10,0,0) %75 equates to 'K'
x=3;
xp = libpointer('voidPtr',x);
for i=1:100;
[xobj, xval] = calllib('tc0832','tc08_get_temp',xp,port,8,0);
if xobj==1
get(xp)
end
pause(0.0001)
end
calllib('tc0832','tc08_close_unit',port)
Cheers
Rich B |
|