Code covered by the BSD License  

Highlights from
Pico Technology TC-08 USB data acquisition

Pico Technology TC-08 USB data acquisition

by

 

20 May 2013 (Updated )

Files to connect, query, and disconnect from the Pico Technology USB TC-08, using DLL's.

usbtc08disconnect(handle)
function usbtc08disconnect(handle)
% USBTC08DISCONNECT disconnects the USB TC-08 from MATLAB
% usbtc08disconnect(handle) disconnects the USB TC-08 from MATLAB and
% unloads the DLLs, where handle is a uint16 from 1-65535 supplied by
% usbtc08connect.

% number of arguments error check
error(nargchk(1, 1, nargin))

% initialises variables for convenience
tc08LibraryName = 'usbtc08';

% error handling
if ~isvalidtc08handle(handle)
    % errors
    error('handle must be an unsigned integer from 1 to 65335')
    
elseif ~libisloaded(tc08LibraryName)
    % errors
    error('dll is not loaded - TC-08 is not currently connected anyway')
end

% stop the streaming
stopOutcome = calllib(tc08LibraryName, 'usb_tc08_stop', handle);

% 1 if it worked
if ~stopOutcome
    % message
    warning('Failed to stop USB TC-08 streaming mode, disconnecting anyway.')
end

% now works the same as the disconnectslow method
usbtc08disconnectslow(handle)

Contact us