-
Posts
6,990 -
Joined
-
Last visited
Content Type
Profiles
Forums
Events
Gallery
Everything posted by attila
-
Hi @Alessandro See the following: from ctypes import * from dwfconstants import * import math import time import matplotlib.pyplot as plt import sys import numpy 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() version = create_string_buffer(16) dwf.FDwfGetVersion(version) print("DWF Version: "+str(version.value)) dwf.FDwfParamSet(DwfParamOnClose, c_int(0)) # 0 = run, 1 = stop, 2 = shutdown #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(szerr.value) print("failed to open device") quit() dwf.FDwfDeviceAutoConfigureSet(hdwf, c_int(0)) # 0 = the device will only be configured when FDwf###Configure is called sts = c_byte() sampling_frequency = 10000 #500000 hzAcq = c_double(sampling_frequency) nSamples = 300 rgdSamples1 = (c_double * nSamples)() rgdSamples2 = (c_double * nSamples)() rgwDigital = (c_uint16 * nSamples)() cAvailable = c_int() cLost = c_int() cCorrupted = c_int() fLost = 0 fCorrupted = 0 sampling_time = 1 / sampling_frequency ############ set up acquisition ################ dwf.FDwfAnalogInChannelEnableSet(hdwf, c_int(0),c_int(1)) # the acquired channel is the scope 1+,1- dwf.FDwfAnalogInFrequencySet(hdwf, hzAcq) dwf.FDwfAnalogInBufferSizeSet(hdwf, c_int(nSamples)) dwf.FDwfAnalogInTriggerPositionSet(hdwf, c_double(0.5*nSamples/hzAcq.value)) ############ set up trigger ###################### dwf.FDwfAnalogInTriggerSourceSet(hdwf, trigsrcExternal1) # trigsrcDetectorAnalogIn ################# ACQUISITION ######################### sts = c_byte(0) rgdSamples1 = (c_double * nSamples)(0) rgdSamples2 = (c_double * nSamples)(0) rgwDigital = (c_uint16 * nSamples)(0) print("Starting oscilloscope") # dwf.FDwfAnalogInConfigure(hdwf, c_int(0), c_int(1)) dwf.FDwfAnalogInConfigure(hdwf, c_int(True), c_int(True)) iSample = 0 while True: if dwf.FDwfAnalogInStatus(hdwf, c_int(1), byref(sts)) != 1: szerr = create_string_buffer(512) dwf.FDwfGetLastErrorMsg(szerr) print("Error:") print(szerr.value) quit() if sts.value == DwfStateDone.value : break time.sleep(0.1) dwf.FDwfAnalogInStatusData(hdwf, 0, rgdSamples1, nSamples) # get channel 1 data dwf.FDwfAnalogInStatusData(hdwf, 1, rgdSamples2, nSamples) # get channel 2 data print("Acquisition done") if fLost: print("Samples were lost! Reduce frequency") if fCorrupted: print("Samples could be corrupted! Reduce frequency") rgdSamples1 = numpy.array(rgdSamples1, dtype=float) rgdSamples2 = numpy.array(rgdSamples2, dtype=float) plt.plot(numpy.fromiter(rgdSamples1, dtype = numpy.float)) plt.plot(numpy.fromiter(rgdSamples2, dtype = numpy.float)) plt.show()
-
Adjust Digital IO system frequency in Python API
attila replied to HarissonJones's question in Test and Measurement
Hi @Steve_3 You are generating 4.33MHz sine and capturing it with 1MHz, so you are only capturing an alias of the output. Is this what you want ?- 31 replies
-
- digital discovery
- python
-
(and 1 more)
Tagged with:
-
Adjust Digital IO system frequency in Python API
attila replied to HarissonJones's question in Test and Measurement
Hi @Steve_3 Are you using low voltages and setting the input range to low, 5Vpk2pk ? FDwfAnalogInChannelRangeSet You could send me or attach the script.- 31 replies
-
- digital discovery
- python
-
(and 1 more)
Tagged with:
-
Final pydwf release due to new Digilent mandatory-account policy
attila replied to a question in Test and Measurement
Hi @Empower Unfortunately, this project was not created by Digilent, but I hope we can solve its maintenance. -
Analog Discovery 2: I2C with Repeated Start
attila replied to jasonkee111's question in Test and Measurement
Hi @jasonkee111 Specify command byte(s) in SubAddress field and use Read button, or specify argument for Read function in Custom and Sensor mode, and Script. -
- 10 replies
-
- analogue discovery 2
- digital discovery
-
(and 2 more)
Tagged with:
-
Crash: Waveforms 3.21.13 on macOS (mac OS 14.1)
attila replied to Wayne Contello's question in Test and Measurement
Hi @Wayne Contello Thank you for the information. It looks like the communication with the device failed, probably the USB got disconnected, and adept runtime crashed on the following software disconnect/close. So far I was unable to reproduce this. @malexander Do you see something suspicious in multithreading with DVT::Term() DoTransThread() DoTimeoutThread() ? -
Controlling Eclypse Z7 Zmod AWG with WaveForms SDK
attila replied to dmangione's question in Test and Measurement
-
Using an external trigger with Digital Discovery Pattern Generator
attila replied to k_b's question in Test and Measurement
Hi @k_b Slow transitions plus noise can can cause ringing-like false triggers. In the following picture a glitch trigger was used to catch such an event. To reduce the chance of this use faster slew signal, and shielded or twisted signal wire with ground to reduce noise, or use pulse timeout trigger. Currently the max edge is 1.25ns (due to 800MHz internal sampling) but I'll try to add glitch filter adapting sample rate in the next sw version. -
ADP3250 Scope Reading With No Probes Connected
attila replied to janpi's question in Test and Measurement
Hi @janpi A floating high impedance input is not a good metric, it can pick up random radiation from anywhere. -
Hi @Oleg I'm glad the problem was resolved and sorry for the issue. A notification has already been sent to the testing house to ensure that the following batches are packed without headers.
-
Hi @matthew-aedapt It would be helpful if you could provide more information, attach a screenshot or workspace with data... The Format can be specified in the I2S configuration: This is a script for logging the value: var rg = Logic1.Channels.I2S.events; //events var rgt = Logic1.Channels.I2S.eventStamps; // event time stamps var c = rg.length-1; // number of events var i = 0; if(rg[0].charAt(0)!="R") i++; // make sure to start with right var file = File("~/Desktop/i2s.csv"); file.writeLine("Right,Left"); for(; i < c; i+=2){ // trim leading R/L char print(rg[i].substring(2), rg[i+1].substring(2)); file.appendLine(rg[i].substring(2)+","+rg[i+1].substring(2)); }var rg = Logic1.Channels.I2S.events; //events var rgt = Logic1.Channels.I2S.eventStamps; // event time stamps var c = rg.length-1; // number of events var i = 0; if(rg[0].charAt(0)!="R") i++; // make sure to start with right var file = File("~/Desktop/i2s.csv"); file.writeLine("Right,Left"); for(; i < c; i+=2){ // trim leading R/L char print(rg[i].substring(2), rg[i+1].substring(2)); file.appendLine(rg[i].substring(2)+","+rg[i+1].substring(2)); }
- 10 replies
-
- analogue discovery 2
- digital discovery
-
(and 2 more)
Tagged with:
-
Hi @Oleg Check that you are connected to the correct COM port. COM# becomes available after ADP is turned on/connected, in Windows Device Manager COM# should be FTDIBUS... If there is no ADP USB device and no output on COM port, this means that the device/Zynq is not booting. You could open the device (remove rubber feet, unscrew) to make sure that J15 is not shorted with a jumper (behind the Reset button, "USB DEVICE" label). You can remove jumpers (J15, J12) as these are not required. (The J15 is only shorted for initial device programming, then removed for the subsequent testing and calibration. I assume the header was accidentally placed after the procedure.) If not, the device may have been damaged in transit. For warranty and replacement contact the support.digilent @ ni.com specifying the Date of Purchase, Seller and Purchase Order/ Web order Number.
-
ADP3250 Scope Reading With No Probes Connected
attila replied to janpi's question in Test and Measurement
Hi @janpi I don't know what could be the cause of this. You could use Filter channel to filter hf components and/or various averaging options in the application. Edit: To measure the input 'internal' noise a (50R) terminator or a very short wire shorting the BNC input should be used. Additional wire will absorb more radiation. For instance a probe ground loop can be used to locate the source/orientation of the radiation: -
Using an external trigger with Digital Discovery Pattern Generator
attila replied to k_b's question in Test and Measurement
-
Hi @Oleg Make sure the COM port is set to 115.2 kbps On reset the firmware should print something like this: After PL programming, the front LED starts blinking during the software is initialization. For Linux it takes a few seconds, but baremetal (standard/recovery) loads quickly so the LED only blinks once.
-
ADP3250 Scope Reading With No Probes Connected
attila replied to janpi's question in Test and Measurement
Hi @janpi It looks like you have a nearby radiation source of about 16 4.1 MHz. With shorted probe end I see about 5mV pk2pk noise, C3 of ADP3450 is in location C1 of ADP3250. (For nicer UI on MacOS and Linux, recommend to use the Settings/Options/Style: Fusion) -
Hi @ysrevol There is no such option, only sampling on trigger (Time/Options/Sampling) or post-processing the captured data like this: default.dwf3work
- 1 reply
-
- script
- data averaging
-
(and 1 more)
Tagged with:
-
SPI Protocol Analyzer mis-interprets data at high data rates
attila replied to Wayne Contello's question in Test and Measurement
Hi @Wayne Contello Notice the samples lost warning. The record uses data streaming which has limitation in average toggle rate. You could try reducing the sample Rate, the Samples captured or use the default Repeated Mode. -
LabView Community Edition and Analog Discovery
attila replied to jfdo's question in Test and Measurement
-
"Break" condition in UART protocol decoder
attila replied to TOIVI's question in Test and Measurement
Hi @TOIVI Currently the break trigger uses a negative pulse of at least 9 bits long, 1 + uart bits + ?parity, which is on the limit of NUL. It will be fixed in the next version 3.21.14 to be 10 bits long. Alternatively configure a pulse trigger of at least 520us -
Any possibility of an analog meter display for voltmeter
attila replied to korn's question in Test and Measurement
-
Waveforms SDK - SPI Baud rate calculation
attila replied to Timotej Merklin's question in Test and Measurement
Hi @Timotej Merklin Perform a single capture and process the data. -
acquisition duration vs trigger frequency
attila replied to Loic VINET's question in Test and Measurement
Hi @Loic VINET The digital-in should be started before the digital-out, otherwise the out may finish or generate the trigger condition before the in starts looking for this. Instead record you can use the simpler to use acqmodeSingle.- 6 replies
-
- acquisition duration
- trigger frequency
-
(and 1 more)
Tagged with:
-
Hi @Martin Obert The Logic Analyzer has CAN FD interpreter and the Protocol tool can send CAN FD messages. Scope to digital conversion is also available in the mixed mode (Scope + Digital/Logic Analyzer). Beside the supported Bus, SPI, I2C, UART, CAN, I2S, 1-Wire, HDMI CEC, Manchester, JTAG, GPIB, SWD, SAE J1850 VPW interpreters, Custom protocols can also be implemented in Logic Analyzer.