Lab::Instrument::KnickS252 - Knick S 252 DC source


Lab-Instrument documentation Contained in the Lab-Instrument distribution.

Index


Code Index:

NAME

Top

Lab::Instrument::KnickS252 - Knick S 252 DC source

SYNOPSIS

Top

    use Lab::Instrument::KnickS252;

    my $gate14=new Lab::Instrument::KnickS252(0,11);
    $gate14->set_range(5);
    $gate14->set_voltage(0.745);
    print $gate14->get_voltage();

DESCRIPTION

Top

The Lab::Instrument::KnickS252 class implements an interface to the Knick S 252 dc calibrator. This class derives from Lab::Instrument::Source and provides all functionality described there.

CONSTRUCTOR

Top

    $knick=new Lab::Instrument::KnickS252($gpib_board,$gpib_addr);
    # Or any other type of construction supported by Lab::Instrument.

METHODS

Top

set_voltage

    $knick->set_voltage($voltage);

get_voltage

    $voltage=$knick->get_voltage();

set_range

    $knick->set_range($range);
    # $range is 5 or 20
    #  5  is 5V
    # 20  is 20V

get_range

    $range=$knick->get_range();
    # $range is 5 or 20
    #  5  is 5V
    # 20  is 20V

CAVEATS/BUGS

Top

Probably many.

SEE ALSO

Top

VISA

The Lab::Instrument::KnickS252 class uses the VISA module (VISA).

Lab::Instrument

The Lab::Instrument::KnickS252 class is a Lab::Instrument (Lab::Instrument).

SafeSource

Inherits from SafeSource (SafeSource).

AUTHOR/COPYRIGHT

Top


Lab-Instrument documentation Contained in the Lab-Instrument distribution.

#$Id: KnickS252.pm 650 2010-04-22 19:09:27Z schroeer $

package Lab::Instrument::KnickS252;
use strict;
use Lab::Instrument;
use Lab::Instrument::Source;

our $VERSION = sprintf("0.%04d", q$Revision: 650 $ =~ / (\d+) /);

our @ISA=('Lab::Instrument::Source');

my $default_config={
    gate_protect            => 1,
    gp_equal_level          => 1e-5,
    gp_max_volt_per_second  => 0.002,
    gp_max_volt_per_step    => 0.001,
    gp_max_step_per_second  => 2,
    gp_max_volt		    => 0.100,
    gp_min_volt	 	    => -1.500,
};

sub new {
    my $proto = shift;
    my @args=@_;
    my $class = ref($proto) || $proto;
    my $self = $class->SUPER::new($default_config,@args);
    bless ($self, $class);

    $self->{vi}=new Lab::Instrument(@args);

    return $self
}

sub _set_voltage {
    my $self=shift;
    my $voltage=shift;
    my $cmd=sprintf("X OUT %e\n",$voltage);
    $self->{vi}->Write($cmd);
}

sub _get_voltage {
    my $self=shift;
    my $cmd="R OUT\n";
    my $result=$self->{vi}->Query($cmd);
    $result=~/^OUT\s+([\d\.E\+\-]+)V/;
    return $1;
}

sub set_range {
    my $self=shift;
    my $range=shift;
    my $cmd="P RANGE $range\n";
    $self->{vi}->Write($cmd);
}

sub get_range {
    my $self=shift;
    my $cmd="R RANGE\n";
        #  5     5V
        # 20    20V
    my $result=$self->{vi}->Query($cmd);
    ($result)=$result=~/^RANGE\s+((AUTO)|5|(20))/;
    return $result;
}

1;