Measurement Tool Box functions¶
In the following a simple doc string representation of all tool box functions are displayed. These functions can be used to simplify your own measurement plugin. You can simply import it and save an instance of this class and reference it. Or more conveniently, your measurement plugin can inherit the tools class and make every member of tools a member of your plugin. To see how this works see in the tutorial section the chapter Add a new measurement.
-
class
measurement_plugins.forge_tools.tools(framework=None, event_loop=None)[source]¶ Some tools for forging your own measurement plugins. It needs the framework and the event_loop object
-
capacitor_discharge(device_dict, relay_dict, Setterminal=None, terminal=None, do_anyway=False)[source]¶ This function is rather special for SQC. It checks if the capacitor of the decouple box is correctly discharged
- Parameters
device_dict -- Device object
relay_dict -- Relay object
Setterminal -- set terminla command
terminal -- terminal Front or back
do_anyway -- Do it anyway
- Returns
Bool
-
change_value(device_dict, order, value='')[source]¶ This function simply sends a command to a device.
- Parameters
device_dict -- The device object
order -- The command to be send
value -- The value for the command
- Returns
None
-
change_value_query(device_dict, order, value='', answer='1', ignore_answer=False)[source]¶ This function query a command to a device and waits for a return value and compares it with the answer statement, if they are the same a true is returned otherwise a None
- Parameters
device_dict -- Device object
order -- The command to be send
value -- The value
answer -- The answer it should have
ignore_answer -- Should the answer be ignored
- Returns
Answer or None
-
check_compliance(device, compliance=None, command='get_read')[source]¶ This function checks if the current compliance is reached.
- Parameters
device -- The device object
compliance -- The compliance value
command -- The command to check
- Returns
Bool
-
config_setup(device, commands=(), delay=0.0)[source]¶ This function configures the setup for a specific measurement. Commands is a list of tuples, containing (command, values) if no value is defined only command will be send
- Parameters
device -- The device object
commands -- A list of tuples with (command, values). If no value is defined only command will be send
delay -- The delay between each command
- Returns
None
-
do_ramp_value(resource, order, voltage_Start, voltage_End, step, wait_time=0.05, compliance=None, set_value=None)[source]¶ This functions ramps a value from one point to another. It actually sends the commands to the device
- Parameters
resource -- Device object
order -- The command to set tje voltage
voltage_Start -- Start point
voltage_End -- End point
step -- Stepsize
wait_time -- Wait between values
compliance -- Compliance, if None the compliance check will be skipped
set_value -- If you want to set a value each interation in the state machine (must be a callable function)
- Returns
True
-
query_device(device_dict, command)[source]¶ This command just sends the command directly to the device, and waits for an answer. Warning it is not recommended to use this function. Use this function only if you must! Use query_value instead
- Parameters
device_dict -- Dictionary of the device
command -- The command you want to send to the device
- Returns
Return string from the device
-
query_value(device_dict, order, value='')[source]¶ This function simply queries a command to a device.
- Parameters
device_dict -- The device object
order -- The command to be send
value -- The value for the command
- Returns
the return from the device
-
ramp_value(min_value, max_value, deltaI)[source]¶ Generates a list of values in the defined stepsize between the and min/max values
- Parameters
min_value -- Start point of list
max_value -- End point of list
deltaI -- Stepsize between points
- Returns
List
-
ramp_value_log10(min_value, max_value, deltasteps)[source]¶ This function takes a min and max value, deltasteps and generates a list of values in log10 format with each deltasteps values per decade
- Parameters
min_value -- Start value
max_value -- End Value
deltasteps -- How many steps per decade
- Returns
List
-
refine_ramp(ramp, start, stop, step)[source]¶ Refines a ramp of values eg. for IVCV, in the beginning it makes sense to refine the ramp
- Parameters
ramp -- A list of values
start -- Start point of refinement (must be inside of ramp)
stop -- End point of refinement (must be inside of ramp)
step -- The step size of the refinement
- Returns
Updated list
-
send_to_device(device_dict, command, seperate=None)[source]¶ This command just sends the command directly to the device. Warning it is not recommended to use this function. Use this function only if you must! Use change_value instead.
- Parameters
device_dict -- Dictionary of the device
command -- The command you want to send to the device
seperate -- if specified, the string gets split and the command will be send separately at the separator
- Returns
None
-
steady_state_check(device, command='get_read', max_slope=0.001, wait=0.2, samples=4, Rsq=0.95, compliance=5e-05, do_anyway=False, check_compliance=True, iteration=7, wait_time_factor=1.0)[source]¶ This function reads values from a device and fits a linear fit to it. If the fit exceeds a maximum slope it waits a specified time and does ot again. If the slope condition is not reached after a few attempts the function returns False. Otherwise it returns True and indicates a equilibrium has been reached.
- Parameters
device -- The device object which should be queried
command -- The command which should be queried
max_slope -- The maximum slope, x-axis is measured in seconds, so a slope of 1e-9 is a change of 1n per second
wait -- How long to wait between attempts
samples -- How many samples should be used
Rsq -- Minimum R^2 value
compliance -- The compliance value which the value should not exceed
do_anyway -- If the result should be ignored
check_compliance -- If the program should check the compliance value
iteration -- number of iterations
wait_time_factor -- factor the waiting time is increased with every iteration
- Returns
Bool - True means steady state reached
-
VCW - Visa Connect Wizard¶
In the following a simple doc string representation of all VCW functions are displayed. These functions can be used to simplify your own measurement plugin. You can simply import it and save an instance of this class and reference it. Or more conveniently, your measurement plugin always gets a working instance of it in the form of the framework variables object. With it you can easy and savely send your devices any kind of command directly.
Note
Usually you are using a wrapper function of the Measurement Tool Box functions for this functions!
XYZ-Stage Control Class¶
The XYZ-Stage Control Class is a core feature of COMET it allows you to safely operate any configured automated table. An instance is generated on start up -if a stage is configured- in the Framework variables. It features several move functions which has build in the functionality to first move down the stage and then move to another location and if in position move the table up again. This prevents scratches on e.g. silicon sensors when contacted with needles.
Furthermore, it checks the position of the stage to make sure the table is always on the correct location. If not an error will be raised in the COMETs internal error handling system.
Switching System Control Class¶
The Switching System Control Class gives you functions to safely operate a switching system. An instance is generated on start up in the Framework variables. It has the ability to cope with lots of different variants of switching systems. In the following section the needed config files and a how to, will be explained.
First of all you need at least one switching device configured. This device needs an entry Device_type: Switching relay
so that COMET knows that this device is a switching capable device. The other parameters of this device are of the same
type as any other measurement device.
The other thing you need are configs to tell COMET what to switch. Therefore, you need a config YAML file in your project
with the Settings_name: Switching entry and Device_type: Switching relay. This is followed by the entry Switching_Schemes.
In it are the different measurement types to switch followed by the name of the device and then the switching relays which need
to be closed.
To clarify what I mean with that see an example:
---
Settings_name: Switching
Device_type: "Switching relay"
Switching_Schemes:
IV: # Name of the switching configuration
HVSwitching: # Name or Alias of a Switching device
- A1 # relay to switch
- B1
- C2
Rpoly:
HVSwitching: # Name or Alias of a Switching device
- A1
- B1
- C1
LVSwitching: # Name or Alias of a Switching device
- 1C05
- 1C06
Here two switching schemes are defined. IV and Rpoly. For IV only the device/alias HVSwitching will be switched with the relays: A1,B1,C2. For Rpoly not only HVSwitching also the switching device LVSwitching will be switched.
If you have configured your setup like this it is fairly easy to switch to the measurement configuration IV.
Just call the function: switch_to_measurement("IV") and the class will handle the switching on its own.
Important
The class checks if the switching has been done correctly. If your switching of the device does not match the intended switching an error will be raised and the user will be informed.
Some devices have the ability to do a device exclusive switching, so all switching logic is done by the device.
If you want to use this device exclusive switching, the device config file must have the entry: device_exclusive_switching: True
Otherwise you can set it False or not state it at all.
For non exclusive switching devices the switching logic will be done via the switching class.
Note
In future releases there will be a config option to decide BBM or MBB. Currently it is hard coded to BBM since this is the recommended way to do it.