• Content Count

  • Joined

  • Last visited

  1. Hello, I have a python script to output a signal while recording from both input channels at the same time. I want to incorporate using a second analog discovery for two additional channels of data acquisition. From the device_enumerate.py, I see that both devices can be recognized in the same script, but how do I actually specify which device to record the data from? For example, here are some current (relevant) code snippets where I acquire data from both channels of one device. How would I specify the second device channels. ... "Opening first device..." dwf.FDwfDev
  2. Hello, I was looking at the AnalogIn_Acquisition.py example. This is a good base for what I want. The goal is to iterate through a list, and average the output (rgpy in example) at each iteration, and store this in a list. However, I when I try nesting the functions inside lists, it doesn't appear to be reacquiring data. How do the AnalogInConfigure and Status work, and how could I acquire data in a loop? Thanks! for ii in range(0,5): #set up acquisition dwf.FDwfAnalogInFrequencySet(hdwf, c_double(20000000.0)) dwf.FDwfAnalogInBufferSizeSet(hdwf, c_int
  3. Hi atilla, it turns out my scope wasn't sensitive enough to see the quick pulses. It looks like it is working okay now though! Is there any way to use the scope feature of the Analog Discovery while controlling it via python. Based on what I've seen you can only interface with it one way at a time, but I was wondering if there are any work arounds to use the GUI scope feature while running python scripts? Thanks for all the help and timely responses.
  4. I want to iterate through this single pulse, so I have tried various loops. However, I can't generate anything after the initial pulse. Does the device have to be opened and closed between each? I've tried looping the whole set up, and just the configure function, but no luck. Any suggestions? for j in range(1,4): #Setting up the parameters for waveform print "Generating custom waveform..." dwf.FDwfAnalogOutNodeEnableSet(hdwf, channel, AnalogOutNodeCarrier, c_bool(True)) dwf.FDwfAnalogOutNodeFunctionSet(hdwf, channel, AnalogOutNodeCarrier, funcCustom) #Define cu
  5. Hi Attila, this works perfectly! Exactly what I was looking for. One quick question, in the FunctionSet function, where/how do we define "funcCustom" ? This sawtooth is what I want, but just so I know for future reference. Thanks so much! Harry
  6. Follow up, running the AnalogOut_Custom.py I am not able to see any waveforms. I see the voltage spikes when the device is initialized, but nothing else. Thanks so much for quick and helpful responses!
  7. Thanks for the information, and no problem. I keep getting this asymptotic increase to the offset voltage, as shown in the image in the above post. Even if I change the function, and try Sine, I get the identical behavior. Any thoughts on why this is happening? If I change the offsets to 0, then I don't seem to get any signal. Thanks!
  8. Hello, thanks for the response! I finally seem to be getting some signal. The waiting time seems to work. However, it isn't the ramp I'm expecting. I have a couple of further questions though. I actually don't want an offset. I want the starting voltage to be 0V, ramp up to 1V, then drop back down to 0V. It's easy enough to change the offset in the FDwfAnalogOutNodeOffsetSet function, but I was wondering how the function FDwfAnalogOutIdleSet works, and how it would change if I change the offset or amplitude? Also, to get it to go back to 0 V after the ramp, we could perhaps r
  9. Hi Attila! Thanks for such a quick response! This is the code I am running right now. Trying to get one pulse. from ctypes import * import time from dwfconstants import * import sys if sys.platform.startswith("win"): dwf = cdll.dwf elif sys.platform.startswith("darwin"): dwf = cdll.LoadLibrary("/Library/Frameworks/dwf.framework/dwf") else: dwf = cdll.LoadLibrary("libdwf.so") #declare ctype variables hdwf = c_int() channel = c_int(0) #print DWF version version = create_string_buffer(16) dwf.FDwfGetVersion(version) print "DWF Version: "+version.value #open device print "Op
  10. Hi! My goal is to use the Analog Digital 2 in order to move a piezoelectric via stick slip motion. I want to program this into a python script so that I can move the stage one step, record data for x amount of time, move the stage one step, record data, etc. In order to do this, I want to output a specific number of sawtooth wave periods (one to two) at a certain frequency. From these posts (https://forum.digilentinc.com/topic/4084-analog-discovery-2-waveform-generator/ , https://forum.digilentinc.com/topic/2609-how-to-create-one-pulse-via-sdk/#comment-9014), I have figured out how to