Hello,
I have this script:
I need add the following to it:
if check_status == "Fail",
need to prompt the user to enter three options:
1 Re-Measure
2 Continue
3 interrupt
If you select 1, this cycle will start: from # cycle 1, from the element of the list on which the "Fail", until it "Fail" or the user chooses 2 or 3
if select 2: continue code execution
if select 3: abort and complete the code
I have this script:
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 |
acw = [ 0.500 , 0.750 , 1.000 , 1.500 , 2.000 , 3.000 , 3.500 , 4.000 , 4.500 , 5.000 ] for rang in acw: dmm.set_mode_acw(rang) dmm.switch_output( 1 ) time.sleep( 10 ) val_list_dmm = [] val_list_nom = [] for num_read in range ( 5 ): # cycle 1 val_cal = fl.read_volt_result() time.sleep( 2 ) val_src = dmm.read_data_volt() val_list_nom.append(val_src * 1000 ) val_list_dmm.append(val_cal) dmm.switch_output( 0 ) mean_meas = unc_gpi.mean_calc(val_list_dmm) mean_source = unc_gpi.mean_calc(val_list_nom) error = unc_gpi.acw_uncert(rang * 1000 ) abs_error = unc_gpi.abs_error(mean_source, mean_meas) min_error = unc_gpi.min_error(mean_source, error) max_error = unc_gpi.max_error(mean_source, error) check_status = unc_gpi.check_error(error, mean_source, mean_meas) |
if check_status == "Fail",
need to prompt the user to enter three options:
1 Re-Measure
2 Continue
3 interrupt
If you select 1, this cycle will start: from # cycle 1, from the element of the list on which the "Fail", until it "Fail" or the user chooses 2 or 3
if select 2: continue code execution
if select 3: abort and complete the code