Jump to content
  • 0

AnalogDiscovery (1 & 2) Analog out staying high


Engineer

Question

I am working on a custom python package for the analog discovery (1 and 2). When I run the software on a computer with DWF version 2.7.5 and an original Analog Discovery it runs without issue.  However, when I run this on a different computer with DWF version 3.0+ and either Analog Discovery (1 or 2), the analog output stays high after a waveform has been run. The code is written to repeatedly output a specific waveform (sample) a number of times (numCycles) then return to zero output. Has something specifically changed in the DWF file which would result in this behavior?  Below is a code snippet:

 

        #enable analog output
        self.dwf.FDwfAnalogOutEnableSet(self.AD1, channel, c_bool(True))
        #set function to Arbitrary
        self.dwf.FDwfAnalogOutFunctionSet(self.AD1, channel, funcPlay) 
        #define output function
        self.dwf.FDwfAnalogOutDataSet(self.AD1, channel, sample, c_int(len(sample)))
        #define output frequency (Each data point represents 1 us, so f=1e6)
        self.dwf.FDwfAnalogOutFrequencySet(self.AD1, channel, c_double(frequency)) 
        #set amplitude to 5V peak
        self.dwf.FDwfAnalogOutAmplitudeSet(self.AD1, channel, c_double(5))         
        #tell system how long each cycle is 
        self.dwf.FDwfAnalogOutRunSet(self.AD1, channel, c_double(runTime))
        #tell the system how many cycles to send
        self.dwf.FDwfAnalogOutRepeatSet(self.AD1, channel, c_int(numCycles))
    
        self.dwf.FDwfAnalogOutRepeatTriggerSet(self.AD1, channel, c_int(1)) 

        #tell the AD to output data
        self.dwf.FDwfAnalogOutConfigure(self.AD1, channel, c_bool(True))

Link to comment
Share on other sites

4 answers to this question

Recommended Posts

Hi ADal,

Thanks for replying. Unfortunately I am not quite sure what you mean. I am essentially trying to implement the 'burst' feature found on most arbitrary function generators. For example, I want to emit two cycles of a sine wave and then have the analog output return to 0Vdc for one second then repeat. The code above works perfectly with DWF 2.7.5. However when DWF 3.3.7 is installed the analog out returns to ~5Vdc rather than 0V after the waveform is emitted. If the frequency of the the waveforms is high (e.g. 1MHz) then I cannot reliably programatically turn off the AWG fast enough because Windows is not a real time operating system and coded sleep functions are not accurate below 10-20 ms. It appears that for some reason the implementation of FDwfAnalogOut* was changed in 3.37 so that the default 'Ready' state sets the analog voltage to some value other than 0.0V, which is completely illogical. 

 

Link to comment
Share on other sites

Archived

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

×
×
  • Create New...