function p=load_labjack()
 
    % Command sequence to load labjack library for the U3 controller.
    loadlibrary('labjackud', ...
        'C:\Program Files\LabJack\Drivers\LabJackUD.h');
    libfunctions('labjackud','-full')
 
    % Open a connection to a U3 labjack.
    % labjack_type = 3; % U3
    % connection_type = 1; % USB
    p = libpointer('longPtr', 0);
    [Er, lj_type] = calllib('labjackud', 'OpenLabJackS', ...
        'LJ_dtU3', 'LJ_ctUSB', '320031055', 1, p);
    
    if Er,
        % Oops! something went wrong...
        fprintf(...
            'Error %d while attempting to call OpenLabJackS.\n', Er);
        fprintf('Handle returned will be invalid.\n');
    else
        fprintf('Successfully connected to device type %s\n', lj_type);
    end
