• Content Count

  • Joined

  • Last visited

  1. Thank you @attila I'm trying doing this way but it still does not work. It seems that it gets more than a sample after the trigger. It should detect a trigger, take a sample, detect another trigger, get another sample... and continue until it gets n samples. This is the code: dwf.FDwfAnalogIOChannelNodeSet(hdwf, 0, 0, c_double(1.2)) #set the threshold values to 1.2 #sample rate = system frequency / divider, 100MHz/10 dwf.FDwfDigitalInDividerSet(hdwf, c_int(1)) # 8bit per sample format dwf.FDwfDigitalInSampleFormatSet(hdwf, c_int(8)) # only a sample after trigger cSamples = 1 rgwSamples = (c_uint8*cSamples)() dwf.FDwfDigitalInBufferSizeSet(hdwf, c_int(cSamples)) dwf.FDwfDigitalInTriggerSourceSet(hdwf, c_ubyte(3)) # trigsrcDetectorDigitalIn dwf.FDwfDigitalInTriggerPositionSet(hdwf, c_int(int(cSamples))) dwf.FDwfDigitalInTriggerSet(hdwf, c_int(0), c_int(0), c_int(1<<11), c_int(0)) # DIO11 rising edge i=0 y=[] n = 2048*1024 # begin acquisition dwf.FDwfDigitalInConfigure(hdwf, c_bool(0), c_bool(1)) print("Waiting for acquisition...") while i < n: # n samples while True: dwf.FDwfDigitalInStatus(hdwf, c_int(1), byref(sts)) if sts.value == 2 : # done break dwf.FDwfDigitalInStatusData(hdwf, rgwSamples, 1*cSamples) #get a sample y.append(rgwSamples) #append to a "y" vector i=i+1 dwf.FDwfDigitalInConfigure(hdwf, c_bool(0), c_bool(1)) #start again with the acquisition print(" done") dwf.FDwfDeviceCloseAll() plt.plot(y)
  2. Hi all, I'm trying to create a code, similar to but with a difference: I have an external signal (C_flag) which main purpose is to indicate each time the data is ready. For my application, it is crucial to read only once after the rising edge of this signal. In Waveforms , I can achieve that creating a Bus with an enable ( C_flag). In this way, only a data value after the flag signal is valid. However, I can not do that in python with the SDK. Could someone help me? In short: I have a contiuous time data, and I just want to acquire one value after a flag signal. Thank you
  3. I think my problem is, mainly, in FDwfDigitalInStatusData because the input argument is a pointer to a buffer to save data. However, I don't know how to that in LabView. Could someone help me? Thank you in advance.
  4. Hi everybody, I'm trying to acquire digital data from a digital discovery employing LabVIEW and WaveForm SDK. In fact, I would like to acquire continuous time data. However, I can not acquire any data. This is a picture of my .VI. This VI also generates output signals but it does works. I noticed that "psts out" is never "stsDone". In fact, it is nothing. I have tried a lot of thing in order to capture data but nothing works. Could some one give me a working example of recording data with SDK or something related? or just help me with my problem? Thank you