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

TiePie engineering

 

03 Oct 2013 (Updated )

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

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

classdef TriggerOutput < handle
  properties ( Access = protected )
    oDevice;
    wOutputIndex;
    % Cached for efficiency. Gotten from oDevice:
    oLibTiePie;
    sLibrary;
    hDevice;
  end
  properties
    Enabled;
    Event;
    Name;
  end
  properties ( SetAccess = private )
    Events;
  end

  methods
    function obj = TriggerOutput( oDevice , wOutputNumber )
      obj.oDevice = oDevice;
      obj.wOutputIndex = wOutputNumber - 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 , 'DevTrOutGetEnabled' , self.hDevice , self.wOutputIndex );
    end
    function set.Enabled( self , bEnabled )
      calllib( self.sLibrary , 'DevTrOutSetEnabled' , self.hDevice , self.wOutputIndex , bEnabled );
      self.oLibTiePie.CheckStatus;
    end

    function arEvents = get.Events( self )
      arEvents = LibTiePie.Enum.TOE( LibTiePie.BitMask2Array( calllib( self.sLibrary , 'DevTrOutGetEvents' , self.hDevice , self.wOutputIndex ) ) );
    end
    function qwEvent = get.Event( self )
      qwEvent = LibTiePie.Enum.TOE( calllib( self.sLibrary , 'DevTrOutGetEvent' , self.hDevice , self.wOutputIndex ) );
    end
    function set.Event( self , qwEvent )
      calllib( self.sLibrary , 'DevTrOutSetEvent' , self.hDevice , self.wOutputIndex , uint64( qwEvent ) );
      self.oLibTiePie.CheckStatus;
    end

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

Contact us