Search the Community

Showing results for tags 'analogdiscovery2'.

More search options

  • Search By Tags

    Type tags separated by commas.
  • Search By Author

Content Type


  • News
    • New Users Introduction
    • Announcements
  • Digilent Technical Forums
    • FPGA
    • Digilent Microcontroller Boards
    • Non-Digilent Microcontrollers
    • Add-on Boards
    • Scopes & Instruments and the WaveForms software
    • LabVIEW
    • FRC
    • Other
  • General Discussion
    • Project Vault
    • Learn
    • Suggestions & Feedback
    • Buy, Sell, Trade
    • Sales Questions
    • Off Topic
    • Educators
    • Technical Based Off-Topic Discussions


  • Community Calendar

Find results in...

Find results that contain...

Date Created

  • Start


Last Updated

  • Start


Filter by number of...


  • Start





Website URL







Found 12 results

  1. I'm a coding newbie trying to to use Javascript to produce a pulse of arbitrary length and capture the whole pulse (and a little bit before and after) in one csv file. To do this, I need to make Scope1's recording buffer size longer, and set Scope 1 to be triggered by Wavegen1, but get the following errors with both the Wavegen and Scope Windows open: Scope1.BufferSize.value = 1; RESULT: TypeError: Result of expression 'Scope1.BufferSize' [undefined] is not an object. Scope1.Source.text = "Wavegen 1"; //OR Scope1.Source.text = "Wavegen1"; RESULT OF BOTH: TypeError: Result of expression 'Scope1.Source' [undefined] is not an object. I'm guessing these functions are deprecated, since while they do appear in the help menu, they don't appear in the Ctrl+Space autofill menu. Does anyone know how to change the the individual buffer size for recording in javascipt, and set the source or Scope1, or is this something I have to go into the C++ SDK to do? Reading other forums code, at least the BufferSize variable is claimed to work fine, in code like here: Even with just copying Andras's code, I've run into the same compiler errors; I've reinstalled waveforms on at least two computers with separate Analog Discovery 2 devices and hit the same wall. Is there some declaration I must make beforehand before certain Scope1 members can be accessed?
  2. I am using the python API for Waveforms to interface an Analog Discovery 2 and are trying monitor a voltage. The problem is that the measurements on channel 1 are capped to about 2.7 Volt wile channel 2 can measure up to 12.5 (the voltage I am supposed to measure) just fine. When I open Waveforms and use the scope there everything seems to work just fine. I am using the example code from whit some small cleanup/modifications. Does anyone have an idea what I might be doing wrong? """ DWF Python Example Author: Digilent, Inc. Revision: 2018-07-19 Requires: Python 2.7, 3 """ from ctypes import * from dwfconstants import * import math import time import matplotlib.pyplot as plt import sys import numpy as np import signal dwf = cdll.LoadLibrary("/Library/Frameworks/dwf.framework/dwf") class AnalogDiscovery2(): def __init__(self): self.hdwf = c_int() dwf.FDwfDeviceOpen(c_int(-1), byref(hdwf)) def record_analog_in(self, pin, duartion): return def __del__(self): dwf.FDwfDeviceCloseAll() def rec(fs, duration_seconds=1, infinite=False): #declare ctype variables hdwf = c_int() sts = c_byte() hzAcq = c_double(fs) nSamples = duration_seconds * fs rgdSamples_1 = (c_double*nSamples)() rgdSamples_2 = (c_double*nSamples)() cAvailable = c_int() cLost = c_int() cCorrupted = c_int() fLost = 0 fCorrupted = 0 #open device print("Opening first device") dwf.FDwfDeviceOpen(c_int(-1), byref(hdwf)) if hdwf.value == hdwfNone.value: szerr = create_string_buffer(512) dwf.FDwfGetLastErrorMsg(szerr) print(str(szerr.value)) print("failed to open device") quit() #set up acquisition dwf.FDwfAnalogInChannelEnableSet(hdwf, c_int(0), c_bool(True)) dwf.FDwfAnalogInChannelRangeSet(hdwf, c_int(0), c_double(5)) dwf.FDwfAnalogInAcquisitionModeSet(hdwf, acqmodeRecord) dwf.FDwfAnalogInFrequencySet(hdwf, hzAcq) if infinite: dwf.FDwfAnalogInRecordLengthSet(hdwf, -1)#) # -1 infinite record length else: dwf.FDwfAnalogInRecordLengthSet(hdwf, c_double(nSamples/hzAcq.value)) #wait at least 2 seconds for the offset to stabilize time.sleep(2) print("Starting oscilloscope") dwf.FDwfAnalogInConfigure(hdwf, c_int(0), c_int(1)) cSamples = 0 time_start = time.time() while (cSamples < nSamples): dwf.FDwfAnalogInStatus(hdwf, c_int(1), byref(sts)) if cSamples == 0 and (sts == DwfStateConfig or sts == DwfStatePrefill or sts == DwfStateArmed) : # Acquisition not yet started. continue dwf.FDwfAnalogInStatusRecord(hdwf, byref(cAvailable), byref(cLost), byref(cCorrupted)) cSamples += cLost.value if cLost.value : fLost = 1 if cCorrupted.value : fCorrupted = 1 if cAvailable.value==0 : continue if cSamples+cAvailable.value > nSamples : cAvailable = c_int(nSamples-cSamples) dwf.FDwfAnalogInStatusData(hdwf, c_int(0), byref(rgdSamples_1, sizeof(c_double)*cSamples), cAvailable) # get channel 1 data dwf.FDwfAnalogInStatusData(hdwf, c_int(1), byref(rgdSamples_2, sizeof(c_double)*cSamples), cAvailable) # get channel 2 data cSamples += cAvailable.value time_used = time.time() - time_start dwf.FDwfAnalogOutReset(hdwf, c_int(0)) dwf.FDwfDeviceCloseAll() print("Recording done") if fLost: print("Samples were lost! Reduce frequency") if fCorrupted: print("Samples could be corrupted! Reduce frequency") data_1 = np.fromiter(rgdSamples_1, dtype = np.float) data_2 = np.fromiter(rgdSamples_2, dtype = np.float) t = np.linspace(0, time_used, len(data_1))"data_1", data_1)"data_2", data_2)"time", t) if __name__ == "__main__": rec(100, 2)
  3. Hi, I'm trying to acquire at 1MSample/s using WaveForms SDK (DWF Version: 3.10.9) I think that I should use acqmodeRecord mode with infinitum length so I use: FDwfAnalogInRecordLengthSet(hdwf, 0.0); But then in the while loop I'm a little puzzled due to the call if(!FDwfAnalogInStatus(hdwf, true, &sts)).... Shouldn't be done only once to reach Running state? According to section "5 Analog In (Oscilloscope)" in SDK documentation the AD2 should remain in Running state... So I change the example to do only once but I have always the same samples...any clue? Should I use other acquisition mode like ScanScreen? like reported in Thank you for your help pz
  4. I see in the documentation that the ADG612 gain switch between high gain and low gain to the ADC. I see in Waveforms Spectrum analyzer that there are many gain options: 0.01x, 0.1x, 1x, 10x, 100x. Which hardware gain setting is used in Waveforms for those gain settings? Thanks!
  5. Hello For a project I have to analyze two analog signals at a frequency of 78.4 kHz. Sampling rate must be at least 1 MHz. I have a Analog Discovery 2, I generate for now a signal square of 100kHz. I can observe this signal but only on a few periods. I wish I could get them back on a spreadsheet excel in order to treat them with Matlab. I can get a spreadsheet excel, but only with 8000 values, or I would need 1M values. Is it possible with a Analog Discovery 2 ?
  6. Hi all i am using Analog discovery 2 for communication purpose.(CAN) I tried using the sample code given same as attached. I am using PCAN to send/receive frames to analog discovery 2 , I am sending only one frame with Standard ID : 0x011 and Data: 0xaa 0xbb 0xcc 0xdd 0xee 0xff but i am receiving lot of Frames with the same ID sent, lot of extended remote frames with CRC errors ,etc. I have attached the console output for reference. Can I know why i am facing the issue? I tried same experiment with waveforms still having similar issue. I have attached the screen shot of it. CAN_Console.txt
  7. I am using analog discovery 2 to send/Receive signals with PCAN using python. Do i need to have a CAN transceiver IC to convert from CAN-H/L to CAN-Rx/Tx? Also wanted to know if i use Waveforms software, what is the hardware connection?
  8. Hello all, I am trying to read data from an Analog Discovery 2, but I am a bit confused by the FDwfAnalogInStatusData16() function. I would prefer to have the raw integer data from the AD2, as I want to histogram them and I would have to convert back the doubles to integers. On the include file of the C API it is written DWFAPI BOOL FDwfAnalogInStatusData16(HDWF hdwf, int idxChannel, short *rgu16Data, int idxData, int cdData); and I do not understand the difference between idxData and cdData. I tried to guess from the buffer sizes with no success. Reading from the AD2 I know that the maximum buffer size is 8196 (is this per channel?), so I thought that the idxData parameter is an index of the waveform and that the available samples (that I read with FDwfAnalogInStatusRecord) are a multiple of the buffer size (that I set with FDwfAnalogInBufferSizeSet), but it is not the case. May I ask for a quick example on how to use FDwfAnalogInStatusData16 to read both channels? Thanks
  9. It appears that the AD2 power supply selection does not automatically switch to external power when plugging it in after it has already been connected via USB. 1. Connect the AD2 via USB cable 2. Start waveforms2015 3. Connect external power supply(5V -3.5A) From time to time a failure appears like DptiIO failed ERC: 0xA. On Linux this issue is made worst by the fact that it appears a lot more often than on Windows even in the middle of operation of the device. This appears even without the external power supply. Something similar appears on Linux saying that the USB port did not provide sufficient power. Even if the power supply is connected later on, the issue still appears. The only way to solve this is completely disconnect the USB cable, plug in the power supply cable, then plug in the USB cable. The version of Waveforms2015 used is 3.5.4 64bit. On both Windows 7 and Linux the same version is present.(with the latest ADAPT software installed on Linux). The device is put in mode 4 with only Logic and Patterns enabled and memory allocated for them. Is there any way to solve this? Thanks
  10. We are currently using an AD2 as a data acquisition device in a configuration in which an external trigger is delayed by the DigitalOut device and then routed to one of the AnalogIn channels to trigger the latter. The DigitalOut generates its trigger on digital i/o line 0. We now wish to use some of the other digital i/o lines for simple i/o. The question is can we do both things at once: namely, trigger digital i/o channel 0 with the DigitalOut device while using digital i/o lines 1-15 as simple Digital I/O devices? Our guess is that we can use lines 1-15 for digital input but not digital output. We'd very much appreciate any insight into this issue.
  11. Working on Debian 8.6 in python 2.7, trying to figure out what the 'ready' state of the AD2 means and how I can get back to running mode. We configure the AD2 to run continuously, collecting multiple subtraces and combining them into a larger trace. The system happily runs, sometimes for hours or days, reporting states of 'arm', 'triggered', and 'done' repeatedly. But at some point with an unknown-to-me cause, it flips to a 'ready' state and our data collection stops. I don't know what FDwf python command to issue to get it back to triggering and taking data. As it is, I close and delete the python AnalogDiscovery object and create a new object, thus re-initializing our AD2 connection. But my guess is that I shouldn't have to do this to start up again. Can someone tell me to proper way to get back to taking data after getting bumped out to 'ready' state? Thanks.
  12. We're using the 64 bit packages for Debian, writing our own python 2.7 code to access the provided AD2 library using 'ctypes' module. I'm trying to track down a tricky bug and wondering what the library was compiled with: C or C++ ? Is the dwf.h definition file exactly correct with regards to parameter types (char vs unsigned char Trying to see if the size of the parameters, ctypes.c_bool() vs ctypes.c_int(), e.g., matters. Or c_byte() vs c_ubyte(). Since afaik C doesn't have 'bool' type, knowing if this is a C++ library would help me decide. Similar inconsistencies: Example code snippet: /usr/share/digilent/waveforms/samples/py/ #TRIGSRC trigsrcNone = c_byte(0) trigsrcPC = c_byte(1) But dwf.h, that presumaly the library was compiled with: typedef unsigned char BYTE; typedef BYTE TRIGSRC; const TRIGSRC trigsrcNone = 0; const TRIGSRC trigsrcPC = 1; where my reference tells me 'c_ubyte' is what we should be using for 'unsigned char', not c_byte(). Going by the dwf.h file, I would not use the definition examples provided in, but change to c_ubyte(), for example. In the end, most of these probably won't matter, but the bug I'm chasing seems to involve corruption of the runtime stack (moving a FDwf call into a subroutine gives different behavior than calling it from one up), so I'm being paranoid about the ctypes interface since it's easy to make a mistake there. This on Debian 8.6 with installed: +++-=======================-================-================-=================================================== ii digilent.adept.runtime 2.16.5 amd64 Digilent Adept Runtime ii digilent.adept.utilitie 2.2.1 amd64 Digilent Adept Utilities ii digilent.waveforms 3.3.7 amd64 Digilent WaveForms Thanks much.