#============================================================ # Keithley2000 #============================================================ package Keithley2000; 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->Reset(); $this->Clear(); } sub Finish { my ($this) = @_; } 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 SetDCAmpstMode { my ($this) = @_; $this->print(":sens:func 'curr:dc'\n"); $this->print(":sens:curr:range:auto on\n"); } sub SetDCVoltsMode { my ($this) = @_; $this->print(":sens:func 'volt:dc'\n"); $this->print(":sens:volt:range:auto on\n"); } sub Measure { my ($this) = @_; $this->print(":read?\n"); my $ReturnStr = $this->read(); my ($ValueStr) = split(/,/, $ReturnStr); $ValueStr =~ s/NADC//; return $ValueStr; } sub SetAutoRangeForCurrent { my ($this, $f) = @_; # $f = 'ON' or 'OFF' $this->print(":sens:curr:rang:auto $f\n"); } sub SetAutoRangeForVoltage { my ($this, $f) = @_; # $f = 'ON' or 'OFF' $this->print(":sens:volt:dc:rang:auto $f\n"); } 1;