Lab::Instrument::SRS_SIM928 - SRS SIM928 voltage source module for SIM900 mainframe


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

Index


Code Index:

NAME

Top

Lab::Instrument::SRS_SIM928 - SRS SIM928 voltage source module for SIM900 mainframe

SYNOPSIS

Top

    use Lab::Instrument::SRS_SIM928;

    my $gates=new Lab::Instrument::SRS_SIM928(0,11);
    $gates->set_voltage(0.745,1);
    print $gate14->get_voltage(1);

    my $plunger=new Lab::Instrument::Source($gates, 3);

    $plunger->set_voltage(-0.5);




DESCRIPTION

Top

The Lab::Instrument::SRS_SIM928 class implements an interface to the SIM928 voltage source modules. This class derives from Lab::Instrument::Source and provides all functionality described there.

CONSTRUCTORS

Top

new($gpib_board,$gpib_addr)

METHODS

Top

set_voltage($voltage,$channel)

get_voltage($channel)

get_battery_status($channel)

Provides information on the battery in the module $channel.

clear($channel)

Clears the error status.

reset($channel)

Resets the module. Voltage is set to zero and output is turned OFF.

id()

Returns the information provided by the instrument's '*IDN?' command.

CAVEATS

Top

probably many

SEE ALSO

Top

Lab::VISA =item Lab::Instrument =item Lab::Instrument::Source

AUTHOR/COPYRIGHT

Top


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

package Lab::Instrument::SRS_SIM928;
use strict;
use Lab::Instrument;
use Lab::Instrument::Source;
use Time::HiRes qw/usleep/;

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 $value=shift;
    my $channel=shift;
    my $cmd=sprintf("SNDT $channel, \"VOLT %e\"",$value);
    usleep(0.1e6);
    $self->{vi}->Write($cmd);
}


sub _get_voltage {
    my $self=shift;
    my $channel=shift;
    my $cmd=sprintf("CONN $channel, \"X\"");	# X is only a token for the connection!!
    $self->{vi}->Write($cmd);
    usleep(0.1e6);
    $cmd="VOLT?";
    my $result=$self->{vi}->Query($cmd);
    usleep(0.1e6);
    $self->{vi}->Write("X");
    usleep(0.1e6);
    chop $result;
    $result =~ s/\r//;

    return $result;
}



sub get_battery_status {
    my $self=shift;
    my $channel=shift;
    my $cmd=sprintf("CONN $channel, \"X\"");	# X is only a token for the connection!!
    $self->{vi}->Write($cmd);
    my $date=$self->{vi}->Query("BIDN? 4");
    my $cycles = $self->{vi}->Query("BIDN? 3");
    my $lifetime=$self->{vi}->Query("BIDN? 2");
    $self->{vi}->Write("X");
    
    return "production date: $date cycles: $cycles design life: $lifetime";
}

sub clear {
    my $self=shift;
    my $channel=shift;
    my $cmd="SNDT $channel, \"*CLS\"";
    $self->{vi}->Write($cmd);
}

sub reset {
    my $self=shift;
    my $channel=shift;
    my $cmd="SNDT $channel, \"*RST\"";
    $self->{vi}->Write($cmd);
}

sub id {
    my $self=shift;
    my $cmd=sprintf("CONN 2, \"X\"");	# X is only a token for the connection!!
    $self->{vi}->Write($cmd);
    $cmd="*IDN?";
    my $result=$self->{vi}->Query($cmd);
    $self->{vi}->Write("X");
    return $result;
}

1;