def __init__(self, board, line, trigger_source=None, scale=10.0 / 250.0): self.board = board self.line = line self.scale = scale self.trigger_source = trigger_source self.ni_task = nicontrol.AnalogOutput(self.board, self.line) self.ni_task.startTask()
def cleanupHardwareTimedMove(self): # Clean up the previous task self.ni_task.stopTask() self.ni_task.clearTask() # Create the original single-write task self.ni_task = nicontrol.AnalogOutput(self.board, self.line) self.ni_task.startTask()
def zMoveTo(self, z): try: #nicontrol.setAnalogLine(self.board, self.line, z * self.scale) voltage = z * self.scale if (voltage > 0.0) and (voltage < 10.0): self.ni_task.output(voltage) except AssertionError as e: print "Caught outputVoltage error:", type(e), str(e) self.ni_task.stopTask() self.ni_task.clearTask() self.ni_task = nicontrol.AnalogOutput(self.board, self.line) self.ni_task.startTask()
# ir laser control import sc_hardware.thorlabs.LDC210 as LDC210 # focus lock dialog. import focuslock.focusLockZ as focusLockZ # # Focus Lock Dialog Box specialized for STORM4 with # USB offset detector and MCL objective Z positioner. # import sc_hardware.nationalInstruments.nicontrol as nicontrol names = nicontrol.getDAQBoardInfo() print names ni_task = nicontrol.AnalogOutput("USB-6002", 0) ir_laser = LDC210.LDC210PWMNI("PCIe-6353", 0) #stage = MCLVZC.MCLVZControl("cDAQ-9174", 0) class AFocusLockZ(focusLockZ.FocusLockZCam): def __init__(self, hardware, parameters, parent=None): offset_file = "cam_offsets_storm5.txt" cam = uc480Cam.CameraQPD(camera_id=0, x_width=540, y_width=150, sigma=4.0, offset_file=offset_file) stage = MCLVZC.MCLVZControl("cDAQ-9174", 0) lock_fn = lambda (x): 0.02 * x