keysighte3633a
Keysight class for Keysight E3633A low voltage power supplies.
Classes
|
SCPIInstrument implementation for Keysight E3633A or similar low voltage power supply. |
KeysightE3633A
- class icicle.keysighte3633a.KeysightE3633A(*args, **kwargs)
Bases:
SCPIInstrument
SCPIInstrument implementation for Keysight E3633A or similar low voltage power supply.
- __init__(resource='ASRL4::INSTR', outputs=1, sim=False)
- Parameters:
resource – VISA Resource address. See VISA docs for more info.
- BAUD_RATE = 9600
Serial link Baud rate.
- COM_RESET = '*RST; *CLS'
Instrument Reset SCPI command.
- MEASURE_COMMAND_MAP = {'CURR:DC': 'OUTPUT_CURRENT', 'VOLT:DC': 'OUTPUT_VOLTAGE'}
- MEASURE_TYPES = {'CURR:DC': 'Output DC Current (A)', 'VOLT:DC': 'Output DC Voltage (V)'}
- class MeasureChannel(instrument, channel, measure_type, unit='')
Bases:
MeasureChannel
MeasureChannel implementation for Keysight E3633A.
- property status
- Returns:
Event Status Register value.
- property value
Performs measurement and returns value.
- Returns:
measured value.
- Return type:
float
- OUTPUTS = 1
- class PowerChannel(instrument, channel, measure_voltage, measure_current)
Bases:
PowerChannel
PowerChannel implementation for Keysight E3633A.
- property current
- Returns:
currently set channel current.
- Return type:
float
- property current_limit
- Returns:
currently set channel current limit.
- Return type:
float
- property current_trip
- Returns:
whether current limit has been tripped on this channel.
- Return type:
bool
- reset_current_trip()
Attempts to reset current trip condition.
- Returns:
success/failure of operation.
- Return type:
bool
- reset_voltage_trip()
Attempts to reset voltage trip condition.
- Returns:
success/failure of operation.
- Return type:
bool
- property state
- Returns:
whether this power channel is on or off (True/False).
- Return type:
bool
- property status
- Returns:
Status Byte value.
- property voltage
- Returns:
currently set channel voltage.
- Return type:
float
- property voltage_limit
- Returns:
currently set channel voltage limit.
- Return type:
float
- property voltage_trip
- Returns:
whether voltage limit has been tripped on this channel.
- Return type:
bool
- REGISTERS = {'EVENT_STATUS_REGISTER': 'Event Status Register', 'QUESTIONABLE_STATUS_REGISTER': 'Questionable Status Register', 'STATUS_BYTE': 'Status Byte'}
- SETTINGS = {'CURRENT': {'QUERY': 'SOUR:CURR:LEV?', 'SET': 'SOUR:CURR:LEV {}', 'parser': <function strip_float.<locals>._strip_float>, 'verifier': <function is_numeric.<locals>._is_numeric>}, 'CURRENT_STEP': {'QUERY': 'SOUR:CURR:LEV:IMM:STEP?', 'SET': 'SOUR:CURR:LEV:IMM:STEP {}', 'parser': <function strip_float.<locals>._strip_float>, 'verifier': <function is_numeric.<locals>._is_numeric>}, 'EVENT_STATUS_REGISTER': {'QUERY': '*ESR?', 'parser': <function numeric_int>}, 'EVENT_STATUS_REGISTER_ENABLE': {'QUERY': '*ESE?', 'SET': '*ESE {}', 'parser': <function numeric_int>, 'verifier': <function is_integer.<locals>._is_integer>}, 'IDENTIFIER': {'QUERY': '*IDN?'}, 'NSEL': {'QUERY': 'INST:NSEL?', 'SET': 'INST:NSEL {}', 'parser': <function numeric_int>, 'verifier': <function is_integer.<locals>._is_integer>}, 'OCP': {'QUERY': 'SOUR:CURR:PROT:LEV?', 'SET': 'SOUR:CURR:PROT:LEV {}', 'parser': <function strip_float.<locals>._strip_float>, 'verifier': <function is_numeric.<locals>._is_numeric>}, 'OCP_CLEAR': {'SET': 'SOUR:CURR:PROT:CLE'}, 'OCP_ENABLED': {'QUERY': 'SOUR:CURR:PROT:STAT?', 'SET': 'SOUR:CURR:PROT:STAT {}', 'parser': <function numeric_bool>, 'verifier': <function truthy.<locals>._truthy>}, 'OCP_TRIPPED': {'QUERY': 'SOUR:CURR:PROT:TRIP?', 'parser': <function numeric_bool>}, 'OUTPUT': {'QUERY': 'OUTP:STAT?', 'SET': 'OUTP:STAT {}', 'parser': <function numeric_bool>, 'verifier': <function truthy.<locals>._truthy>}, 'OUTPUT_CURRENT': {'QUERY': 'MEAS:CURR:DC?', 'parser': <function strip_float.<locals>._strip_float>}, 'OUTPUT_VOLTAGE': {'QUERY': 'MEAS:VOLT:DC?', 'parser': <function strip_float.<locals>._strip_float>}, 'OVP': {'QUERY': 'SOUR:VOLT:PROT:LEV?', 'SET': 'SOUR:VOLT:PROT:LEV {}', 'parser': <function strip_float.<locals>._strip_float>, 'verifier': <function is_numeric.<locals>._is_numeric>}, 'OVP_CLEAR': {'SET': 'SOUR:VOLT:PROT:CLE'}, 'OVP_ENABLED': {'QUERY': 'SOUR:VOLT:PROT:STAT?', 'SET': 'SOUR:VOLT:PROT:STAT {}', 'parser': <function numeric_bool>, 'verifier': <function truthy.<locals>._truthy>}, 'OVP_TRIPPED': {'QUERY': 'SOUR:VOLT:PROT:TRIP?', 'parser': <function numeric_bool>}, 'QUESTIONABLE_STATUS_REGISTER': {'QUERY': ':STAT:QUES?', '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>}, 'SEL': {'QUERY': 'INST:SEL?', 'SET': 'INST:SEL {}', 'verifier': <function is_in.<locals>._is_in>}, '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>}, 'VOLTAGE': {'QUERY': 'SOUR:VOLT:LEV?', 'SET': 'SOUR:VOLT:LEV {}', 'parser': <function strip_float.<locals>._strip_float>, 'verifier': <function is_numeric.<locals>._is_numeric>}, 'VOLTAGE_STEP': {'QUERY': 'SOUR:VOLT:LEV:IMM:STEP?', 'SET': 'SOUR:VOLT:LEV:IMM:STEP {}', 'parser': <function strip_float.<locals>._strip_float>, 'verifier': <function is_numeric.<locals>._is_numeric>}, 'VRANGE': {'QUERY': 'SOUR:VOLT:RANG?', 'SET': 'SOUR:VOLT:RANG {}', 'verifier': <function is_in.<locals>._is_in>}}
Settings dictionary with all Set/Query SCPI combinations.
- SOURCE_TYPES = {'DC': 'DC Voltage (V)/Current (A)'}
- TIMEOUT = 10000
Serial link timeout (ms).
- measure(channel)
Measure output voltage, current.
- Parameters:
channel – output to be measured.
no_lock – override acquire_lock (e.g. if lock already taken by function that measure-call is nested within).
- Returns:
tuple (voltage, current).
- monitor_step(channel)
Helper function for monitoring/logging especially for dirigent.
- off(channel, **kwargs)
Turn off output.
- Parameters:
channel – output to be turned off.
no_lock – override acquire_lock (e.g. if lock already taken by function that off-call is nested within).
attempts – how many retries to give set command.
- Returns:
read-back value.
- on(channel)
Turn on output. For some reason needs an explicit check/retry loop since this sometimes fails?
- Parameters:
channel – output to be turned on.
no_lock – override acquire_lock (e.g. if lock already taken by function that on-call is nested within).
- Returns:
read-back value.
- publish(client, line, channel='ALL')
Publish data line (from Monitoring) to MQTT.
TODO: don’t reparse line here; instead pass/access raw data?
- Parameters:
client – MQTTClient object to publish with.
line – MonitoringLogger line to publish.
channel – which channel the data has been measured for. May be ‘ALL’.
- query_channel(setting, channel, **kwargs)
Query setting on instrument for output channel.
- Parameters:
setting – key in class dictionary SETTINGS.
channel – output to set this setting on.
no_lock – override acquire_lock (e.g. if lock already taken by function that query_channel-call is nested within).
attempts – how many retries to give set command.
- Returns:
data returned by device for given query.
- set_channel(setting, channel, *value, **kwargs)
Set setting on instrument to value for output channel, and read-back using equivalent query().
- Parameters:
setting – key in class dictionary SETTINGS.
channel – channel to set this setting on.
value – target value for setting.
no_lock – override acquire_lock (e.g. if lock already taken by function that set_channel-call is nested within).
attempts – how many retries to give set command.
- Returns:
read-back value if query() available, else whether number of bytes written during set() meets expectation
- status(channel, **kwargs)
Check status of output.
- Parameters:
channel – output to be turned on.
no_lock – override acquire_lock (e.g. if lock already taken by function that status-call is nested within).
attempts – how many retries to give set command.
- Returns:
status of output.
- sweep(target_setting, channel, target_value, delay=1, step_size=None, n_steps=None, measure=False, set_function=None, set_args=None, query_function=None, query_args=None, measure_function=None, measure_args=None, log_function=None, power_cycle_each_step=False, **kwargs)
Sweep target_setting on a given channel.
- Parameters:
target_setting – name of setting that set() call should target.
channel – output to perform sweep on.
target_value – value of setting to sweep to (from current).
delay – delay between sweep steps (in seconds)
step_size – step size between sweep steps
n_steps – number of steps to perform (alternative to step_size - specify one but not both)
set_function – function to use for set() call. Defaults to self.set
set_args – additional keyword arguments to pass to set()
measure – whether to measure at each step of sweep.
measure_function – function to use for measure() call. Defaults to self.measure
measure_args – additional keyword arguments to pass to measure()
query_args – additional keyword arguments to pass to query() at each step.
power_cycle_each_step – set callback function to _power_cycle with correct arguments.
execute_each_step – accepts a callback function (no arguments) to be executed at each step of the sweep.
- Returns:
final parameter value[, measure data]
- sweep_print_header(measured_unit=None)
Returns the header for print-outs, when doing a sweep.
Helper function of instrument.sweep() @param: measured_unit: Type of measurement that is performed. If ‘None’, the measurement is only output Voltage and output Current.
- validate_channel(channel, raise_exception=True)
Check if an output exists on this device.
- Parameters:
channel – Channel number to validate as an output.