diff --git a/test_measure_with_ohmpi_card_3_15.py b/test_measure_with_ohmpi_card_3_15.py index 6c012876d36535d3fd5856e907790c80de16d7f5..e9251e5b4f252cf215b6ccde2b00a85ae0d375d2 100644 --- a/test_measure_with_ohmpi_card_3_15.py +++ b/test_measure_with_ohmpi_card_3_15.py @@ -10,10 +10,6 @@ from OhmPi.hardware_system import OhmPiHardware k = OhmPiHardware() k.exec_logger.setLevel(logging.INFO) -# Test mux switching -k.reset_mux() -k.switch_mux(electrodes=[9,10,11,12], roles=['A', 'B', 'M', 'N'], state='on') - # Test _vab_pulse: print('Testing positive _vab_pulse') k._vab_pulse(vab=12, length=1., sampling_rate=k.rx.sampling_rate, polarity=1) @@ -55,7 +51,5 @@ r = [np.abs((k.pulses[i]['polarity']*k.pulses[i]['vmn']-k.sp)/k.pulses[i]['iab'] for i in range(len(r)): print(f'Mean resistance with sp correction for pulse{i}: {np.mean(r[i]):.3f} Ohms, Dev. {100*np.std(r[i])/np.mean(r[i]):.1f} %') -k.switch_mux(electrodes=[9,10,11,12], roles=['A', 'B', 'M', 'N'], state='off') -k.reset_mux() change_config('config_default.py', verbose=False) diff --git a/test_mux_2024.py b/test_mux_2024.py index 0b166f679cb80b79377fa39fcf8375cf5c6a2456..fe159104ab762df5c7b484bd107418bd578406fb 100644 --- a/test_mux_2024.py +++ b/test_mux_2024.py @@ -1,9 +1,12 @@ import time from utils import change_config +import logging change_config('config_mb_2023_mux_2024.py', verbose=False) from OhmPi.hardware_components.mux_2024_rev_0_0 import Mux, MUX_CONFIG from OhmPi.hardware_components import raspberry_pi as controller_module + +# Stand alone mux MUX_CONFIG['controller'] = controller_module.Controller() MUX_CONFIG['id'] = 'mux_1' MUX_CONFIG['default_mux_cabling'] = {(i+8, j) : ('mux_1', i) for j in ['A', 'B', 'M', 'N'] for i in range(1,9)} @@ -17,4 +20,20 @@ time.sleep(8) mux.reset() mux.test({'A': [9, 10, 11, 12, 13, 14, 15, 16], 'B': [9, 10, 11, 12, 13, 14, 15, 16], 'M': [9, 10, 11, 12, 13, 14, 15, 16], 'N': [9, 10, 11, 12, 13, 14, 15, 16]}) -change_config('config_default.py', verbose=False) + +# mux as part of a OhmPiHardware system + +from utils import change_config +change_config('config_mb_2023_mux_2024.py', verbose=False) +from OhmPi.hardware_system import OhmPiHardware + +print('Starting test of mux as part of a OhmPiHardware system.') +k = OhmPiHardware() +k.exec_logger.setLevel(logging.INFO) + +# Test mux switching +k.reset_mux() +k.switch_mux(electrodes=[9,10,11,12], roles=['A', 'B', 'M', 'N'], state='on') +time.sleep(1.) +k.switch_mux(electrodes=[9,10,11,12], roles=['A', 'B', 'M', 'N'], state='off') +change_config('config_default.py', verbose=False) \ No newline at end of file