rminstr.instruments.HP3457A

Classes

Ammeter

Implementation the HP3457A as an ammeter.

Package Contents

class rminstr.instruments.HP3457A.Ammeter(visa_address: str, resource_manager: pyvisa.ResourceManager = None, log_path: str = None)

Bases: rminstr.instruments.communications.Instrument, rminstr.instruments.measurement_functionalities.ABC_Ammeter

Implementation the HP3457A as an ammeter.

Initialize the ammeter class instance.

Parameters:
visa_addressstr

Visa address of instrument.

resource_managervisa.ResourceManager, optional

Pyvisa resource manager for opening visa resources. The default is None.

log_pathstr, optional

If provided, will log at the specified path. The default is None.

Returns:
None.
default_setup_settings
initial_setup(display: bool = False, **kwargs)

Initiliaze the ammeter’s local settings to a safe state.

Parameters:
displaybool, optional

Boolean to turn on the front display or not. The default is False.

Returns:
None.
setup(nplc: float = None, i_range: float = None, num_readings: int = None, timer: float = None, measure_autozero: bool = None, **kwargs)

Change measurement settings.

Parameters:
nplcfloat, optional

Number of power line cycles to integrate over. The default is None.

i_rangefloat, optional

Current measurement range. The default is None.

num_readingsint, optional

Number of readings to take. The default is None.

timerfloat, optional

Timer between measurements. Needs to be long enough or there will be an error. The default is None.

measure_autozerobool, optional

Whether or not to auto zero each measurement. If False it will auto zero once at the beginning. The default is None.

Returns:
None.
arm(delay: float = 0, trigger_source: str = 'BUS')

Arm the machine.

Currently just sets the machine to auto trigger, hold.

Parameters:
delayfloat, optional

Delay between receiving a trigger command and taking the measurement. The default is 0.

trigger_mode: str, optional

BUS for triggering via GPIB, EXT for external triggering. The default is ‘BUS’.

Returns:
None.
trigger()

Trigger a measurement.

Currently just starts a measurement.

Returns:
None.
fetch_data(time_column_name: str = 'timestamp', i_column_name: str = 'Current (A)', meas_start_time: float = None) dict

Fetch data from the machine.

Parameters:
time_column_namestr, optional

Name you want for timestamps key. The default is “timestamp”.

i_column_namestr, optional

Name you want for current key. The default is “Current (A)”.

meas_start_timefloat, optional

If provided, will be used as timestamp for time of trigger. The default is None.

Returns:
dict

Measurement data.

query_state()

Check the state of the machine.

Returns:
str

Current state of the instrument.

special_read()

Read from HP3457A output buffer.

The HP3457A is unusual, and pyvisa’s read() does not work. read_bytes works, but requires extra work to parse correctly. This funtion does that work for you.

Returns:
str

Whatever happens to be on the HP3457A’s output buffer.

raise_errors()

If the HP3457A is in an error state, raise the errors as python errors.

Returns:
None.
Raises:
InstrumentError

Instrument error if the instrument has errors or is in an error state.

get_errors() str

Get any errors present on the instrument as a string.

Returns:
str

Error string if one is there.

do_after_group_trigger()

Run post-trigger commands after an external trigger event.

Returns:
None.