Code covered by the BSD License  

Highlights from
Matlab LibTiePie 0.4.3 instrument driver for Handyscope HS5

Matlab LibTiePie 0.4.3 instrument driver for Handyscope HS5

by

 

03 Oct 2013 (Updated )

MatlabLibTiePie : TiePie engineering's instrument library for Matlab 7.6 = 2008a and higher.

LibTiePie.TriggerInput
% LibTiePie.TriggerInput controls a LibTiePie trigger input.
% Do not create LibTiePie.TriggerInput objects directly.
%
% For more information, see api.tiepie.com and www.tiepie.com/LibTiePie .
%
% (c) 2012-2013 TiePie engineering.

classdef TriggerInput < handle
  properties ( Access = protected )
    oDevice;
    wInputIndex;
    % Cached for efficiency. Gotten from oDevice:
    oLibTiePie;
    sLibrary;
    hDevice;
  end
  properties
    Enabled;
    Kind;
    Name;
  end
  properties ( SetAccess = private )
    Kinds;
  end

  methods
    function obj = TriggerInput( oDevice , wInputNumber )
      obj.oDevice = oDevice;
      obj.wInputIndex = wInputNumber - 1;
      obj.oLibTiePie = oDevice.oLibTiePie;
      obj.sLibrary = oDevice.oLibTiePie.sLibrary;
      obj.hDevice = oDevice.hDevice;
    end

    function delete( self )
      % Release references:
      self.oDevice = 0;
      self.oLibTiePie = 0;
    end;


    function bEnabled = get.Enabled( self )
      bEnabled = calllib( self.sLibrary , 'DevTrInGetEnabled' , self.hDevice , self.wInputIndex );
    end
    function set.Enabled( self , bEnabled )
      calllib( self.sLibrary , 'DevTrInSetEnabled' , self.hDevice , self.wInputIndex , bEnabled );
      self.oLibTiePie.CheckStatus;
    end

    function arKinds = get.Kinds( self )
      arKinds = LibTiePie.Enum.TK( LibTiePie.BitMask2Array( calllib( self.sLibrary , 'DevTrInGetKinds' , self.hDevice , self.wInputIndex ) ) );
    end
    function qwKind = get.Kind( self )
      qwKind = LibTiePie.Enum.TK( calllib( self.sLibrary , 'DevTrInGetKind' , self.hDevice , self.wInputIndex ) );
    end
    function set.Kind( self , qwKind )
      calllib( self.sLibrary , 'DevTrInSetKind' , self.hDevice , self.wInputIndex , uint64( qwKind ) );
      self.oLibTiePie.CheckStatus;
    end

    function sName = get.Name( self )
      dwLength = calllib( self.sLibrary , 'DevTrInGetName' , self.hDevice , self.wInputIndex , [] , 0 );
      [ dwLength , sName ] = calllib( self.sLibrary , 'DevTrInGetName' , self.hDevice , self.wInputIndex , blanks( dwLength ) , dwLength );
      sName = native2unicode( uint8( sName ) , 'UTF-8' );
    end;
  end
end

Contact us