Lab::Instrument::HP3458A - Agilent 3458A Multimeter


version 3.751


    use Lab::Instrument::HP3458A;
    my $dmm=new Lab::Instrument::HP3458A({
        gpib_board   => 0,
        gpib_address => 11,
    print $dmm->get_voltage_dc();


The Lab::Instrument::HP3458A class implements an interface to the Agilent / HP 3458A digital multimeter.


    my $hp=new(%parameters);


pl_freq Parameter: pl_freq

    $npl_freq = $hp->pl_freq();

Get/set the power line frequency at your location (50 Hz for most countries, which is the default). This is the basis of the integration time setting (which is internally specified as a count of power line cycles, or PLCs). The integration time will be set incorrectly if this parameter is set incorrectly.



Make a dc voltage measurement. This also enables autoranging. For finer control, use configure_voltage_dc() and triggered_read.

_head2 triggered_read

    @values = $hp->triggered_read();
    $value = $hp->triggered_read();

Trigger and read value(s) using the current device setup. This expects and digests a list of values in ASCII format, as set up by configure_voltage_dc().


    $result = $hp->triggered_read_raw( read_until_length => $length );

Trigger and read using the current device setup. This won't do any parsing and just return the answer from the device. If $read_until_length (integer) is specified, it will try to continuously read until it has gathered this amount of bytes.


    $hp->configure_voltage_dc($range, $integration_time);

Configure range and integration time for the following DCV measurements.

$range is a voltage or one of "AUTO", "MIN" or "MAX". $integration_time is given in seconds or one of "DEFAULT", "MIN" or "MAX".


    $hp->configure_voltage_dc_trigger($range, $integration_time, 
      $count, $delay);

Configures range, integration time, sample count and delay (between samples) for triggered readings.

$range, $integration_time: see configure_voltage_dc(). $count is the sample count per trigger (integer). $delay is the delay between the samples in seconds.


      $integration_time, $count, $delay);

Same as configure_voltage_dc_trigger, but configures the device for maximum measurement speed. Values are transferred in SINT format and can be fetched and decoded using triggered_read_raw() and decode_SINT(). This mode allows measurements of up to about 100 kSamples/second.

$range: see configure_voltage_dc(). $integration_time: integration time in seconds. The default is 1.4e-6. $count is the sample count per trigger (integer). $delay is the delay between the samples in seconds.



Turn the front-panel display on/off. $state can be each of '1', '0', 'on', 'off'.



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



Clear the message displayed on the front panel.



Issue a single beep immediately.



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.


    # try
    eval { $instrument->check_errors($last_command) };
    # catch
    if ( my $e = Exception::Class->caught('Lab::Exception::DeviceError')) {
        warn "Errors from device!";
        @errors = $e->error_list();
        @devtype = $e->device_class();
        $command = $e->command();               
    } else {
        $e = Exception::Class->caught();
        ref $e ? $e->rethrow; die $e;

Uses get_error() to check the device for occured errors. Reads all present error and throws a Lab::Exception::DeviceError. The list of errors, the device class and the last issued command(s) (if the script provided them) are enclosed.



Sets the integration time in units of power line cycles.



Reset the multimeter to its power-on configuration. Same as preset('NORM').



$config can be any of the following settings:

  'FAST'  / 0
  'NORM'  / 1
  'DIG'   / 2 

Choose one of several configuration presets.



Starts the internal self-test routine.



Starts the internal autocalibration. Warning... this procedure takes 11 minutes with the 'ALL' mode!

$mode can be each of

  'ALL'  / 0
  'DCV'  / 1
  'AC'   / 2
  'OHMS' / 4


    @values = $hp->decode_SINT( $SINT_data, <$iscale> );

Takes a data blob with SINT values and decodes them into a numeric list. The used $iscale parameter is read from the device by default if omitted. Make sure the device still has the same settings as used to obtain $SINT_data, or iscale will be off which leads to invalid data decoding.


probably many



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

  Copyright 2011       Andreas K. Huettel, Florian Olbrich
            2012       Alois Dirnaichner, Andreas K. Huettel, Florian Olbrich
            2013       Alois Dirnaichner, Andreas K. Huettel
            2015       Alois Dirnaichner
            2016       Simon Reinhardt
            2017       Andreas K. Huettel
            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.