NAME

Lab::Moose::Instrument::KeysightB2901A - Agilent/Keysight B2901A voltage/current sourcemeter.

VERSION

version 3.741

SYNOPSIS

use Lab::Moose;

my $source = instrument(
    type => 'KeysightB2901A',
    connection_type => 'LinuxGPIB',
    connection_options => {gpib_address => 15},
    # mandatory protection settings
    max_units_per_step => 0.001, # max step is 1mV/1mA
    max_units_per_second => 0.01,
    min_units => -10,
    max_units => 10,
);

### Sourcing


# Source voltage
$source->source_function(value => 'VOLT');
$source->source_range(value => 210);

# Step-sweep to new level.
# Stepsize and speed is given by (max|min)_units* settings.
$source->set_level(value => 9);

# Get current level from device cache (without sending a query to the
# instrument):
my $level = $source->cached_level();

### Measurement 

The B2901A provides a concurrent SENSE subsystem. See also Lab::Moose::Instrument::SCPI::Sense::Function::Concurrent.

# Measure current
$source->sense_function_on(value => ['CURR']);
$source->sense_function(value => 'CURR');
# Set measurement range to 100nA
$source->sense_range(value => 100e-9);
# Use measurement integration time of 2 NPLC
$source->sense_nplc(value => 2);
# Set compliance limit to 10nA
$source->sense_protection(value => 10e-9);

# Get measurement sample
my $sample = $source->get_measurement();
my $current = $sample->{CURR};
# print all entries in sample (Voltage, Current, Resistance, Timestamp):
use Data::Dumper;
print Dumper $sample;

NOTES

There are problems with the USB connection: https://community.keysight.com/thread/36706. GPIB works fine.

METHODS

Used roles:

Lab::Moose::Instrument::Common
Lab::Moose::Instrument::SCPI::Sense::Function::Concurrent
Lab::Moose::Instrument::SCPI::Sense::Protection
Lab::Moose::Instrument::SCPI::Sense::Range
Lab::Moose::Instrument::SCPI::Sense::NPLC
Lab::Moose::Instrument::SCPI::Source::Function
Lab::Moose::Instrument::SCPI::Source::Level
Lab::Moose::Instrument::SCPI::Source::Range
Lab::Moose::Instrument::LinearStepSweep

set_level

$source->set_level(value => $new_level);

Go to new level. Sweep with multiple steps if the distance between current and new level is larger than max_units_per_step.

get_measurement

my $sample = $source->get_measurement();
my $current = $sample->{CURR};

Do new measurement and return sample hashref of measured elements.

cached_level

my $current_level = $source->cached_level();

Get current value from device cache.

get_level

my $current_level = $source->get_level();

Query current level.

set_voltage

$source->set_voltage($value);

For XPRESS voltage sweep. Equivalent to set_level(value => $value).

COPYRIGHT AND LICENSE

This software is copyright (c) 2021 by the Lab::Measurement team; in detail:

Copyright 2018-2019  Simon Reinhardt
          2020       Andreas K. Huettel

This is free software; you can redistribute it and/or modify it under the same terms as the Perl 5 programming language system itself.