iqs.write("CONNECT LINS14") iqs.write("CONNECT LINS17") iqs.write("LINS10:INP:ATT 1 DB") iqs.write("LINS11:ROUT:SCAN 1") iqs.write("LINS12:ROUT:SCAN 1") iqs.write("LINS13:ROUT:SCAN 2") iqs.write("LINS14:ROUT:SCAN 2") iqs.write("LINS17:ROUT:SCAN 2") time.sleep(30) ### Power meter init host = "172.29.150.126" port = 1234 PM_addr = 22 prologix = Prologix(host, port) PM = HP8152A(PM_addr, prologix) #PM.write("*RST") time.sleep(1) printLog(PM.deviceID) ### test cases #Pcal=11.12 # EDFA input power Pcal = 11.05 AttList = [] #Pin=[-10, -13, -16, -19, -22, 11.3, 8.3, 5.3, 2.3,-0.7] #Gain=[10, 13, 16, 19, 22, 10, 13, 16, 19, 22] ##AGC mode Pin = [-12, 8, -26, -6] Gain = [10, 10, 24, 24]
from prologix import Prologix from ag8164b import AG8164B # ------ import 3rd part lib ------------ import numpy as np import time # -- declare vars ---------------- prologix_ip = '172.29.150.127' prologix_port = 1234 GPIB_8164 = 5 # ------ class instance ------ prologix = Prologix(prologix_ip, prologix_port) hp = AG8164B(GPIB_8164, prologix) ###################################################### def test(): hp.attValue = 0 time.sleep(3) startpower = 0 stoppower = np.floor(hp.attOutPutPower) step_number = 2 * (stoppower - startpower) + 1 outpowerarray = np.linspace(startpower, stoppower, step_number) for i in outpowerarray:
Vendor = re.findall(r"Vendor = (.+) \r\n", misc) SN = re.findall(r"Vend SN = (.+)\r\n", misc) Vendor = re.sub("\s", "", Vendor[0]) SN = re.sub("\s", "", SN[0]) curTime = datetime.utcnow().strftime("%Y%m%d%H%M") startTime = time.time() logPath = ".\\results\\{0}_{1}_{2}_{3}".format("45C_PD_EDFA2", Vendor, SN, curTime) os.mkdir(logPath) ### Power meter init host = "172.29.150.126" port = 1234 PM_addr = 22 prologix = Prologix(host, port) PM = HP8152A(PM_addr, prologix) #PM.write("*RST") time.sleep(1) printLog(PM.deviceID) ###IQS init iqs = IQS(host='172.29.150.47', port='5024', username=None, password=None) printLog(iqs.read_raw()) iqs.write("KILL LINS10") iqs.write("KILL LINS11") iqs.write("KILL LINS12") iqs.write("KILL LINS13") iqs.write("KILL LINS14") iqs.write("KILL LINS17") iqs.write("CONNECT LINS10")