hp34401a
HP34401A class for HP34401A multimeter.
Classes
|
HP34401A
- class icicle.hp34401a.HP34401A(*args, **kwargs)
Bases:
SCPIInstrument
- __init__(resource='ASRL5::INSTR', sim=False)
- Parameters:
resource – VISA Resource address. See VISA docs for more info.
- BAUD_RATE = 9600
Serial link Baud rate.
- COM_CLEAR_TRACE = ':TRAC:CLE'
Clear trace SCPI command.
- COM_IMMEDIATE_TRIGGER = ':INIT:IMM'
Immediate Trigger SCPI command.
- COM_RESET = '*RST; STATUS:PRESET; *CLS'
Instrument Reset SCPI command.
- COM_SELFTEST = '*TST?'
Selftest SCPI command.
- MEASURE_TYPES = {'CONT': 'Continuity', 'CURR:AC': 'AC Current (A)', 'CURR:DC': 'DC Current (A)', 'DIOD': 'Diode', 'FREQ': 'Frequency (Hz)', 'FRES': 'Four-Wire Resistance (Ohm)', 'PER': 'Period ()', 'RES': 'Resistance (Ohm)', 'VOLT:AC': 'AC Voltage (V)', 'VOLT:DC': 'DC Voltage (V)', 'VOLT:DC:RAT': 'DC Voltage Ratio'}
Measurement types for this instrument.
- class MeasureChannel(instrument, channel, measure_type, unit='')
Bases:
MeasureChannel
MeasureChannel implementation for HP34401A.
- property status
- Returns:
Measurement Status Register value.
- property value
Performs measurement and returns value.
- Returns:
measured value.
- Return type:
float
- READ_TERMINATION = '\r\n'
Read termination characters.
- REGISTERS = {'EVENT_STATUS_REGISTER': 'Event Status Register', 'QUESTIONABLE_STATUS_REGISTER': 'Questionable Status Register', 'STATUS_BYTE': 'Status Byte'}
- SETTINGS = {'AUTODELAY_SWITCH': {'QUERY': ':TRIG:DEL:AUTO?', 'SET': ':TRIG:DEL:AUTO {}', 'parser': <function truthy_bool.<locals>._truthy>, 'verifier': <function truthy.<locals>._truthy>}, 'AUTOZERO': {'QUERY': ':SENS:ZERO:AUTO?', 'SET': ':SENS:ZERO:AUTO {}', 'parser': <function truthy_bool.<locals>._truthy>, 'verifier': <function is_in.<locals>._is_in>}, 'AVERAGING_COUNT': {'QUERY': ':CALC:AVER:COUN?', 'SET': ':CALC:AVER:COUN {}', 'parser': <function numeric_int>, 'verifier': <function is_integer.<locals>._is_integer>}, 'AVERAGING_FUNCTION': {'QUERY': ':CALC:FUNC?', 'SET': ':CALC:FUNC {}', 'verifier': <function is_in.<locals>._is_in>}, 'CONFIGURE': {'QUERY': ':CONF?', 'SET': ':CONF:{}', 'verifier': <function is_in.<locals>._is_in>}, 'ENABLE_AVERAGING': {'QUERY': ':CALC:STAT?', 'SET': ':CALC:STAT {}', 'parser': <function truthy_bool.<locals>._truthy>, 'verifier': <function truthy.<locals>._truthy>}, 'EVENT_STATUS_REGISTER': {'QUERY': '*ESR?', 'parser': <function numeric_int>}, 'EVENT_STATUS_REGISTER_ENABLE': {'QUERY': '*ESR {}', 'parser': <function numeric_int>, 'verifier': <function is_integer.<locals>._is_integer>}, 'IDENTIFIER': {'QUERY': '*IDN?'}, 'LINE_INTEGRATION_CYCLES': {'QUERY': ':SENS:{}:NPLC?', 'SET': ':SENS:{}:NPLC {:.2f}', 'parser': <function numeric_float>, 'verifier': (<function is_in.<locals>._is_in>, <function is_numeric.<locals>._is_numeric>)}, 'MEASUREMENT_EVENT_REGISTER': {'QUERY': ':STAT:QUES:ENAB?', 'SET': ':STAT:QUES:ENAB {}', 'parser': <function numeric_int>, 'verifier': <function is_integer.<locals>._is_integer>}, 'MEASUREMENT_REGISTER': {'QUERY': ':STAT:QUES:EVEN?', 'parser': <function numeric_int>}, 'MEASUREMENT_STATUS_REGISTER': {'QUERY': ':STAT:MEAS:EVEN?', 'parser': <function numeric_int>}, 'MEASUREMENT_STATUS_REGISTER_ENABLE': {'QUERY': ':STAT:MEAS:ENAB?', 'SET': ':STAT:MEAS:ENAB {}', 'parser': <function numeric_int>, 'verifier': <function is_integer.<locals>._is_integer>}, 'QUESTIONABLE_STATUS_REGISTER': {'QUERY': ':STAT:QUES:EVEN?', 'parser': <function numeric_int>}, 'QUESTIONABLE_STATUS_REGISTER_ENABLE': {'QUERY': ':STAT:QUES:ENAB?', 'SET': ':STAT:QUES:ENAB {}', 'parser': <function numeric_int>, 'verifier': <function is_integer.<locals>._is_integer>}, 'READ': {'QUERY': ':READ?', 'parser': <function numeric_float>}, 'SAMPLE_COUNT': {'QUERY': ':SAMP:COUN?', 'SET': ':SAMP:COUN {}', 'parser': <function numeric_int>, 'verifier': <function is_integer.<locals>._is_integer>}, 'SENSE_AVERAGING': {'QUERY': ':CALC:STAT?', 'SET': ':CALC:STAT {}', 'parser': <function truthy_bool.<locals>._truthy>, 'verifier': <function truthy.<locals>._truthy>}, 'SENSE_AVERAGING_COUNT': {'QUERY': ':CALC:AVER:COUN?', 'SET': ':CALC:AVER:COUN {}', 'parser': <function numeric_int>, 'verifier': <function is_integer.<locals>._is_integer>}, 'SENSE_AVERAGING_TYPE': {'QUERY': ':CALC:FUNC?', 'SET': ':CALC:FUNC {}', 'verifier': <function is_in.<locals>._is_in>}, 'SENSE_CURRENT_INTEGRATION': {'QUERY': ':SENS:CURR:DC:NPLC?', 'SET': ':SENS:CURR:DC:NPLC {:.2f}', 'parser': <function numeric_float>, 'verifier': <function is_numeric.<locals>._is_numeric>}, 'SENSE_FRESISTANCE_INTEGRATION': {'QUERY': ':SENS:FRES:NPLC?', 'SET': ':SENS:FRES:NPLC {:.2f}', 'parser': <function numeric_float>, 'verifier': <function is_numeric.<locals>._is_numeric>}, 'SENSE_FUNCTION': {'QUERY': ':SENS:FUNC?', 'SET': ':SENS:FUNC "{}"', 'verifier': <function is_in.<locals>._is_in>}, 'SENSE_RESISTANCE_INTEGRATION': {'QUERY': ':SENS:RES:NPLC?', 'SET': ':SENS:RES:NPLC {:.2f}', 'parser': <function numeric_float>, 'verifier': <function is_numeric.<locals>._is_numeric>}, 'SENSE_VOLTAGE_INTEGRATION': {'QUERY': ':SENS:VOLT:DC:NPLC?', 'SET': ':SENS:VOLT:DC:NPLC {:.2f}', 'parser': <function numeric_float>, 'verifier': <function is_numeric.<locals>._is_numeric>}, 'SERVICE_REQUEST_ENABLE': {'QUERY': '*SRE?', 'SET': '*SRE {}', 'parser': <function numeric_int>, 'verifier': <function is_integer.<locals>._is_integer>}, 'STATUS_BYTE': {'QUERY': '*STB?', 'parser': <function numeric_int>}, 'STATUS_BYTE_ENABLE': {'QUERY': '*SRE?', 'SET': '*SRE {}', 'parser': <function numeric_int>, 'verifier': <function is_integer.<locals>._is_integer>}, 'SYSTEM_MODE': {'SET': ':SYST:{}', 'verifier': <function is_in.<locals>._is_in>}, 'TRIGGER_COUNT': {'QUERY': ':TRIG:COUN?', 'SET': ':TRIG:COUN {}', 'parser': <function numeric_float>, 'verifier': <function verifier_or.<locals>._verifier_or>}, 'TRIGGER_DELAY': {'QUERY': ':TRIG:DEL?', 'SET': ':TRIG:DEL {}', 'parser': <function numeric_float>, 'verifier': <function is_numeric.<locals>._is_numeric>}, 'TRIGGER_DELAY_AUTO': {'QUERY': ':TRIG:DEL:AUTO?', 'SET': ':TRIG:DEL:AUTO {}', 'parser': <function truthy_bool.<locals>._truthy>, 'verifier': <function truthy.<locals>._truthy>}, 'TRIGGER_SOURCE': {'QUERY': ':TRIG:SOUR?', 'SET': ':TRIG:SOUR {}', 'verifier': <function is_in.<locals>._is_in>}}
Settings dictionary with all Set/Query SCPI combinations.
- SMALL_DELAY = 0.5
Small delay between subsequent commands (s).
- TIMEOUT = 10000
Serial link timeout (ms).
- WRITE_TERMINATION = '\r\n'
Write termination characters.
- clear_trace()
Clears measurement trace.
- Parameters:
no_lock – override acquire_lock (e.g. if lock already taken by function that clear_trace-call is nested within).
attempts – how many retries to give set command.
- Returns:
result of COM_CLEAR_TRACE SCPI command.
- enable_register()
Enables measurement register.
- Parameters:
no_lock – override acquire_lock (e.g. if lock already taken by function that enable_register-call is nested within).
- Returns:
True-ish value on success.
- immediate_trigger()
Send immediate trigger.
- Parameters:
no_lock – override acquire_lock (e.g. if lock already taken by function that immediate_trigger-call is nested within).
attempts – how many retries to give set command.
- Returns:
number of bytes written to serial interface.
- measure(what, repetitions=1, delay=None, cycles=1.0, clear_trace=True)
Performs measurement of requested type.
- Parameters:
what – one of ‘VOLT:DC’, ‘VOLT:AC’, ‘CURR:DC’, ‘CURR:AC’, ‘RES’, ‘FRES’.
repetitions – how many measurements to make. Defaults to 1.
delay – delay between measurements. Only used when repetitions > 1.
cycles – number of line integration cycles for this measurment type. Defaults to 1.
clear_trace – whether to clear trace after measurements. Defaults to True.
no_lock – override acquire_lock (e.g. if lock already taken by function that measure-call is nested within).
- Returns:
list of measurement values (as floats).
- measure_single(what, clear_trace=True, **kwargs)
Perform single measurement.
- Parameters:
what – one of ‘VOLT:DC’, ‘VOLT:AC’, ‘CURR:DC’, ‘CURR:AC’, ‘RES’, ‘FRES’.
clear_trace – whether to clear trace after measurements. Defaults to True.
no_lock – override acquire_lock (e.g. if lock already taken by function that measure_single-call is nested within).
- Returns:
measured value (float).
- selftest()
Run self-test.
- Parameters:
no_lock – override acquire_lock (e.g. if lock already taken by function that selftest-call is nested within).
- Returns:
result of COM_SELFTEST SCPI command.
- set_all_line_integrations(line_integration_cycles=1)
Set line integration cycles for all measurement types.
- Parameters:
line_integration_cycles – number of line integration cycles.
no_lock – override acquire_lock (e.g. if lock already taken by function that set_all_line_integrations-call is nested within).
- Returns:
read-back value from set(…).
- set_line_integration(what, line_integration_cycles=1, **kwargs)
Set line integration cycles for given measurement type.
- Parameters:
what – one of ‘VOLT:DC’, ‘VOLT:AC’, ‘CURR:DC’, ‘CURR:AC’, ‘RES’, ‘FRES’.
line_integration_cycles – number of line integration cycles.
no_lock – override acquire_lock (e.g. if lock already taken by function that no_lock-call is nested within).
attempts – how many retries to give set command.
- Returns:
read-back value from set(…).
- sweep_print_header(*ignored)
Returns the header for print-outs, when doing a sweep.
- Helper function of instrument.sweep(). Required parameters (e.g.
measured_unit) are ignored as not needed in this case.
- validate_channel(channel, raise_exception=True)
Check if an channel exists on this device. Only successful if channel == 1.
- Parameters:
channel – Channel number to validate as an input