mp1
MP1 class for Gulmay MP1 xray controllers.
Functions
|
Callable to perfom extra readbacks if required for MP1 failed command calls. |
Classes
|
SCPIInstrument implementation for Gulmay MP1 xray controller. |
mp1_set_requires_readback
- icicle.mp1.mp1_set_requires_readback(inst, command, value, readback_value)
Callable to perfom extra readbacks if required for MP1 failed command calls.
- Parameters:
inst – MP1 instance.
command – raw command that was sent corresponding to this set().
value – value that had been injected into set() command.
readback_value – value received from initial readback.
MP1
- class icicle.mp1.MP1(*args, **kwargs)
Bases:
SCPIInstrument
SCPIInstrument implementation for Gulmay MP1 xray controller.
- __init__(resource='ASRL10::INSTR', 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
Serial Baud rate.
- COM_RESET = ''
Instrument Reset command - does not exist for MP1!
- DATA_BITS = 8
Number of data bits contained in each frame (from 5 to 8).
- MEASURE_COMMAND_MAP = {'CURR:DC': 'CURRENT', 'VOLT:DC': '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 Keithley2410.
- property errors
- Returns:
List of errors.
- property status
000 : KEY_IN_POS_2
001 : XRAY_OFF
002 : PREWARMING
003 : XRAY_RAMPING
004 : XRAY_ON
- Returns:
MODE code.
- Return type:
int.
- property value
Performs measurement and returns value.
- Returns:
measured value.
- Return type:
float
- OUTPUTS = 1
- PARITY = 0
Parity used with every frame transmitted and received.
- class PowerChannel(instrument, channel, measure_voltage, measure_current)
Bases:
PowerChannel
PowerChannel implementation for Keithley2410.
- property current
- Returns:
currently set channel current.
- Return type:
float
- property current_trip
- Returns:
whether current limit has been tripped on this channel.
- Return type:
bool
- property errors
- Returns:
List of errors.
- property interlocked
- Returns:
Whether xray box is in interlock state.
- property state
- Returns:
whether this power channel is on or off (True/False).
- Return type:
bool
- property status
000 : KEY_IN_POS_2
001 : XRAY_OFF
002 : PREWARMING
003 : XRAY_RAMPING
004 : XRAY_ON
- Returns:
MODE code.
- Return type:
int.
- property voltage
- Returns:
currently set channel voltage.
- Return type:
float
- property voltage_trip
- Returns:
whether voltage limit has been tripped on this channel.
- Return type:
bool
- READ_TERMINATION = '\r'
Read termination characters.
- SETTINGS = {'CURRENT': {'QUERY': '?I', 'SET': '!I{:03d}', 'parser': <function MP1.<lambda>>, 'verifier': <function is_numeric.<locals>._is_numeric>}, 'ERRORS': {'QUERY': '?E', 'parser': <function MP1.<lambda>>}, 'FOCUS': {'QUERY': '?F', 'SET': '!{}', 'parser': <function MP1.<lambda>>, 'verifier': <function is_in.<locals>._is_in>}, 'IDENTIFIER': {'QUERY': '?P926', 'parser': <function MP1.<lambda>>}, 'MODE': {'QUERY': '?M', 'parser': <function MP1.<lambda>>, 'response_map': {'000': 'KEY_IN_POS_2', '001': 'XRAY_OFF', '002': 'PREWARMING', '003': 'XRAY_RAMPING', '004': 'XRAY_ON'}}, 'MODE_CODE': {'QUERY': '?M', 'parser': <function MP1.<lambda>>}, 'OUTPUT': {'QUERY': '?M', 'SET': '!{}', 'parser': <function MP1.<lambda>>, 'response_map': {'000': False, '001': False, '002': False, '003': True, '004': True}, 'verifier': <function truthy.<locals>._truthy>}, 'PROGRAMME': {'QUERY': '?P', 'parser': <function MP1.<lambda>>}, 'PROGRAMME_REVISION': {'QUERY': '?R', 'parser': <function MP1.<lambda>>}, 'RESET_TIMER': {'SET': '!T'}, 'TIMER': {'QUERY': '?T', 'parser': <function MP1.<lambda>>}, 'VOLTAGE': {'QUERY': '?V', 'SET': '!V{:03d}', 'parser': <function MP1.<lambda>>, 'verifier': <function is_integer.<locals>._is_integer>}, 'WARMUP': {'QUERY': '?U', 'parser': <function MP1.<lambda>>}}
Settings dictionary with all Set/Query combinations.
- SET_REQUIRES_READBACK(command, value, readback_value)
Set function to gobble returned bits after failed set().
- SOURCE_TYPES = {'DC': 'DC Voltage (V)/Current (A)'}
- STOP_BITS = 10
Number of stop bits to indicate end of frame.
- TIMEOUT = 10000
Serial link timeout (ms).
- WRITE_TERMINATION = '\r'
Write termination characters.
- off(**kwargs)
Turn off xrays.
- 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(**kwargs)
Turn on xrays.
- Parameters:
no_lock – override acquire_lock (e.g. if lock already taken by function that on-call is nested within).
- Returns:
read-back value.
- reset()
Disable since this device has no reset command.
- status(channel, **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.
- 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