f.write('RFFE'+str(rffe_numb)+'CH1 RFFE'+str(rffe_numb)+'CH2 ') f.write('\n') last_read_time = time.time() while True: format_ts = "{0:.2f}".format(last_read_time) with open(abspath+'/rffe_temp.txt', 'a') as f: f.write('\n'+str(format_ts)) for rffe_numb in rffe_range: RFFE_CONTROLLER_BOARD_IP = '10.2.117.'+str(rffe_numb) try: rffe = RFFEControllerBoard(RFFE_CONTROLLER_BOARD_IP) except (socket.error): sys.stdout.write("Unable to reach the RF front-end controller board with the IP: "+ RFFE_CONTROLLER_BOARD_IP +" through the network. " + "Skipping it...\n") continue tmp1 = "{0:.6f}".format(rffe.get_temp1()) tmp2 = "{0:.6f}".format(rffe.get_temp2()) f.write(' '+str(tmp1)+' '+str(tmp2)) print ('RFFE'+str(rffe_numb)+' temp -> CH1 ='+str(tmp1)+' CH2='+str(tmp2)) try: while time.time() - last_read_time < args.delay: sleep(1) except KeyboardInterrupt: f.close() break last_read_time = time.time()
xtalk_result.append(round(s21_testB-xtalk_tol,2)) if abs(s21_testA)<abs(xtalk_ref+xtalk_tol): xtalk_resp_resultA="Crosstalk Channel A --> FAILED" else: xtalk_resp_resultA="Crosstalk Channel A --> Ok" if abs(s21_testB)<abs(xtalk_ref+xtalk_tol): xtalk_resp_resultB="Crosstalk Channel B --> FAILED" else: xtalk_resp_resultB="Crosstalk Channel B --> Ok" else: xtalk_resp_resultA="Crosstalk Channel A --> Test not Performed" xtalk_resp_resultB="Crosstalk Channel B --> Test not Performed" #Temperature Measurement if metadata_param['temp']=="run": temperature=rffe.get_temp1() fail=0 if (temperature < 5 or temperature >100): temperature = rffe.get_temp2() if (temperature < 5 or temperature > 100): fail=1 temperature=round(temperature,2) if (temperature<temp_min or temperature>temp_max): fail=1 if (fail==1): temp_test="Temperature Measurement --> FAILED" elif (fail==0): temp_test="Temperature Measurement --> Ok" else: temp_test="Temperature Measurement --> Not Performed"
RFFE_CONTROLLER_BOARD_IP = '10.2.117.' + str(rffe_numb) try: rffe = RFFEControllerBoard(RFFE_CONTROLLER_BOARD_IP) except (socket.error): sys.stdout.write( "Unable to reach the RF front-end controller board with the IP: " + RFFE_CONTROLLER_BOARD_IP + " through the network. " + "Skipping it...\n") continue #Attenuators test for att in attenuation_values: rffe.set_attenuator_value(att) read_att = rffe.get_attenuator_value() if not read_att == att: print("Board " + RFFE_CONTROLLER_BOARD_IP + " failed in attenuator test! " + "It should return att = " + str(att) + " but got att = " + read_att) print("Board " + RFFE_CONTROLLER_BOARD_IP + " passed attenuator test! ") #Temperature reading test tmp1 = rffe.get_temp1() tmp2 = rffe.get_temp2() print("Temperature -> 1: " + str(tmp1) + ", 2: " + str(tmp2)) #Test Reset #rffe.reset() #Close connection rffe.close_connection()
attenuation_values = arange(0,32,0.5) for rffe_numb in range(33,45,1): RFFE_CONTROLLER_BOARD_IP = '10.2.117.'+str(rffe_numb) try: rffe = RFFEControllerBoard(RFFE_CONTROLLER_BOARD_IP) except (socket.error): sys.stdout.write("Unable to reach the RF front-end controller board with the IP: "+ RFFE_CONTROLLER_BOARD_IP +" through the network. " + "Skipping it...\n") continue #Attenuators test for att in attenuation_values: rffe.set_attenuator_value(att) read_att = rffe.get_attenuator_value() if not read_att == att: print ("Board "+RFFE_CONTROLLER_BOARD_IP+" failed in attenuator test! "+ "It should return att = "+str(att)+" but got att = "+read_att) print ("Board "+RFFE_CONTROLLER_BOARD_IP+" passed attenuator test! ") #Temperature reading test tmp1 = rffe.get_temp1() tmp2 = rffe.get_temp2() print ("Temperature -> 1: "+str(tmp1)+", 2: "+str(tmp2)) #Test Reset #rffe.reset() #Close connection rffe.close_connection()