Piotr Rzeszut

  • Content count

  • Joined

  • Last visited

  • Days Won


Piotr Rzeszut last won the day on July 7

Piotr Rzeszut had the most liked content!

About Piotr Rzeszut

  • Rank
    Frequent Visitor

Recent Profile Visitors

The recent visitors block is disabled and is not being shown to other users.

  1. Piotr Rzeszut

    Analog Discovery 2 interfacing CAN

    TX and RX channels are defined in Protocol -> CAN Window: Functions for setting Rx and Tx channels are described in SDK Reference Manual: Also, in my opinion, you have to use a proper CAN transceiver for TX, as the transceiver is not only a level shifter, but realizes differential interface. Maybe you can monitor without a ttransceiver, if I/O threshold would be sufficient to voltage levels on one of CAN lines.
  2. Piotr Rzeszut

    Impedance Analyzer Internal Compensation

    Yes. First you should measure your resistance with a precise multimeter and enter it in Compensation window. Then open compensation is without load, and short is with shorted DUT terminals. Please be aware, that compensation should be repeated when you change frequency range, frequency step, etc.
  3. Piotr Rzeszut

    Impedance Analyzer Internal Compensation

    Yes, I meant these options.
  4. Piotr Rzeszut

    Impedance Analyzer Internal Compensation

    Have you performed calibration (open, short, ...)? Additionally such small capacitance can be a parasitic capacitance of cables, AD2 connector etc.
  5. Hi. I think that programming may be implemented quite easily using the WaveForms SDK (and for example a python script). In my opinion debugging would be harder to achieve, because it would require integration with existing debugging drivers.
  6. Piotr Rzeszut

    Software won't recognize AD2

    And also are you using USB cable provided with the AD2?
  7. Piotr Rzeszut

    Auto-calibrate for Analog Discovery 2?

    @gasstationwithoutpumps It has ben just released as a beta:
  8. Piotr Rzeszut

    Analog Discovery 2 vs NI myDAQ

    Hi, NI myDAQ has an input sample rate of 200 kSPS and bandwidth of 400kHz, where AD2 has 100MSPS and 30MHz+ (with adapter) => point for AD2 NI myDAQ has maximum input voltage +-10V, where AD2 has +-25V => point for AD2 NI myDAQ has an output sample rate of 200 kSPS, where AD2 has 100MSPS => point for AD2 NI myDAQ has maximum output voltage of +-10V, where AD2 has +-5V => point for NI myDAQ NI myDAQ has a built-in multimeter (so it is able to measure in addition to voltage, also resistance, current, diode voltage without any additional adapters) AD2 requires separate adapters for such measurements => point for NI myDAQ NI myDAQ has fixed +-15V supplies (32 mA) and +5V (100mA), where AD2 has 0...5V and 0...-5V voltage outputs (700mA max with external power supply) => point for ??? Ni myDAQ has 8 digital IO, where AD2 has 16 of them. Also AD2 IOs can be controlled much faster than ones in myDAQ => point for AD2 This is a fast comparison of a key features. Full documentation of each device are available here: https://reference.digilentinc.com/reference/instrumentation/analog-discovery-2/reference-manual http://www.ni.com/pdf/manuals/373061f.pdf Summing up all above (in my opinion): AD2 is a better choice for debugging fast analog and analog/digital circuits. A software adds a great value by allowing various measurements and tools without any need of programming. Also an interface for python scripting allows designing own applications. There is also LabVIEW interface provided. You can always see all these functions in interactive demo - just download recent Waveforms software. https://reference.digilentinc.com/reference/software/waveforms/waveforms-3/start NI myDAQ offers much slower I/O and less digital channels. At the other hand it can be used as off-the-shelf multimeter`. It also includes basic software and interface for LabVIEW, but lacks for example interface control (I2C, SPI, ...). http://www.ni.com/tutorial/11431/en/ Also AD2 can be purchased in reduced price for academic use. This is of course my private opinion on these devices - you have to decide which one to buy by analyzing use cases.
  9. Piotr Rzeszut

    Show both channels scale

    It looks great! Will there be a switch between new and old mode? Or per-channel option hide/show channel scale? The option may be a thing for users of smaller screens.
  10. Piotr Rzeszut

    Python digital continuous record (AD2/DD)

    Hi @attila, Thank you for your answer. In my next attempts I have removed aligning of the data, and achieved the same using following settings: # number of samples after trigger dwf.FDwfDigitalInTriggerPositionSet(hdwf, c_int(0)) # number of samples before trigger dwf.FDwfDigitalInTriggerPrefillSet(hdwf, c_int(1)) It would be nice to include information what effect have setting one of these parameters to 0 or -1 in the documentation. The explanation of the glitches is very clear, as we are running devices with separate clock domains without any synchronization stages - it turned out to be very nice demonstration of the effect
  11. Piotr Rzeszut

    Acquiring data until an event occurs

    Well, first of all, as You set trigger to normal, only data before (around) the trigger will be saved. Second question is how fast acquisition do you need? You can always write a python script, as I am doing now. Maybe @attila will give you soon more complete answer
  12. Piotr Rzeszut

    Acquiring data until an event occurs

    I think triggering in normal mode on that data with correct trigger position i.e. long enough pre-trigger time/correct position. See Mode: record
  13. Piotr Rzeszut

    Python digital continuous record (AD2/DD)

    Well, I figured out somehow following code: """ DWF Python Example Author: Digilent, Inc. Revision: 11/24/2014 Requires: Python 2.7, numpy, """ from ctypes import * from dwfconstants import * import math import sys import time import matplotlib as mpl import matplotlib.pyplot as plt 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() sts = c_byte() cdevices = c_int() devicename = create_string_buffer(64) # print DWF version version = create_string_buffer(16) dwf.FDwfGetVersion(version) print "DWF Version: " + version.value #enumerate and print device information #4 for AD2 dwf.FDwfEnum(c_int(0), byref(cdevices)) print "Number of Devices: "+str(cdevices.value) # open device print "Opening device:" for i in range(0, cdevices.value): dwf.FDwfEnumDeviceName (c_int(i), devicename) if devicename.value == "Digital Discovery": dwf.FDwfDeviceOpen(c_int(i), byref(hdwf)) print "\t", i, " : ", devicename.value if hdwf.value == hdwfNone.value: print "failed to open device" quit() print "Configuring Digital Out / In..." dwf.FDwfAnalogIOChannelNodeSet(hdwf, c_int(0), c_int(1), c_double(3.3)) time.sleep(0.1) dwf.FDwfDigitalInReset(hdwf) #dwf.FDwfDigitalOutReset(hdwf) dwf.FDwfDigitalInInputOrderSet(hdwf, c_bool(False)) # generate counter #for i in range(0, 8): # dwf.FDwfDigitalOutEnableSet(hdwf, c_int(i), c_int(1)) # dwf.FDwfDigitalOutDividerSet(hdwf, c_int(i), c_int(1 << i)) # dwf.FDwfDigitalOutCounterSet(hdwf, c_int(i), c_int(1000), c_int(1000)) #dwf.FDwfDigitalOutConfigure(hdwf, c_int(1)) # set number of sample to acquire nSamples = 200000 rgwSamples = (c_uint8 * nSamples)() cAvailable = c_int() cLost = c_int() cCorrupted = c_int() iSample = 0 fLost = 0 fCorrupted = 0 # in record mode samples after trigger are acquired only dwf.FDwfDigitalInAcquisitionModeSet(hdwf, acqmodeRecord) # sample rate = system frequency / divider, 100MHz/100 = 1MHz dwf.FDwfDigitalInDividerSet(hdwf, c_int(100)) # 16bit per sample format dwf.FDwfDigitalInSampleFormatSet(hdwf, c_int(8)) # number of samples after trigger dwf.FDwfDigitalInTriggerPositionSet(hdwf, c_int(0)) # 50% # number of samples before trigger dwf.FDwfDigitalInTriggerPrefillSet(hdwf, c_int(1)) # enable data compression by select used lines dwf.FDwfDigitalInSampleSensibleSet(hdwf, c_int(0x00FF)) # trigger when all digital pins are low dwf.FDwfDigitalInTriggerSourceSet(hdwf, trigsrcNone) # trigger detector mask: low & hight & ( rising | falling ) # dwf.FDwfDigitalInTriggerSet(hdwf, c_uint(0xFFFF), c_uint(0), c_uint(0), c_uint(0)) # begin acquisition dwf.FDwfDigitalInConfigure(hdwf, c_bool(1), c_bool(1)) print "Starting record" mpl.rcParams['toolbar'] = 'None' ax1 = plt.gca() while True: dwf.FDwfDigitalInStatus(hdwf, c_int(1), byref(sts)) dwf.FDwfDigitalInStatusRecord(hdwf, byref(cAvailable), byref(cLost), byref(cCorrupted)) iSample += cLost.value iSample %= nSamples if cLost.value: fLost = 1 if cCorrupted.value: fCorrupted = 1 iBuffer = 0 while cAvailable.value > 0: cSamples = cAvailable.value # we are using circular sample buffer, make sure to not overflow if iSample + cAvailable.value > nSamples: cSamples = nSamples - iSample dwf.FDwfDigitalInStatusData2(hdwf, byref(rgwSamples, iSample), c_int(iBuffer), c_int(cSamples)) iBuffer += cSamples cAvailable.value -= cSamples iSample += cSamples iSample %= nSamples #print sts.value, " ", iSample if sts.value == DwfStateDone.value: break if not plt.get_fignums(): print "CLOSED" break ax1.clear() ax1.plot(rgwSamples) plt.pause(0.0001) dwf.FDwfDeviceClose(hdwf) print "Recording finished" if fLost: print "Samples were lost! Reduce sample rate" if cCorrupted: print "Samples could be corrupted! Reduce sample rate" f = open("record.csv", "w") for i in range(0, nSamples): iAlign = (i + iSample) % nSamples # first sample in our buffer is at iSample index f.write("%s\n" % rgwSamples[iAlign]) f.close() But quite often I get reading with nasty glitches: The signal is generated using Analog Discovery 2. For a connection I am using High-speed inputs 0..7 of DD and DIO 0..7 for AD2. Configuration of AD2:
  14. Hi, I want to make an enumeration, with filtering only Digital Discovery devices. Official documentation (pdf file) says nothing about enumfilter values. In files with constants only three values are listed: #ENUMFILTER enumfilterAll = c_int(0) enumfilterEExplorer = c_int(1) enumfilterDiscovery = c_int(2) I have figured out filter for AD2 devices to be 4, but i am not able to find any filter for DD. Also I have noticed that some SDK documentation is missing or very limited.
  15. Hi, Using python script I want to constantly collect digital data form 6 lines (so 8 lines would be sampled) with a rate of 1MSPS, with transfer to the PC. I have read: And I am not sure if I should use record mode with data compression or scan screen mode. I suppose record mode would be best, but I don't know how to set unlimited number of samples for digital record (there is no function FDwfAnalogInRecordLengthSet for Digital inputs), as the only method to set number of samples is calling dwf.FDwfDigitalInTriggerPositionSet and dwf.FDwfDigitalInTriggerPrefillSet... At the other hand, will scan screen mode allow the sample rate of 1MSPS to be transmitted to PC? I would be grateful for any suggestions @attila. I have searched through the forum but only found mentioned discussion and some materials related to analog acquisition....