| 1 | package Lab::Moose::Instrument::Keithley2400; | ||
| 2 | 2 | $Lab::Moose::Instrument::Keithley2400::VERSION = '3.931'; | |
| 3 | #ABSTRACT: Keithley 2400 voltage/current sourcemeter. | ||
| 4 | |||
| 5 | 2 | ▶ | use v5.20; |
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||
| 6 | |||
| 7 | |||
| 8 | 2 | ▶ | use Moose; |
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||
| 9 | 2 | ▶ | use MooseX::Params::Validate; |
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||
| 10 | use Lab::Moose::Instrument | ||
| 11 | 2 | ▶ | qw/validated_getter validated_setter setter_params/; |
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||
| 12 | 2 | ▶ | use Lab::Moose::Instrument::Cache; |
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||
| 13 | 2 | ▶ | use Carp; |
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||
| 14 | 2 | ▶ | use namespace::autoclean; |
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||
| 15 | |||
| 16 | 2 | extends 'Lab::Moose::Instrument'; | |
| 17 | |||
| 18 | 2 | has [qw/max_units_per_second max_units_per_step min_units max_units/] => | |
| 19 | ( is => 'ro', isa => 'Num', required => 1 ); | ||
| 20 | |||
| 21 | 2 | has source_level_timestamp => ( | |
| 22 | is => 'rw', | ||
| 23 | isa => 'Num', | ||
| 24 | init_arg => undef, | ||
| 25 | ); | ||
| 26 | |||
| 27 | 2 | has verbose => ( | |
| 28 | is => 'ro', | ||
| 29 | isa => 'Bool', | ||
| 30 | default => 1 | ||
| 31 | ); | ||
| 32 | |||
| 33 | 1 | ▶ | sub BUILD { |
|
Subroutine
BUILD: called CC=1 SCAR=0.0
Pod
undocumented
| |||
| 34 | 1 | my $self = shift; | |
| 35 | |||
| 36 | 1 | $self->clear(); | |
| 37 | 1 | $self->cls(); | |
| 38 | } | ||
| 39 | |||
| 40 | |||
| 41 | |||
| 42 | 1 | ▶ | sub set_level { |
|
Subroutine
set_level: called CC=1 SCAR=0.0
Pod
documented
| |||
| 43 | 1 | my ( $self, $value, %args ) = validated_setter( | |
| 44 | \@_, | ||
| 45 | value => { isa => 'Num' }, | ||
| 46 | ); | ||
| 47 | |||
| 48 | 1 | return $self->linear_step_sweep( | |
| 49 | to => $value, verbose => $self->verbose, | ||
| 50 | %args | ||
| 51 | ); | ||
| 52 | } | ||
| 53 | |||
| 54 | |||
| 55 | 0 | ▶ | sub get_measurement { |
|
Subroutine
get_measurement: not called CC=1 SCAR=6.9
Pod
documented
| |||
| 56 | 0 | my ( $self, %args ) = validated_getter( \@_ ); | |
| 57 | 0 | my $meas = $self->query( command => ':MEAS:CURR?', %args ); | |
| 58 | 0 | my $elements = $self->query( command => ':FORM:ELEM?' ); | |
| 59 | 0 | my @elements = split /,/, $elements; | |
| 60 | 0 | my @meas_values = split /,/, $meas; | |
| 61 | 0 | my %result = map { $_ => shift @meas_values } @elements; | |
| 62 | 0 | return \%result; | |
| 63 | } | ||
| 64 | |||
| 65 | # | ||
| 66 | # Aliases for Lab::XPRESS::Sweep API | ||
| 67 | # | ||
| 68 | |||
| 69 | |||
| 70 | 1 | ▶ | sub cached_level { |
|
Subroutine
cached_level: called CC=1 SCAR=0.0
Pod
documented
| |||
| 71 | 1 | my $self = shift; | |
| 72 | 1 | return $self->cached_source_level(@_); | |
| 73 | } | ||
| 74 | |||
| 75 | |||
| 76 | 1 | ▶ | sub get_level { |
|
Subroutine
get_level: called CC=1 SCAR=0.0
Pod
documented
| |||
| 77 | 1 | my $self = shift; | |
| 78 | 1 | return $self->source_level_query(@_); | |
| 79 | } | ||
| 80 | |||
| 81 | |||
| 82 | 0 | ▶ | sub set_voltage { |
|
Subroutine
set_voltage: not called CC=1 SCAR=6.9
Pod
documented
| |||
| 83 | 0 | my $self = shift; | |
| 84 | 0 | my $value = shift; | |
| 85 | 0 | return $self->set_level( value => $value ); | |
| 86 | } | ||
| 87 | |||
| 88 | |||
| 89 | 2 | with qw( | |
| 90 | Lab::Moose::Instrument::Common | ||
| 91 | Lab::Moose::Instrument::SCPI::Sense::Function::Concurrent | ||
| 92 | Lab::Moose::Instrument::SCPI::Sense::Protection | ||
| 93 | Lab::Moose::Instrument::SCPI::Sense::Range | ||
| 94 | Lab::Moose::Instrument::SCPI::Sense::NPLC | ||
| 95 | Lab::Moose::Instrument::SCPI::Source::Function | ||
| 96 | Lab::Moose::Instrument::SCPI::Source::Level | ||
| 97 | Lab::Moose::Instrument::SCPI::Source::Range | ||
| 98 | Lab::Moose::Instrument::LinearStepSweep | ||
| 99 | ); | ||
| 100 | |||
| 101 | 2 | __PACKAGE__->meta()->make_immutable(); | |
| 102 | |||
| 103 | 2 | 1; | |
| 104 | |||
| 105 | __END__ | ||