Jump to content

attila

Technical Forum Moderator
  • Posts

    6,533
  • Joined

  • Last visited

Everything posted by attila

  1. Szia @Andras It could be the USB is not supported over emulation. I can't find information about this...
  2. Hi @concept Add the WFSDK/ samples/ cs/ dwf.cs to your project, see the WFSDK/manual and /samples/py using System; using System.Collections.Generic; using System.Linq; using System.Text; using System.Threading.Tasks; namespace ConsoleApp1 { class Program { static void Main(string[] args) { int hdwf; if (dwf.FDwfDeviceOpen(-1, out hdwf)==0) { Console.WriteLine("failed to open device"); return; } Console.WriteLine("connected"); //... Console.WriteLine("diconnecting"); dwf.FDwfDeviceCloseAll(); } } }
  3. Hi @Kirsan This trigger misalignment is because the software does not handle the VB8034's downscaling correctly. Notice that it lets you set 500MHz but the device can only do 375MHz, or any other even division of 1.5GHz.
  4. Hi @Kirsan @JColvin Officially it does not support... I hope the impedance option is fixed in the latest beta version. Unfortunately I don't have this variant so I can't test it.
  5. Hi @Josh Woods For stable sample rate use the Signal Pattern option in the latest WF version: You can use Custom or Play mode for more samples at limited streaming rate. With AD2 Custom Pattern make sure the number of samples is power of two. With Play or Custom with ADP3X50 the number of samples can be arbitrary.
  6. Hi @Robin Oswald 1. Triggering is only used with coherent average. 4. The Window option is put back in the latest version. I try to avoid useless options. Thank you for pointing out an advantage for this. I don't recommend using the auto offset/gain options for precise measurements since these continuously adjust the parameters which may slightly affect the measurement.
  7. Hi @Simon Miller In "Value to text" tab only the Value2Text functions matters. This is called by the application to convert the value/mask pairs to text. You could also use the Protocol/ SPI/ Spy tool. Under View increase the "Max Lines", use Stamp...
  8. Hi @Limitha See the DigitalOut_Custom.py DigitalOut_CustomBus.py examples
  9. Hi @Malcolm The Wavegen drive is 10-50mA depending on voltage level, at +/-5V min 10mA and around 0V max 50mA. The aux/usb supplying affects only the power supply limits. The coherent averaging looks to be slightly better with fixed frequency noise. In the following pic R1-2 uses coherent average which perfectly overlaps C1-2 using mag/phase. The 10mV signal is generated by W1 controlled by NA. The C1 SNR is 20...10dB and C2 -40..0dB.
  10. Hi @Memtronic See the following post:
  11. Hi @Robin Oswald 1. No the default mag/phase average is the old averaging. 3. Check "Custom One", open editor, type "Coherence" and adjust "Top" 4. I've already removed the "Window" from the next version since only the flat-top has a flat response. Did you notice any advantage of any other widow?
  12. Hi @Limitha You have used the digital-io functions for software control which have ~millisecond latency. For high frequency use the earlier mentioned digital-out functions:
  13. Hi @WaldoPepper The AD2 power supplies have no voltage or current readback. The system monitor reports the entire device consumption which can fluctuate. You could use shunt resistors and monitor the voltage drop with the differential scope inputs, with ~300uV resolution. Lower resistance should be used to reduce the voltage drop and to have high resolution external amplification would be recommended. For higher resolution a DMM or dedicated module/IC should be used.
  14. Hi @Alec See the following example: AnalogOut_Phase.py ... # 0 = the device will be configured only when calling FDwf###Configure dwf.FDwfDeviceAutoConfigureSet(hdwf, c_int(0)) # enable two channels dwf.FDwfAnalogOutNodeEnableSet(hdwf, c_int(0), AnalogOutNodeCarrier, c_int(True)) dwf.FDwfAnalogOutNodeEnableSet(hdwf, c_int(1), AnalogOutNodeCarrier, c_int(True)) # for second channel set master the first channel dwf.FDwfAnalogOutMasterSet(hdwf, c_int(1), c_int(0)); # slave channel is controlled by the master channel # configure enabled channels dwf.FDwfAnalogOutNodeFunctionSet(hdwf, c_int(-1), AnalogOutNodeCarrier, funcSine) # CH1&2 ... for i in range(len(rgFreq)): print("Step "+str(i+1)+" "+str(rgFreq[i])+"Hz "+str(rgAmp[i])+"V "+str(rgPhase[i])+"* ") dwf.FDwfAnalogOutNodeFrequencySet(hdwf, c_int(-1), AnalogOutNodeCarrier, c_double(rgFreq[i])) # CH1&2 dwf.FDwfAnalogOutNodeAmplitudeSet(hdwf, c_int(-1), AnalogOutNodeCarrier, c_double(rgAmp[i])) # CH1&2 dwf.FDwfAnalogOutNodePhaseSet(hdwf, c_int(1), AnalogOutNodeCarrier, c_double(rgPhase[i])) # CH2 if i==0: dwf.FDwfAnalogOutConfigure(hdwf, c_int(1), c_int(0)) # CH2 configure dwf.FDwfAnalogOutConfigure(hdwf, c_int(0), c_int(1)) # CH1 start else: dwf.FDwfAnalogOutConfigure(hdwf, c_int(1), c_int(3)) # CH2 apply dwf.FDwfAnalogOutConfigure(hdwf, c_int(0), c_int(3)) # CH1 apply time.sleep(5) ...
  15. Hi @Josh Woods The Wavegen is optimized for analog waveforms, so the generated average frequency to be close as possible to the requested. For this, fractional steps are used and this may result in varying sample rate. I'll post soon software version with fixed sample rate option.
  16. Hi @CoreZ86 If you are using software controlled logging it can have few ms of delay. You could use triggered record mode to collect samples. This way only the ppm difference between the device oscillators will count. See AnalogIn_Record_Trigger.py use with FDwfAnalogInTriggerPositionSet(0)
  17. Szia @Andras The software is not available natively for Windows ARM64, only for Windows 32/64bit, Linux 32/64 bit intel/arm (x86, amd64, armhf, arm64) and MacOS 32/64. It is also working with MacOS M1/ARM seamlessly with emulation. As I read, Windows ARM also provides intel emulation: https://blogs.windows.com/windows-insider/2020/12/10/introducing-x64-emulation-in-preview-for-windows-10-on-arm-pcs-to-the-windows-insider-program/ The error is complaining about "Visual C++ Redistributable for Visual Studio 2015". This is included in the WF installer but WinARM may need a different variant. Please try installing it manually: https://www.microsoft.com/en-us/download/details.aspx?id=48145 https://answers.microsoft.com/en-us/windows/forum/all/unable-to-install-programs-due-to-vcruntime140dll/3a9cba87-6dfd-4591-94d6-08c347e2db39
  18. Hi @maling I run the following code with 10 device for more than 10minutes several times without any problem. multi.py similar to your GetSpectra() I only got error when disconnecting the USB cable: At which function it fails for you? For the error message use print(szerr.value) or cast the C string. from ctypes import * import sys import time from dwfconstants import * 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") szerr = create_string_buffer(512) def FDwf(fun, args): if fun(*args) == 0: dwf.FDwfGetLastErrorMsg(szerr) print(szerr.value) raise #dwf.FDwfParamSet(DwfParamOnClose, c_int(1)) # 0 = run, 1 = stop, 2 = shutdown cDevice = c_int() dwf.FDwfEnum(c_int(0), byref(cDevice)) print("Devices: "+str(cDevice.value)) hdwfs = [] for k in range(cDevice.value): hdwf = c_int() FDwf(dwf.FDwfDeviceOpen, [c_int(k), byref(hdwf)]) hdwfs.append(hdwf) for k in range(len(hdwfs)): FDwf(dwf.FDwfAnalogImpedanceReset, [hdwfs[k]]) FDwf(dwf.FDwfAnalogImpedanceModeSet, [hdwfs[k], c_int(8)]) # 0 = W1-C1-DUT-C2-R-GND, 1 = W1-C1-R-C2-DUT-GND, 8 = AD IA adapter FDwf(dwf.FDwfAnalogImpedanceReferenceSet, [hdwfs[k], c_double(1e3)]) # reference resistor value in Ohms FDwf(dwf.FDwfAnalogImpedanceFrequencySet, [hdwfs[k], c_double(1e3)]) # frequency in Hertz FDwf(dwf.FDwfAnalogImpedanceAmplitudeSet, [hdwfs[k], c_double(1)]) # 1V amplitude = 2V peak2peak signal FDwf(dwf.FDwfAnalogImpedanceConfigure, [hdwfs[k], c_int(1)]) # start tstart = time.time() sts = c_byte() for j in range(100): # repeat for i in range(100): # steps for k in range(len(hdwfs)): # device print("repeat: "+str(j)+" step: "+str(i)+" dev: "+str(k)) FDwf(dwf.FDwfAnalogImpedanceFrequencySet, [hdwfs[k], c_double(1e3+99e3*i/99)]) # frequency in Hertz # Once you set a value, it will start its measurement routine automatically time.sleep(0.01) for k in range(len(hdwfs)): FDwf(dwf.FDwfAnalogImpedanceStatus, [hdwfs[k], None]) # ignore last capture since we changed the frequency # Read the result from each of the devices, once they complete. for k in range(len(hdwfs)): hdwf = hdwfs[k] while True: FDwf(dwf.FDwfAnalogImpedanceStatus, [hdwf, byref(sts)]) if sts.value == 2: break # Compute the resistance and reactance from the harvested values resistance = c_double() reactance = c_double() FDwf(dwf.FDwfAnalogImpedanceStatusMeasure, [hdwf, DwfAnalogImpedanceResistance, byref(resistance)]) FDwf(dwf.FDwfAnalogImpedanceStatusMeasure, [hdwf, DwfAnalogImpedanceReactance, byref(reactance)]) print("Done with "+str(len(hdwfs))+" devices in "+str(time.time()-tstart)+"s") dwf.FDwfDeviceCloseAll()
  19. Hi @Limitha It is possible to configure it up to 50MHz or the set system frequency / 2. The FDwfDigitalOutDividerSet specifies the prescaler from 100MHz and FDwfDigitalOutCounterSet the low and high counts. See the WF SDK manual and the samples/ py/ DigitalOut_Clock.py DigitalOut_Duty.py ... examples
  20. Hi @davorin It requires digilent.adept.runtime >= 2.26 https://digilent.com/reference/software/adept/start
  21. Hi @ca_michelle The next version will show REJ for rejected broadcast messages. Thank you for the observation.
  22. Hi @CoreZ86 The oscilloscope in a device is one instrument. The scope channels are controlled together, one trigger, same rate... but you can use them for different purpose. The FDwfAnalogInStatus->FDwfAnalogInStatusSample returns the current ADC readings regardless of the capture state. The wavegen channels are independent instruments. See the following posts:
  23. Hi @TheoMaria As it is in the second example: If you are using the DAQ do not call FDwfDeviceOpen since the device can be opened only once at a time. The DAQ will open the device the hdwf will get value 1 and use this in the FDwf functions. I've modified your example: Waveform_Generation2.m ... %% Power Supply % Load library, "hfile" is a variable that points to the location of the library % dummy read to open device data = read(dq, seconds(1)); if ~libisloaded('dwf') loadlibrary('dwf', 'C:/Program Files (x86)/Digilent/WaveFormsSDK/inc/dwf.h'); end if calllib('dwf','FDwfAnalogIOStatus', 1) == 0 % see if device is connected disp('No opened device') return else disp('Enable PS') calllib('dwf','FDwfAnalogIOChannelNodeSet', 1, 0, 0, 1.0); % V+ enable calllib('dwf','FDwfAnalogIOChannelNodeSet', 1, 0, 1, 5.0); % V+ 5V calllib('dwf','FDwfAnalogIOChannelNodeSet', 1, 1, 0, 1.0); % V- enable calllib('dwf','FDwfAnalogIOChannelNodeSet', 1, 1, 1, -5.0); % V- -5V calllib('dwf','FDwfAnalogIOEnableSet', 1, 1); % master enable pause(1) % wait to settle end unloadlibrary('dwf') %% Generate a Periodic Waveform and Record Input ...
  24. Hi @ca_michelle Protocol/CEC is added to the latest WF version:
  25. Hi @TheoMaria Probably you are using an old version of WF runtime 3.7.2 which is currently required by the DAQ AD support package. If you are using the support package this will open the device then the other functions can be called, like this function DWFtest2(); % make sure daq opens device daqlist("digilent") dq = daq("digilent") ch_in = addinput(dq, "AD1", "1", "Voltage"); [singleReading, startTime] = read(dq) % 32 bit system %hfile = 'C:/Program Files/Digilent/WaveFormsSDK/inc/dwf.h'; %64 bit system hfile = 'C:/Program Files (x86)/Digilent/WaveFormsSDK/inc/dwf.h'; if ~libisloaded('dwf') loadlibrary('dwf', hfile); end if calllib('dwf','FDwfAnalogIOStatus', 1) == 0 % see if device is connected disp('No opened device') else disp('Enable PS') calllib('dwf','FDwfAnalogIOChannelNodeSet', 1, 0, 0, 1.0); % V+ enable calllib('dwf','FDwfAnalogIOChannelNodeSet', 1, 0, 1, 5.0); % V+ 5V calllib('dwf','FDwfAnalogIOChannelNodeSet', 1, 1, 0, 1.0); % V- enable calllib('dwf','FDwfAnalogIOChannelNodeSet', 1, 1, 1, -5.0); % V- -5V calllib('dwf','FDwfAnalogIOEnableSet', 1, 1); % master enable end unloadlibrary('dwf') end
×
×
  • Create New...