LDC.cmd("LDON OFF;MODU OFF; RNGE LOW; SMOD CC; SIBW LOW; SYND 5") time.sleep(1) PID.cmd("TOKN ON; CONS OFF") PID.cmd("INPT INT;SETP 0.0;RAMP OFF") PID.cmd("AMAN PID;MOUT 0.0") PID.cmd("ULIM 10.0;LLIM -10.0") PID.cmd("APOL {0};GAIN {1:.4f}".format(INI_POLA, INI_PROP)) PID.cmd("INTG {0};DERV {1};OFST {2}".format(INI_INTG, INI_DERV, INI_OFST)) PID.cmd("PCTL ON;ICTL ON") PID.cmd("DCTL OFF;OCTL OFF") # (P,I,D,O)=(1,1,0,0) PID.cmd("SOUT; FPLC 50") PID.cmd("DISP EMN") if not args.noosci: OsciUSB.setup_measurement_mean(OSC, [1, 2], True, 10) time.sleep(1) except Exception as e: exit(LDC, 1, e=e) if not args.service: cin = raw_input("We are about to switch on the LASER, proceed? [yN] ") if cin is None or cin.lower() != "y": exit(LDC, 0) try: if not args.debug: LDC.cmd("SILD {0}".format(INI_LD_I)) LDC.cmd("LDON ON") time.sleep(6) LDC.cmd("MODU ON")
sleep_time_frequency_step = args.stepsleep logger.info("nfreq = " + str(frequencies_number)) logger.info("beginPower = " + str(frequencies_beginPower)) logger.info("endPower = " + str(frequencies_endPower)) """ Initialize oscilloscope for battery measurement """ while True: try: print "\n", "initializing USB instrument..." sOsci = USBTMCObject(USBInstruments['HALLE']['vendorID'], USBInstruments['HALLE']['productID'], USBInstruments['HALLE']['serialNo']) print "\tInstrument: " + str(sOsci.cmd_and_return("*IDN?")) OsciUSB.setup_measurement_mean(sOsci, channels=[1, 2], statistics=False, statistics_samples=-1) print "" break except LIB.Exceptions.USBException as e: print e time.sleep(5.0) pass """ Initialize FuncGen to feed lock in """ while args.external: try: print "\n", "initializing FUNC-GEN via socket..." sFuncGen = SocketObject(SocketInstruments['DS345_Fred']['IP'], SocketInstruments['DS345_Fred']['PORT']) print "\tInstrument: " + str(sFuncGen.cmd_and_return("*IDN?"))
else: filename_pattern_begin = 'Lab_ReadContinuous_' sleep_time_frequency_step = 1.0 # seconds if args.stepsleep and args.stepsleep >= 0: sleep_time_frequency_step = args.stepsleep """ Initialize oscilloscope for battery measurement """ while True: try: print "\n", "initializing USB instrument..." sOsci = USBTMCObject(USBInstruments['LABOR']['vendorID'], USBInstruments['LABOR']['productID'], USBInstruments['LABOR']['serialNo']) print "\tInstrument: " + str(sOsci.cmd_and_return("*IDN?")) OsciUSB.setup_acquire(sOsci, mode=args.acquire, num=args.samples) OsciUSB.setup_measurement_mean(sOsci, channels=[1, 2, 3], statistics=True, statistics_samples=10) print "" break except LIB.Exceptions.USBException as e: print e time.sleep(5.0) pass """ Initialize temperature sensor """ while True: print "\n", "initializing temperature sensor..." sTherm = GPIOSensor(GPIOSensors['THERM_LAB']) if sTherm.read() is None: continue