#============================================================ # Keithley2400 #============================================================ package Keithley2400; use Device::DeviceObject; @ISA = qw(DeviceObject); #公開したいサブルーチン @EXPORT = qw(); use strict; use Deps; #============================================================ # コンストラクタ、デストラクタ #============================================================ BEGIN { } sub new { my ($module, @args) = @_; my $this = {}; bless $this; return $this; } sub DESTROY { my $this = shift; $this->Finish(); } #============================================================ # 変数取得関数 #============================================================ #============================================================ # 一般関数 #============================================================ sub Initialize { my ($this) = @_; $this->Clear(); # $this->Reset(); $this->SetVSourceOutput("off"); $this->SetSourceVoltage(0.0); $this->print(":syst:zcheck off\n"); } sub Finish { my ($this) = @_; $this->SetVSourceOutput("off"); $this->SetSourceVoltage(0.0); } sub Clear { my ($this) = @_; $this->print("*CLS\n"); } sub Reset { my ($this) = @_; $this->print("*RST\n"); } sub GetId { my ($this) = @_; $this->print("*IDN?\n"); return $this->read(); } sub SetDCVoltMode { my ($this) = @_; $this->print(":sour:func volt\n"); # $this->print(':sour:volt:mode fix' . "\n"); # $this->print(":syst:zcheck $ZeroCheck\n"); # $this->print(":syst:zcorrect:state on\n"); # $this->print(":syst:zcheck off\n"); } sub SetSourceVoltage { my ($this, $V) = @_; $this->print(":sour:volt $V\n"); } sub SetVSourceOutput { my ($this, $f) = @_; # $f = 'on' or 'off'; $this->print(':outp "on"' . "\n"); } sub SetVSourceLimit { my ($this, $VSourceLimit) = @_; # $this->print(":sour:volt:limit $VSourceLimit\n"); $this->print(":sour:volt:limit:stat off\n"); } sub Measure { my ($this) = @_; $this->print(":read?\n"); my $ReturnStr = $this->read(); my ($ValueStr) = split(/,/, $ReturnStr); $ValueStr =~ s/NADC//; return $ValueStr; } 1;