ttitsx
TTI class for TTI TSX1820P-style low voltage power supplies.
Classes
|
SCPIInstrument implementation for TTI TSX1820P or similar low voltage power supply. |
TTITSX
- class icicle.ttitsx.TTITSX(*args, **kwargs)
Bases:
SCPIInstrument
SCPIInstrument implementation for TTI TSX1820P or similar low voltage power supply.
- __init__(resource='ASRL7::INSTR', outputs=1, sim=False)
- Parameters:
resource – VISA Resource address. See VISA docs for more info.
outputs – How many outputs this TTI power supply has.
- BAUD_RATE = 9600
- COM_RESET = '*RST; STATUS:PRESET; *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 TTI.
- property status
- Returns:
Event Status Register value.
- Return type:
int
- 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 TTI.
- 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:
Channel Status Register value.
- Return type:
int
- 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
- SETTINGS = {'CHANNEL_STATUS_REGISTER': {'QUERY': 'LSR1?', 'parser': <function numeric_int>}, 'CURRENT': {'QUERY': 'I?', 'SET': 'I {}', 'parser': <function strip_float.<locals>._strip_float>, 'unit': 'A', 'verifier': <function is_numeric.<locals>._is_numeric>}, 'CURRENT_STEP': {'QUERY': 'DELTAI1?', 'SET': 'DELTAI1 {}', 'parser': <function strip_float.<locals>._strip_float>, 'unit': 'A', 'verifier': <function is_numeric.<locals>._is_numeric>}, 'DAMPING': {'SET': 'DAMPING1 {}', 'verifier': <function is_in.<locals>._is_in>}, 'DECREMENT_CURRENT': {'SET': 'DECI1'}, 'DECREMENT_VOLTAGE': {'SET': 'DECV1'}, 'EVENT_STATUS_REGISTER': {'QUERY': '*ESR?', 'parser': <function numeric_int>}, 'IDENTIFIER': {'QUERY': '*IDN?'}, 'INCREMENT_CURRENT': {'SET': 'INCI1'}, 'INCREMENT_VOLTAGE': {'SET': 'INCV1'}, 'LOCAL': {'SET': 'LOCAL'}, 'OCP': {'QUERY': 'OCP1?', 'SET': 'OCP1 {}', 'parser': <function float_or_strings.<locals>._float_or_strings>, 'unit': 'A', 'verifier': <function verifier_or.<locals>._verifier_or>}, 'OCP_TRIPPED': {'QUERY': 'LSR1?', 'parser': <function bitfield_bool.<locals>._bitfield_bool>}, 'OUTPUT': {'QUERY': 'OP1?', 'SET': 'OP1 {}', 'parser': <function numeric_bool>, 'verifier': <function truthy.<locals>._truthy>}, 'OUTPUT_CURRENT': {'QUERY': 'IO?', 'parser': <function strip_float.<locals>._strip_float>, 'unit': 'A'}, 'OUTPUT_VOLTAGE': {'QUERY': 'VO?', 'parser': <function strip_float.<locals>._strip_float>, 'unit': 'V'}, 'OVP': {'QUERY': 'OVP1?', 'SET': 'OVP1 {}', 'parser': <function float_or_strings.<locals>._float_or_strings>, 'unit': 'V', 'verifier': <function verifier_or.<locals>._verifier_or>}, 'OVP_TRIPPED': {'QUERY': 'LSR1?', 'parser': <function bitfield_bool.<locals>._bitfield_bool>}, 'STATUS_BYTE': {'QUERY': '*STB?', 'parser': <function numeric_int>}, 'SYSTEM_MODE': {'QUERY': 'IFLOCK?', 'SET': '{}', 'parser': <function int_map.<locals>.int_map_>, 'verifier': <function map_to.<locals>._is_in>}, 'TRIP_CLEAR': {'QUERY': 'LSR1?'}, 'VOLTAGE': {'QUERY': 'V?', 'SET': 'V {}', 'parser': <function strip_float.<locals>._strip_float>, 'unit': 'V', 'verifier': <function is_numeric.<locals>._is_numeric>}, 'VOLTAGE_STEP': {'QUERY': 'DELTAV1?', 'SET': 'DELTAV1 {}', 'parser': <function strip_float.<locals>._strip_float>, 'unit': 'V', 'verifier': <function is_numeric.<locals>._is_numeric>}, 'VRANGE': {'QUERY': 'VRANGE1?', 'SET': 'VRANGE1 {}', 'parser': <function numeric_int>, '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()
Measure output voltage, current.
- Parameters:
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()
Helper function for monitoring/logging especially for dirigent.
- off(**kwargs)
Turn off output.
- Parameters:
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()
Turn on output. For some reason needs an explicit check/retry loop since this sometimes fails?
- Parameters:
no_lock – override acquire_lock (e.g. if lock already taken by function that on-call is nested within).
- Returns:
read-back value.
- property outputs
- Returns:
Iterator over all outputs (i.e. numbers 1, 2, …)
- publish(client, line, topic=None)
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.
- status(**kwargs)
Check status of output.
- Parameters:
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, target_value, delay=1, step_size=None, n_steps=None, measure=False, set_function=None, set_args=None, measure_function=None, measure_args=None, query_args=None, log_function=None, power_cycle_each_step=False, **kwargs)
Sweep target_setting.
- Parameters:
target_setting – name of setting that set() call should target.
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)
Returns the header for print-outs, when doing a sweep.
Helper function of instrument.sweep()
- Parameters:
measured_unit – Maybe required, as it is not necessarily the tti, that performs the measurement.
- validate_channel(channel, raise_exception=True)
Check if a power channel exists on this device. Only successful if channel == 1.
- Parameters:
channel – Channel number to validate as an input