Jump to content
  • 0

AnalogDiscovery: TriggerLengthSet changes TriggerLevel


Engineer

Question

Hi,

I am having a trigger issue with the AnalogDiscovery (1 and 2) running DWF version 3.3.7. I set the analog in trigger threshold to a double value between 0.1 and 5.0 V [self.dwf.FDwfAnalogInTriggerLevelSet(self.AD1, self.input_trigger_voltage)] then I set the analog in trigger length to 1 microsecond [ self.dwf.FDwfAnalogInTriggerLengthSet(self.AD1, c_double(0.000001)) ] and configure the device. 

Then when I run diagnostics to check these values the analog discover returns a trigger length and a trigger voltage of 0.000001.  Is there a reason why ...TriggerLengthSet is affecting the trigger voltage?

 

::configuration of AnalogIn::
        #set up acquisition
        self.dwf.FDwfAnalogInFrequencySet(self.AD1, c_double(self.frequency))
        self.dwf.FDwfAnalogInBufferSizeSet(self.AD1, c_int(self.bufferSize))
        #enable both channels
        self.dwf.FDwfAnalogInChannelEnableSet(self.AD1, c_int(0), c_bool(True))
        self.dwf.FDwfAnalogInChannelEnableSet(self.AD1, c_int(1), c_bool(True))
        #set input range on both channels
        self.dwf.FDwfAnalogInChannelRangeSet(self.AD1, c_int(0), self.input_range)
        self.dwf.FDwfAnalogInChannelRangeSet(self.AD1, c_int(1), self.input_range)
        #self.dwf.FDwfAnalogInChannelRangeSet(self.AD1, self.input_channel, self.input_range)

        #set up the acquisition mode
        self.dwf.FDwfAnalogInAcquisitionModeSet(self.AD1, acqmodeSingle) #single buffer acquisition
        #set up trigger
        self.dwf.FDwfAnalogInTriggerSourceSet(self.AD1, trigsrcDetectorAnalogIn) #one of the analog channels
        self.dwf.FDwfAnalogInTriggerChannelSet(self.AD1, self.trigger_channel) #set the trigger channel
        self.dwf.FDwfAnalogInTriggerAutoTimeoutSet(self.AD1, c_double(0)) #disable auto trigger
        self.dwf.FDwfAnalogInTriggerTypeSet(self.AD1, trigtypeEdge) #set the trigger method to edge detect
        self.dwf.FDwfAnalogInTriggerConditionSet(self.AD1, trigcondRisingPositive) #set condition to rising edge
        self.dwf.FDwfAnalogInTriggerFilterSet(self.AD1, filterDecimate) #look for trigger on each ADC conversion
        self.dwf.FDwfAnalogInTriggerLengthConditionSet(self.AD1, triglenLess)
        self.dwf.FDwfAnalogInTriggerLengthSet(self.AD1, c_double(0.000001)) #for some reason this is changing the trigger level
        self.dwf.FDwfAnalogInTriggerLevelSet(self.AD1, self.input_trigger_voltage)
 

::Analog in Diagnostics::
        dwTriggerLevel = c_double()
        self.dwf.FDwfAnalogInTriggerLevelGet(self.AD1, byref(dwTriggerLevel))
        print("The trigger is set at " + str(dwTriggerLength.value) + "[V]")


        dwTriggerLength = c_double()
        self.dwf.FDwfAnalogInTriggerLengthGet(self.AD1, byref(dwTriggerLength))
        print("The analog trigger length is: " + str(dwTriggerLength.value))

Link to comment
Share on other sites

1 answer to this question

Recommended Posts

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...