示例#1
0
    def setup(self, kinetic_cycle_time):
        #
        # the counter runs slightly faster than the camera so that it is ready
        # to catch the next camera "fire" immediately after the end of the cycle.
        #
        frequency = (1.001/kinetic_cycle_time) * float(self.oversampling)

        # set up the analog channels
        self.ao_task = nicontrol.WaveformOutput(self.board, 0)
        for i in range(self.number_channels - 1):
            self.ao_task.addChannel(i + 1)

        # set up the digital channels
        self.do_task = nicontrol.DigitalWaveformOutput(self.board, 0)
        for i in range(self.number_channels - 1):
            self.do_task.addChannel(self.board, i + 1)

        # set up the waveforms
        self.ao_task.setWaveform(self.waveforms, frequency)
        self.do_task.setWaveform(self.waveforms, frequency)

        # set up the counter
        self.ct_task = True
        self.ct_task = nicontrol.CounterOutput(self.board, 0, frequency, 0.5)
        self.ct_task.setCounter(self.waveform_len)
        self.ct_task.setTrigger(0)
示例#2
0
    def setup(self):
        assert self.ct_task == 0, "Attempt to call setup without first calling cleanup."
        #
        # the counter runs slightly faster than the camera so that it is ready
        # to catch the next camera "fire" immediately after the end of the cycle.
        #
        frequency = (1.001/self.kinetic_value) * float(self.oversampling)

        # set up the analog channels
        self.wv_task = nicontrol.WaveformOutput(self.board, 0)
        for i in range(self.number_channels - 1):
            self.wv_task.addChannel(i + 1)

        # set up the waveform
        self.wv_task.setWaveform(self.waveforms, frequency)

        # set up the counter
        self.ct_task = nicontrol.CounterOutput(self.board, 0, frequency, 0.5)
        self.ct_task.setCounter(self.waveform_len)
        self.ct_task.setTrigger(0)
示例#3
0
    def __init__(self, parent=None):
        QAOTFThread.__init__(self, parent)

        import aaopto.AOTF as AOTF
        self.aotf = AOTF.AOTF()
        if not (self.aotf.getStatus()):
            self.aotf = 0

        # The AOTF is set up (on STORM2) to use a wacky analog/
        # digital counter control scheme when in analog or
        # "use shutters mode". We try and hide those differences
        # from the user here.
        import nationalInstruments.nicontrol as nicontrol

        # set up re-triggerable single shot counters to drive the AOTF.
        ctr_info = [
            ["PCIe-6259", 0, "PCIe-6259", 12],  # 568
            ["PCIe-6259", 1, "PCIe-6259", 13],  # 488
            ["PCI-6713", 0, "PCIe-6259", 14]
        ]  # 457
        self.ctr_tasks = []
        for info in ctr_info:
            ctr_task = nicontrol.CounterOutput(info[0], info[1], 60.0, 0.999)
            ctr_task.setTrigger(info[3], board=info[2])
            self.ctr_tasks.append(ctr_task)

        # setup analog modulation
        ana_info = [
            ["PCI-6713", 0],  # 568
            ["PCI-6713", 1],  # 488
            ["PCI-6713", 2]
        ]  # 457
        self.ana_tasks = []
        for info in ana_info:
            ana_task = nicontrol.VoltageOutput(info[0],
                                               info[1],
                                               min_val=-0.01,
                                               max_val=5.01)
            self.ana_tasks.append(ana_task)