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.

usbtc08getinfo(handle)
function info = usbtc08getinfo(handle)
% USBTC08GETINFO retrieves info from a connected USB TC-08 device
% info = usbtc08getinfo(handle) returns the info from a USB TC-08 data
% recorder as a structure.  This will fail if the unit is not already
% connected, or if it is called repeatedly within a short space of time.

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

% checks validity of handle
if ~isvalidtc08handle(handle)
    
    % complains
    error('handle must be valid for use with USB TC-08 DLLs.')
    
% checks we can run this
elseif ~libisloaded('usbtc08')
    
    % complain
    error('USB TC-08 library is not loaded.')
end

    
% grabs some unit info - need to supply a defined structure to get it
% going - the field names cannot be changed at all
info = struct(  'size', int16(40),...
                'DriverVersion', int8(['0.0.0.0', 0]),...
                'PicoppVersion', int16(0),...
                'HardwareVersion', int16(0),...
                'Variant', int16(0),...
                'szSerial', int8(['ABC12/007', 0]),...
                'szCalDate', int8(['01Jan01', 0]));


% grab the info
[readSuccess, info] = calllib('usbtc08', 'usb_tc08_get_unit_info', handle, info);


% if it worked...
if ~readSuccess
    
    % it didn't...
    error('Failed to read info from unit.')
end

% now reformat the data a bit
info.DriverVersion = char(info.DriverVersion);
info.szSerial = char(info.szSerial);
info.szCalDate = char(info.szCalDate);

Contact us