Jump to content

attila

Technical Forum Moderator
  • Posts

    6,461
  • Joined

  • Last visited

Everything posted by attila

  1. 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:
  2. 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 ...
  3. Hi @ca_michelle Protocol/CEC is added to the latest WF version:
  4. 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
  5. Hi @Zeyu If you don't want to post publicly you could sent a photo with the setup to me in private message, . Yes, see the DigitalOut_Phase.py example and the parameters can be like this:
  6. Hi @Richard Sharpe The TM devices use USB HS (2.0) and the maximum streaming rate is around 1-2MSps. The ADP3450/3250 has 1G Ethernet providing 1-4MSps. This device can also be used in embedded Linux mode with much higher transfer rate and lower latency. For embedded/FPGA development system see the Eclypse Z7 with Zmod.
  7. Hi @TheoMaria See the following:DWFtest.zip The server does not allow me to add m code or m file, here you have a picture: calllib('dwf','FDwfParamSet', 4, 0); % DwfParamOnClose continue on Run calllib('dwf','FDwfDeviceAutoConfigureSet', phdwf.Value, 0); calllib('dwf','FDwfAnalogIOChannelNodeSet', phdwf.Value, 0, 0, 1.0); % V+ enable calllib('dwf','FDwfAnalogIOChannelNodeSet', phdwf.Value, 0, 1, 5.0); % V+ 5V calllib('dwf','FDwfAnalogIOChannelNodeSet', phdwf.Value, 1, 0, 1.0); % V- enable calllib('dwf','FDwfAnalogIOChannelNodeSet', phdwf.Value, 1, 1, -5.0); % V- -5V calllib('dwf','FDwfAnalogIOEnableSet', phdwf.Value, 1); % master enable calllib('dwf','FDwfAnalogIOConfigure', phdwf.Value); % configure device
  8. Hi @Malcolm It should be able to measure the phase. The NA can use FFT mag/phase averaging and in the latest beta version added coherent average mode for testing. See a related post:
  9. Hi @Zeyu The RPI GPIOs are 0/3.3V signals so these won't reach the specified 3.5V trigger level, reduce this to 1.5V. You could also generate the square signal with the other Wavegen channel or with any DIO 0/3.3V clock/pulse signal.
  10. Hi @LiamP What do you mean by "DC offset to trigger" ? For each instrument it can be specified the trigger slope, like rising, falling or either edge of external trigger, or wavegen rise when this starts and fall when stops. FDwfAnalogInTriggerConditionSet, FDwfAnalogOutTriggerSlopeSet, FDwfDigitalInTriggerSlopeSet, FDwfDigitalOutTriggerSlopeSet
  11. Duten tag @Fonso! Yes, the Ethernet phy provides isolation as well a WiFi dongle. For USB external isolator can be used. The cheaper ones, based on ADUM4160 are USB FS and will reduce the transfer rate. This will be mostly noticeable when streaming data, when using Scope/Logic record and Wavegen play modes. Isolation is recommended for safety when using multiple socket powered instrument and to reduce ground loops that could cause ringing, oscillation... in measurements. A self/battery powered tool is isolated so it is safe to use.
  12. Hi @maling It would be great if you could provide a description or code/script to reproduce the issue. The timeout failure should set some error message "API lock timeout", "Device lock timeout",...
  13. Hi @reddish The bitPerSample specifies the sample size, the number of DIO channel to control. Like 1: will output on DIO-0 the given bit array, 2: groups of 2 bits on DIO-0-1, ...
  14. Hi @Zeyu I've set to trigger and capture the same channel 2 to verify the trigger correctness. You can get the data from the channel 1 as well: dwf.FDwfAnalogInStatusData16(hdwf, c_int(0), byref(rgSamples1, sizeof(c_int16)*iSample), c_int(iBuffer), c_int(cSamples)) # get channel 1 data dwf.FDwfAnalogInStatusData16(hdwf, c_int(1), byref(rgSamples2, sizeof(c_int16)*iSample), c_int(iBuffer), c_int(cSamples)) # get channel 2 data
  15. Hi @LiamP Similar as it is done in the Device_Synchronization.py example, first configure each input and output channels (or the needed ones) in each device, and arm them, wait each to finish and get the data. for iDevice in range(cDevice.value): # open and configure dwf.FDwfDeviceOpen(c_int(iDevice), byref(hdwf)) ... rghdwf.append(hdwf.value) dwf.FDwfAnalogIn... # configure range, offset... for channels, frequency, trigger position... dwf.FDwfAnalogInTriggerSourceSet(rghdwf[iDevice], trigsrcExternal1) dwf.FDwfAnalogInConfigure(rghdwf[iDevice], c_bool(False), c_bool(True)) # arm inputs dwf.FDwfAnalogOutCount(hdwf, byref(cChannel)) for iChannel in range(cChannel.value): dwf.FDwfAnalogOut... # configure signal, amplitude, offset... run length... dwf.FDwfAnalogOutTriggerSourceSet(rghdwf[iDevice], c_int(iChannel), trigsrcExternal1) dwf.FDwfAnalogOutConfigure(rghdwf[iDevice], c_int(iChannel), c_bool(True)) # arm outputs while True: # wait for each device capture fDone = True for iDevice in range(len(rghdwf)): dwf.FDwfAnalogInStatus(rghdwf[iDevice], c_int(0), byref(sts)) if sts.value != dwfstateDone fDone = False break if fDone: break for iDevice in range(len(rghdwf)): # fetch and get data dwf.FDwfAnalogInStatus(rghdwf[iDevice], c_int(1), None) dwf.FDwfAnalogInChannelCount(rghdwf[iDevice], byref(cChannel)) for iChannel in range(cChannel.value): dwf.FDwfAnalogInStatusData(rghdwf[iDevice], c_int(iChannel), ... dwf.FDwfDeviceCloseAll()
  16. Hi @ca_michelle 1. Could it be the "Start interpreter form here" was set to T0 ? Try right click and "Reset starts" 2. You could use Record mode to capture up to 100M samples in Logic Analyzer. The Protocol/CEC is on the to-do list.
  17. Hi @tmk2z Each device is calibrated during the factory testing process. This should provide suffice precision but if you want you can recalibrate it with the WF app.
  18. Hi @Zeyu The default settings for channel 2 should be fine, 50Vpk2pk 0Voff. Here I have connected W1 to C2 and it triggers with your slightly modified script: t2.py
  19. Hi @bitstre@m In the next software version workspaces/projects will remember the expanded/collapsed state of groups (Bus, SPI...) Thank you for the observation.
  20. Hi @varunnagpaal Make sure the wiring is correct and the devices use common ground. Make sure the pullup voltage is correct, 3.3V or at least above 1.5V I managed to reproduce the "Transferring data" hold by setting the pullup to 1.5V This because at this level it is in hysteresis domain of the 3.3V logic. After the master releases the low drive it will not go up to logic high.
  21. Hi @Zeyu 1. Use argument 1 to fetch data dwf.FDwfAnalogInStatus(hdwf, c_int(1), byref(sts)) 2. On AD2 the Record mode, streaming over USB working at up to about 1-2MHz You could use 2nd configuration to have 16ki sample device buffer which can be used at up to 100MHz. The default, first configuration has 8kiS, 8192S 3. The generated signal is set to 5V amplitude, 10Vpk2pk. The Scope channel 1 range is set to 5Vpk2pk.
  22. Hi @Nithin Write from Python script to text or binary file and use WF app Logic/ File/ Import or Import Binary. The dwf3 files are compressed containing various parameters beside data.
  23. Hi @varunnagpaal In this setup there is no slave to acknowledge but it should work like this:
  24. Hi @spbhanus May I ask what the problem was.
×
×
  • Create New...