Lab::Instrument::HP34970A - HP/Agilent 34970A Data Acquisition Switch Unit


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

Index


Code Index:

NAME

Top

Lab::Instrument::HP34970A - HP/Agilent 34970A Data Acquisition Switch Unit

SYNOPSIS

Top

DESCRIPTION

Top

CONSTRUCTOR

Top

    my $hp=new(\%options);

METHODS

Top

read_voltage_dc

    $datum=$hp->read_voltage_dc($range,$resolution,@scan_list);

Preset and make a dc voltage measurement with the specified range and resolution.

$range

Range is given in terms of volts and can be [0.1|1|10|100|1000|MIN|MAX|DEF]. DEF is default.

$resolution

Resolution is given in terms of $range or [MIN|MAX|DEF]. $resolution=0.0001 means 4 1/2 digits for example. The best resolution is 100nV: $range=0.1; $resolution=0.000001.

@scan_list

A list of channels to scan. See the instrument manual.

conf_monitor

    $hp->conf_monitor(@channels);

read_monitor

    @channels=$hp->read_monitor();

display_on

    $hp->display_on();

Turn the front-panel display on.

display_off

    $hp->display_off();

Turn the front-panel display off.

display_text

    $hp->display_text($text);
    print $hp->display_text();

Display a message on the front panel. The multimeter will display up to 12 characters in a message; any additional characters are truncated. Without parameter the displayed message is returned.

display_clear

    $hp->display_clear();

Clear the message displayed on the front panel.

beep

    $hp->beep();

Issue a single beep immediately.

get_error

    ($err_num,$err_msg)=$hp->get_error();

Query the multimeter's error queue. Up to 20 errors can be stored in the queue. Errors are retrieved in first-in-first out (FIFO) order.

reset

    $hp->reset();

Reset the multimeter to its power-on configuration.

scroll_message

    $hp->scroll_message();

CAVEATS/BUGS

Top

probably many

SEE ALSO

Top

Lab::Instrument

AUTHOR/COPYRIGHT

Top


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

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

package Lab::Instrument::HP34970A;

use strict;
use Lab::Instrument;

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

sub new {
    my $proto = shift;
    my $class = ref($proto) || $proto;
    my $self = {};
    bless ($self, $class);

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

    return $self
}

sub read_voltage_dc {
    my $self=shift;
    my ($range,$resolution,@scan_list)=@_;
    
    $range="DEF" unless (defined $range);
    $resolution="DEF" unless (defined $resolution);
    
    my $cmd=sprintf("MEASure:VOLTage:DC? %u,%f, (\@%s)",$range,$resolution,join ",",@scan_list);
    my ($value)=split "\n",$self->{vi}->Query($cmd);
    return $value;
}

sub conf_monitor {
    my ($self,$channel)=@_;
    $self->{vi}->Write("ROUT:MON (\@$channel)");
    $self->{vi}->Write("ROUT:MON:STATE ON");
}

sub read_monitor {
    my $self=shift;
    return $self->{vi}->Query("ROUT:MON:DATA?");
}

sub display_text {
    my $self=shift;
    my $text=shift;
    
    if ($text) {
        $self->{vi}->Write(qq(DISPlay:TEXT "$text"));
    } else {
        chomp($text=$self->{vi}->Query(qq(DISPlay:TEXT?)));
        $text=~s/\"//g;
    }
    return $text;
}

sub display_on {
    my $self=shift;
    $self->{vi}->Write("DISPlay ON");
}

sub display_off {
    my $self=shift;
    $self->{vi}->Write("DISPlay OFF");
}

sub display_clear {
    my $self=shift;
    $self->{vi}->Write("DISPlay:TEXT:CLEar");
}

sub beep {
    my $self=shift;
    $self->{vi}->Write("SYSTem:BEEPer");
}

sub get_error {
    my $self=shift;
    chomp(my $err=$self->{vi}->Query("SYSTem:ERRor?"));
    my ($err_num,$err_msg)=split ",",$err;
    $err_msg=~s/\"//g;
    return ($err_num,$err_msg);
}

sub reset {
    my $self=shift;
    $self->{vi}->Write("*RST");
}

sub scroll_message {
    use Time::HiRes (qw/usleep/);
    my $self=shift;
    my $message="            This perl instrument driver is copyright 2004/2005 by Daniel Schroeer.            ";
    for (0..(length($message)-12)) {
        $self->display_text(substr($message,$_,$_+11));
        usleep(100000);
    }
    $self->display_clear();
}

1;