class spirack.U1c_module(spi_rack, module, switch_delay = 0.1, initialize = 1)
SPI Rack interface code for the U1c module: an 8*8 full-grid mux matrix.
Parameters:
enable_SR_output(value)
Allows to prevent or enable a refresh of the connection matrix to the U1c HW. This is a safety measure against passing an invalid configuration to the HW. The configuration can still be edited and revised in the SW forms, such as a SW variable or a configuration file, but in the 'disable' condition this data will not be updated in the HW.
Parameters:
provide_cfg_manually()
Allows the user to provide a configurtion file for the mux matrix. This gives the user an option, if that is convenient, to edit the configuration outside the Python environment. The file should be an 8x8 matix of bool values with a csv extension.
This funtion will stop the program execution for the user to browse and select a file.
provide_cfg_programmatically()
Allows the user to provide a configurtion file for the mux matrix. This gives the user an option, if that is convenient, to edit the configuration outside the Python environment. The file should be an 8x8 matix of bool values with a csv extension.
With this function the program execution is not stopped. The file is given as a path with filename and passed as a parameter to the function.
Parameters:
which_cfg_file()
Checks which configuration file is currently set to be read by the U1c module. This is useful since a common use case is sweeping through several connections in a run, which may be given as separate unique configuration files.
An alternative option to using multiple files is to use a single configurtion file and edit it programmatically. It is up to the user to choose their preferred method.
Returns - the path and filename of the currently defined configuration file
edit_connection_in_file(sample_num, instrument_num, new_val)
Lets the user edit data in the configuration file. This functions sets one connection only, that is from one sample to one instrument.
When running an iterative sequence the user would likely use this function twice on each iteration: once to break an existing connection after a measurement has finished, then to make the next connection to set-up for the next measurement.
Note there are 64 connections in a complete configuration. Therefore this function makes an incremental change, and does not set the complete configuration.
This function does not update the configuration held in the U1c module and does not pass the configurtion to the hardware. These require a separate action.
Parameters:
Returns - the instantaneous current draw in Ampers (float)
reset_cfg_file()
This function sets to 0 (no connection) all connections in the configuration file. This provides a quick way to bring the configuration file to a known and safe configuration. The function edits the actual file, not the data held during runtime in the U1c object variables.
fully_set_cfg_file()
This function sets to 1 (connection made) all connections in the configuration file. This provides a quick way to bring the configuration file to a known, though potentailly unsafe, configuration. The function edits the actual file, not the data held during runtime in the U1c object variables.
print_cfg_from_cfg_file()
This function prints out the configuration given in the currently used configuration file. This is useful as a check to the user before loading the configuration to the U1c software and passing it on to the hardware module.
print_current_state()
This function prints out the current configuration of the U1c module. This reflects the actual configuration of the U1c hardware.
update_state()
This function reads the desired new state of the mux matrix from the configuration file and makes the update in the U1c hardware.
The configuration file used is the one currently given to the U1c object. Prior to an 'update_state' call the file's content can be verified and edited with the auxiliary funtions given on this page.
It is important to note that the update to the hardware is done in a series of incremental steps. It is not the case that a complete existing configuration is replaced by a complete new configuration.
This means in some cases updating the state could take longer since connections are not handled simultaneously. In typical use this is not significant.
On the other hand, this gradual change provides greater safety for the sample. The series of steps, or temporary states, is calculated to first turning off (breaking) all current connections no longer needed and then turning on (making) all required connections which are presently missing. This is done to avoid undesired momentary connections.
This also means that there is no hard-coded interim state which is used on all runs. The steps depends on the initial and desired states which are only known during runtime.
connect_all()
This function connects each sample to all instruments, 64 connections in total. This makes the actual update in te U1c hardware.
disconnect_all()
This function disconnects all samples from all instruments. No active connections are left, making this a convenient safe state. This makes the actual update in te U1c hardware.