• 0

Possible to control timing of pulse (AWG) and aquire (OSC) windows using SDK?


Go to solution Solved by attila,

Question

Hi All

Is it possible to control the relative timings of pulses and aquisitions using the SDK? I've not seen anything explicit in the SDK yet but I may be missing something fairly obvious (I'm new!). I'd like to get precise pauses between actions on time scales as short as 1 ms. For example:

[200 ms sin pulse] [pause of (possibly as short as) 1 ms] [open scope channel]

I considered using python's time.sleep() funciton but it looks like ~15 ms is the quickest pause it can consistently do so I'd like to do it in-hardware rather than in-software.

Thanks for your thoughts!

Jason

Edited by Jason
Link to post
Share on other sites

11 answers to this question

Recommended Posts

  • 1
  • Solution

I suppose you want [200ms signal generation][1ms delay][Xms acquisition interval][200ms signal][1ms ...

See the comments in the following code.

 

 

from ctypes import *
import time
import sys
import matplotlib.pyplot as plt

if sys.platform.startswith("win"):
    dwf = cdll.dwf
elif sys.platform.startswith("darwin"):
    dwf = cdll.LoadLibrary("libdwf.dylib")
else:
    dwf = cdll.LoadLibrary("libdwf.so")


print "Opening first available device"
hdwf = c_int()
dwf.FDwfDeviceOpen(c_int(-1), byref(hdwf))

if hdwf.value == 0:
    print "failed to open device"
    quit()

# To generate burst signals with AnalogOut (Wavegen) you can use the wait, run and repeat options.
# The 1ms delay + the acquisition time is covered by the wait parameter.

samples = 1000
rate = 1000000
delay = 0.001
X = 1.0*samples/rate
run = 0.2
print "wait: "+str(delay+X)+"sec"
print "run: "+str(run)+"sec"
print "acquisition: "+str(X)+"sec"
dwf.FDwfAnalogOutEnableSet(hdwf, c_int(0), c_int(1))
dwf.FDwfAnalogOutFunctionSet(hdwf, c_int(0), c_int(1)) #sine
dwf.FDwfAnalogOutFrequencySet(hdwf, c_int(0), c_double(1000))
dwf.FDwfAnalogOutWaitSet(hdwf, c_int(0), c_double(delay+X))
dwf.FDwfAnalogOutRunSet(hdwf, 0, c_double(run))  
dwf.FDwfAnalogOutRepeatSet(hdwf, c_int(0), c_int(0))  # infinite repeat
dwf.FDwfAnalogOutConfigure(hdwf, c_int(0), c_int(1))

# The AnalogIn trigger position is relative to the middle of the sample buffer. 
# The trigger event is the AnalogOut signal generation start, Run phase start.
trigdelay = run+delay+X/2
dwf.FDwfAnalogInChannelRangeSet(hdwf, c_int(-1), c_double(4))
dwf.FDwfAnalogInBufferSizeSet(hdwf, c_int(samples))
dwf.FDwfAnalogInFrequencySet(hdwf, c_double(rate))
dwf.FDwfAnalogInTriggerSourceSet(hdwf, c_int(7)) #trigsrcAnalogOut1
dwf.FDwfAnalogInTriggerPositionSet(hdwf, c_double(trigdelay))

print "Wait after first device opening the analog in offset to stabilize"
time.sleep(2)

rgData = (c_double*samples)()

sts = c_int()

for it in range(0,5):
   dwf.FDwfAnalogInConfigure(hdwf, c_int(1), c_int(1))
   while True:
      dwf.FDwfAnalogInStatus(hdwf, c_int(1), byref(sts))
      # done
      if sts.value == 2 :
         break

   dwf.FDwfAnalogInStatusData(hdwf, c_int(0), rgData, c_int(samples))
   rgpy=[0.0]*len(rgData)
   for i in range(0,len(rgpy)):
      rgpy[i]=rgData[i]

   plt.plot(rgpy)
   plt.show()
   
dwf.FDwfDeviceCloseAll()

Link to post
Share on other sites
  • 1

The digital IOs output 0/3.3V 
Example:
# set output enable, mask on 2 LSB IOs, DIO 1 and 0
dwf.FDwfDigitalIOOutputEnableSet(hdwf, c_int(0x0003))
# set output value, DIO 1: 0V, DIO 0: 3.3V
dwf.FDwfDigitalIOOutputSet(hdwf, c_int(0x0001)) 
# not enabled pins will remain high impedance, DIO 15 to 2: Z

Turn on the +5V power supply of Analog Discovery:
# master enable
dwf.FDwfAnalogIOEnableSet(hdwf, c_int(1))
# enable positive supply
dwf.FDwfAnalogIOChannelNodeSet(hdwf, c_int(0), c_int(0), c_int(1)) 

Link to post
Share on other sites
  • 1

In the earlier code the AnalogIn captured only after every second AnalogOut burst.

Yes, 0x0001 = b0000000000000001

DigitalIO is only to write/read IO states. DigitalIn is for logic analyzer and DigitalOut for pattern generator

 

In the following code the DigitalOut is used to control the AnalogOut/In. These wait to be triggered by DigitalOut:

DigitalOut:        |[1ms run DIO#0 high][200+1ms wait DIO#0 low]|...
AnalogOut:  [armed]|[1ms wait          ][200ms run      ][armed]|...
AnalogIn:   [armed]|[1ms acquisition   ][data to PC ][armed    ]|...


 

from ctypes import *
import time
import sys
import matplotlib.pyplot as plt

if sys.platform.startswith("win"):
    dwf = cdll.dwf
elif sys.platform.startswith("darwin"):
    dwf = cdll.LoadLibrary("libdwf.dylib")
else:
    dwf = cdll.LoadLibrary("libdwf.so")


print "Opening first available device"
hdwf = c_int()
dwf.FDwfDeviceOpen(c_int(-1), byref(hdwf))

if hdwf.value == 0:
    print "failed to open device"
    quit()


samples = 1000
rate = 1000000
delay = 0.001
acquisition = 1.0*samples/rate
run = 0.2

print "wait: "+str(delay+acquisition)+"sec"
print "run: "+str(run)+"sec"
print "acquisition: "+str(acquisition)+"sec"

# DigitalOut controls the AnalogOut/In, these wait for trigger
dwf.FDwfDigitalOutWaitSet(hdwf, c_double(run+delay))
dwf.FDwfDigitalOutRunSet(hdwf, c_double(acquisition))  
dwf.FDwfDigitalOutRepeatSet(hdwf, c_int(0))  # infinite repeat
# DIO#0 high while running otherwise low
dwf.FDwfDigitalOutEnableSet(hdwf, c_int(0), c_int(1))
dwf.FDwfDigitalOutIdleSet(hdwf, c_int(0), c_int(1)) # DwfDigitalOutIdleLow
dwf.FDwfDigitalOutCounterInitSet(hdwf, c_int(0), c_int(1), c_int(1)) # initial value high
dwf.FDwfDigitalOutCounterSet(hdwf, c_int(0), c_int(0), c_int(0)) # invalid low/high counts will hold the initial value

# AnalogOut 
dwf.FDwfAnalogOutEnableSet(hdwf, c_int(0), c_int(1))
dwf.FDwfAnalogOutFunctionSet(hdwf, c_int(0), c_int(1)) # sine
dwf.FDwfAnalogOutFrequencySet(hdwf, c_int(0), c_double(1000))
dwf.FDwfAnalogOutTriggerSourceSet(hdwf, c_int(0), c_int(6)) # trigsrcDigitalOut
dwf.FDwfAnalogOutWaitSet(hdwf, c_int(0), c_double(acquisition))
dwf.FDwfAnalogOutRunSet(hdwf, 0, c_double(run))
dwf.FDwfAnalogOutRepeatSet(hdwf, c_int(0), c_int(0))  # infinite repeat
dwf.FDwfAnalogOutRepeatTriggerSet(hdwf, c_int(0), c_int(1)) # wait for trigger event on each repeat
dwf.FDwfAnalogOutConfigure(hdwf, c_int(0), c_int(1))

# The AnalogIn trigger position is relative to the middle of the sample buffer. 
# The trigger event is the DigitalOut signal generation start, Run phase start.
trigdelay = acquisition/2
dwf.FDwfAnalogInChannelRangeSet(hdwf, c_int(-1), c_double(4))
dwf.FDwfAnalogInBufferSizeSet(hdwf, c_int(samples))
dwf.FDwfAnalogInFrequencySet(hdwf, c_double(rate))
dwf.FDwfAnalogInTriggerSourceSet(hdwf, c_int(6)) #trigsrcDigitalOut
dwf.FDwfAnalogInTriggerPositionSet(hdwf, c_double(trigdelay))


print "Wait after first device opening the analog in offset to stabilize"
time.sleep(2)

rgData = (c_double*samples)()
sts = c_int()
dwf.FDwfDigitalOutConfigure(hdwf, c_int(1))

while True:
   dwf.FDwfAnalogInConfigure(hdwf, c_int(1), c_int(1))
   while True:
      dwf.FDwfAnalogInStatus(hdwf, c_int(1), byref(sts))
      # done
      if sts.value == 2 :
         break

   # dwf.FDwfAnalogInStatusData(hdwf, c_int(0), rgData, c_int(samples))
   # rgpy=[0.0]*len(rgData)
   # for i in range(0,len(rgpy)):
      # rgpy[i]=rgData[i]

   # plt.plot(rgpy)
   # plt.show()
   
dwf.FDwfDeviceCloseAll()
 

asd2.png

asd1.png

Edited by attila
Link to post
Share on other sites
  • 1

Hello,

from ctypes import *
import time
import sys
import matplotlib.pyplot as plt

if sys.platform.startswith("win"):
    dwf = cdll.dwf
elif sys.platform.startswith("darwin"):
    dwf = cdll.LoadLibrary("libdwf.dylib")
else:
    dwf = cdll.LoadLibrary("libdwf.so")


print "Opening first available device"
hdwf = c_int()
dwf.FDwfDeviceOpen(c_int(-1), byref(hdwf))

if hdwf.value == 0:
    print "failed to open device"
    quit()

pulse = 2
wait = 1
acquire = 2

samples = 8000
rate = 1.0*samples/acquire

print "pulse: "+str(pulse)+"sec"
print "wait: "+str(wait)+"sec"
print "acquire: "+str(acquire)+"sec"
print "samples/rate: "+str(samples)+"/"+str(rate)+"Hz"

# DigitalOut 
# controls the AnalogOut/In, these wait for trigger
# run once pulsing the DIO0,1,2 signals
dwf.FDwfDigitalOutRunSet(hdwf, c_double(pulse+wait+acquire))  
dwf.FDwfDigitalOutRepeatSet(hdwf, c_int(1))  # repeat once
for i in range(0,3):
    dwf.FDwfDigitalOutEnableSet(hdwf, c_int(i), c_int(1)) # enable digital output 0
    dwf.FDwfDigitalOutIdleSet(hdwf, c_int(i), c_int(1)) # DwfDigitalOutIdleLow  
    dwf.FDwfDigitalOutDividerSet(hdwf, c_int(i), c_int(100000000)) # 100Mhz / 1e8 = 1Hz counter rate

#DIO0: pulse  ______ _______
#DIO1: ______  wait  _______
#DIO2: ______ ______ acquire
dwf.FDwfDigitalOutCounterInitSet(hdwf, c_int(0), c_int(1), c_int(pulse)) # DIO0: initial value high, pulse length
dwf.FDwfDigitalOutCounterSet(hdwf, c_int(0), c_int(10), c_int(10)) #  low/high counts are longer than run
dwf.FDwfDigitalOutCounterInitSet(hdwf, c_int(1), c_int(0), c_int(pulse)) # DIO1: initial value low, pulse length
dwf.FDwfDigitalOutCounterSet(hdwf, c_int(1), c_int(10), c_int(wait)) #  low/high counts
dwf.FDwfDigitalOutCounterInitSet(hdwf, c_int(2), c_int(0), c_int(pulse+wait)) # DIO2: initial value low, pulse+wait length
dwf.FDwfDigitalOutCounterSet(hdwf, c_int(2), c_int(10), c_int(acquire)) #  low/high counts

# AnalogOut 0
# run once pulse length time after digital out starts
dwf.FDwfAnalogOutEnableSet(hdwf, c_int(0), c_int(1))
dwf.FDwfAnalogOutFunctionSet(hdwf, c_int(0), c_int(1)) # sine
dwf.FDwfAnalogOutFrequencySet(hdwf, c_int(0), c_double(10)) # 10Hz
dwf.FDwfAnalogOutTriggerSourceSet(hdwf, c_int(0), c_int(6)) # trigsrcDigitalOut
dwf.FDwfAnalogOutRunSet(hdwf, c_int(0), c_double(pulse))
dwf.FDwfAnalogOutRepeatSet(hdwf, c_int(0), c_int(1))  # repeat once
dwf.FDwfAnalogOutConfigure(hdwf, c_int(0), c_int(1))

# AnalogOut 1
# run pulse+wait+acquire time after digital out starts
dwf.FDwfAnalogOutEnableSet(hdwf, c_int(1), c_int(1))
dwf.FDwfAnalogOutFunctionSet(hdwf, c_int(1), c_int(1)) # sine
dwf.FDwfAnalogOutFrequencySet(hdwf, c_int(1), c_double(0.5)) # 0.5Hz
dwf.FDwfAnalogOutTriggerSourceSet(hdwf, c_int(1), c_int(6)) # trigsrcDigitalOut
dwf.FDwfAnalogOutRunSet(hdwf, c_int(1), c_double(pulse+wait+acquire))
dwf.FDwfAnalogOutRepeatSet(hdwf, c_int(1), c_int(1))
dwf.FDwfAnalogOutConfigure(hdwf, c_int(1), c_int(1))

# The AnalogIn trigger position is relative to the middle of the sample buffer. 
# The trigger event is the DigitalOut signal generation start, Run phase start.
dwf.FDwfAnalogInChannelRangeSet(hdwf, c_int(-1), c_double(4))
dwf.FDwfAnalogInBufferSizeSet(hdwf, c_int(samples))
dwf.FDwfAnalogInFrequencySet(hdwf, c_double(rate))
dwf.FDwfAnalogInTriggerSourceSet(hdwf, c_int(6)) #trigsrcDigitalOut
dwf.FDwfAnalogInTriggerPositionSet(hdwf, c_double(pulse+wait+acquire/2))
dwf.FDwfAnalogInConfigure(hdwf, c_int(1), c_int(1))

print "Wait after first device opening the analog in offset to stabilize"
time.sleep(2)

rgData = (c_double*samples)()
sts = c_int()
dwf.FDwfDigitalOutConfigure(hdwf, c_int(1))

while True:
  dwf.FDwfAnalogInStatus(hdwf, c_int(1), byref(sts))
  # done
  if sts.value == 2 :
     break

dwf.FDwfAnalogInStatusData(hdwf, c_int(0), rgData, c_int(samples))
rgpy=[0.0]*len(rgData)
for i in range(0,len(rgpy)):
  rgpy[i]=rgData[i]

plt.plot(rgpy)
plt.show()
   
dwf.FDwfDeviceCloseAll()

 

asd3.png

Edited by attila
Link to post
Share on other sites
  • 0

wow, thanks for the quick response :). That certainly answers my question and the code works great. I have another question if I may? The digital IO pins.. is it possible to control them individually? E.g. just to turn one pin on at the start of the program and leave it running? Would it be at 5V?

Link to post
Share on other sites
  • 0

Thanks attila. Can the digital IOs be triggered in the same way as the scope? For instance, in the example code you gave above, can a pin be triggered to come on at the same time as the scope? Trawling through the SDK manual the digital IOs appear not to have any trigger functions whereas the DigitalIn and the DigitalOut (pattern generator) do, is this right?

I'm sorry I didnt quite follow how the HEX above translated into turning DIO 0 on... presumably it translates to something like 0000000000000001 across the 16 pins?

Link to post
Share on other sites
  • 0

Hi Attila

Thanks for your help with this. I've been playing around with the code you sent and I've learnt a lot from it but I haven't yet been able to bend it quite to my will. Below is a timing diagram for what I'm trying to achieve. I don't want the pattern to repeat. Simply execute the pattern below once. i.e. 'Pulse' 'Wait' 'Acquire' followed by a plot and all outputs going low. Can you help me with this? Thanks again!

 

      Pulse (2seconds) Wait (1second) Aquire (2seconds) 
  Instrument #          
  DigitalOut(or DigitalIO) 0 ++++++++ +++++++      
  DigitalOut(or DigitalIO) 1     ++++++++++++++    
  DigitalOut(or DigitalIO)  2       ++++++++++++++  
  AnalogOut 0 ++++++++ +++++++      
  AnalogIn 0       ++++++++++++++  
               
Bonus: AnalogOut 1 ++++++++ Runs the whole time+++++++ ++++++++++++++  
Edited by Jason
Link to post
Share on other sites
  • 0

Thank you this is great! Am I limited with this method to how short a duration I can run? for example, if I set 'pulse' to 0.02 (say), I receive an error message: 

   dwf.FDwfDigitalOutCounterInitSet(hdwf, c_int(0), c_int(1), c_int(pulse)) # DIO0: initial value high, pulse length

TypeError: int expected instead of float

Is there a way to address this so that pulse, wait and acquire can be as short as 1 ms?

Link to post
Share on other sites
  • 0

For instance the digital out divider can be reduced to generate 1kHz rate for the counter and low/high length adjusted to 1ms periods:

...
pulse = 0.02
wait = 0.001
acquire = 0.001
...
for i in range(0,3):
...
    dwf.FDwfDigitalOutDividerSet(hdwf, c_int(i), c_int(100000)) # 100Mhz / 1e6 = 1kHz counter rate, 1ms period
...
dwf.FDwfDigitalOutCounterInitSet(hdwf, c_int(0), c_int(1), c_int(int(round(pulse*1000)))) # DIO0: initial value high, pulse length
dwf.FDwfDigitalOutCounterSet(hdwf, c_int(0), c_int(10*1000), c_int(10*1000)) #  low/high counts are longer than run
dwf.FDwfDigitalOutCounterInitSet(hdwf, c_int(1), c_int(0), c_int(int(round(pulse*1000)))) # DIO1: initial value low, pulse length
dwf.FDwfDigitalOutCounterSet(hdwf, c_int(1), c_int(10*1000), c_int(int(round(wait*1000)))) #  low/high counts
dwf.FDwfDigitalOutCounterInitSet(hdwf, c_int(2), c_int(0), c_int(int(round((pulse+wait)*1000)))) # DIO2: initial value low, pulse+wait length
dwf.FDwfDigitalOutCounterSet(hdwf, c_int(2), c_int(10*1000), c_int(int(round(acquire*1000)))) #  low/high counts
...

 

Edited by attila
Link to post
Share on other sites
  • 0

Is there any reason why my number of samples would be limited with this code? The max samples I can set is 8192 (over 0.1 sec acquisition). After that the list in rgpy fills with zeros.

I need a sample rate of 2 x 64KHz = 128KHz. The current issue limits me to 81KHz.

 

from ctypes import *
import time
import sys
import matplotlib.pyplot as plt

if sys.platform.startswith("win"):
dwf = cdll.dwf
elif sys.platform.startswith("darwin"):
dwf = cdll.LoadLibrary("libdwf.dylib")
else:
dwf = cdll.LoadLibrary("libdwf.so")


print "Opening first available device"
hdwf = c_int()
dwf.FDwfDeviceOpen(c_int(-1), byref(hdwf))

if hdwf.value == 0:
print "failed to open device"
quit()

pulse = 0.5
wait = .01
acquire = .1

samples = 8192
rate = 1.0*samples/acquire

print "pulse: "+str(pulse)+"sec"
print "wait: "+str(wait)+"sec"
print "acquire: "+str(acquire)+"sec"
print "samples/rate: "+str(samples)+"/"+str(rate)+"Hz"

# DigitalOut
# controls the AnalogOut/In, these wait for trigger
# run once pulsing the DIO0,1,2 signals
dwf.FDwfDigitalOutRunSet(hdwf, c_double(pulse+wait+acquire))
dwf.FDwfDigitalOutRepeatSet(hdwf, c_int(1)) # repeat once
for i in range(0,3):
dwf.FDwfDigitalOutEnableSet(hdwf, c_int(i), c_int(1)) # enable digital output 0
dwf.FDwfDigitalOutIdleSet(hdwf, c_int(i), c_int(1)) # DwfDigitalOutIdleLow
dwf.FDwfDigitalOutDividerSet(hdwf, c_int(i), c_int(100000)) # 100Mhz / 1e6 = 1kHz counter rate, 1ms period

#DIO0: pulse ______ _______
#DIO1: ______ wait _______
#DIO2: ______ ______ acquire

dwf.FDwfDigitalOutCounterInitSet(hdwf, c_int(0), c_int(1), c_int(int(round(pulse*1000)))) # DIO0: initial value high, pulse length
dwf.FDwfDigitalOutCounterSet(hdwf, c_int(0), c_int(10*1000), c_int(10*1000)) # low/high counts are longer than run
dwf.FDwfDigitalOutCounterInitSet(hdwf, c_int(1), c_int(0), c_int(int(round(pulse*1000)))) # DIO1: initial value low, pulse length
dwf.FDwfDigitalOutCounterSet(hdwf, c_int(1), c_int(10*1000), c_int(int(round(wait*1000)))) # low/high counts
dwf.FDwfDigitalOutCounterInitSet(hdwf, c_int(2), c_int(0), c_int(int(round((pulse+wait)*1000)))) # DIO2: initial value low, pulse+wait length
dwf.FDwfDigitalOutCounterSet(hdwf, c_int(2), c_int(10*1000), c_int(int(round(acquire*1000)))) # low/high counts

# AnalogOut 0
# run once pulse length time after digital out starts
dwf.FDwfAnalogOutEnableSet(hdwf, c_int(0), c_int(1))
dwf.FDwfAnalogOutFunctionSet(hdwf, c_int(0), c_int(1)) # sine
dwf.FDwfAnalogOutFrequencySet(hdwf, c_int(0), c_double(64000)) # 10Hz
dwf.FDwfAnalogOutAmplitudeSet(hdwf, c_int(0), c_double(0.02))
dwf.FDwfAnalogOutTriggerSourceSet(hdwf, c_int(0), c_int(6)) # trigsrcDigitalOut
dwf.FDwfAnalogOutRunSet(hdwf, c_int(0), c_double(pulse))
dwf.FDwfAnalogOutRepeatSet(hdwf, c_int(0), c_int(1)) # repeat once
dwf.FDwfAnalogOutConfigure(hdwf, c_int(0), c_int(1))

# AnalogOut 1
# run pulse+wait+acquire time after digital out starts
dwf.FDwfAnalogOutEnableSet(hdwf, c_int(1), c_int(1))
dwf.FDwfAnalogOutFunctionSet(hdwf, c_int(1), c_int(3)) # sine
dwf.FDwfAnalogOutFrequencySet(hdwf, c_int(1), c_double(58500)) # 0.5Hz
dwf.FDwfAnalogOutAmplitudeSet(hdwf, c_int(1), c_double(2))
dwf.FDwfAnalogOutTriggerSourceSet(hdwf, c_int(1), c_int(6)) # trigsrcDigitalOut
dwf.FDwfAnalogOutRunSet(hdwf, c_int(1), c_double(pulse+wait+acquire))
dwf.FDwfAnalogOutRepeatSet(hdwf, c_int(1), c_int(1))
dwf.FDwfAnalogOutConfigure(hdwf, c_int(1), c_int(1))

# The AnalogIn trigger position is relative to the middle of the sample buffer.
# The trigger event is the AnalogOut signal generation start, Run phase start.
dwf.FDwfAnalogInChannelRangeSet(hdwf, c_int(-1), c_double(5)) #4 volt range
dwf.FDwfAnalogInBufferSizeSet(hdwf, c_int(samples))
dwf.FDwfAnalogInFrequencySet(hdwf, c_double(rate))
dwf.FDwfAnalogInTriggerSourceSet(hdwf, c_int(6)) #trigsrcDigitalOut
dwf.FDwfAnalogInTriggerPositionSet(hdwf, c_double(pulse+wait+(acquire/2)))
#dwf.FDwfAnalogInTriggerPositionSet(hdwf, c_double(pulse/2)) #TRIGGERPOS
dwf.FDwfAnalogInConfigure(hdwf, c_int(1), c_int(1))

print "Wait after first device opening the analog in offset to stabilize"
time.sleep(1)

rgData = (c_double*samples)()
sts = c_int()
dwf.FDwfDigitalOutConfigure(hdwf, c_int(1))

while True:
dwf.FDwfAnalogInStatus(hdwf, c_int(1), byref(sts))
# done
if sts.value == 2 :
break

dwf.FDwfAnalogInStatusData(hdwf, c_int(0), rgData, c_int(samples))
rgpy=[0.0]*len(rgData)
for i in range(0,len(rgpy)):
rgpy=rgData
 
plt.plot(rgpy)
plt.show()
 
dwf.FDwfDeviceCloseAll()

 

Edited by Jason
Link to post
Share on other sites
  • 0

The analog in device buffer size is 8192 samples for each channel. The single buffer acquisition is limited to this size. To acquire more data you can use the record mode. The rate of this is limited by USB transfer at about 1Msps.

What do you mean by 2x64kHz? 
Do you want to acquire at 64kHz on 2 channels?
In this case for 100ms span set 6400 samples and read the data for each channel, like:
...
dwf.FDwfAnalogInStatusData(hdwf, c_int(0), rgData0, c_int(samples))
...
dwf.FDwfAnalogInStatusData(hdwf, c_int(1), rgData1, c_int(samples))
...

Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now