Jump to content

Tamires

Members
  • Posts

    7
  • Joined

  • Last visited

Recent Profile Visitors

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

Tamires's Achievements

Newbie

Newbie (1/4)

0

Reputation

  1. Hi, I'm using Analog Discovery 2 to perform data acquisition through digital channels, in a C++ application, based on the DigitalIn_Sync.py code, available in the SDK. I want to choose which digital channels the data should be acquired (eg DI0, DI2, D8, D9 and D15). The function FDwfDigitalInStatusData(HDWF hdwf, void *rgData, int countOfDataBytes) gives me the data information of all 16 AD2 digital channels. Is there any function that I can specify the channels that I want to get the data and only they are given to me?
  2. Hey. I'm using Analog Discovery 2 to perform data acquisition through the two Oscilloscope channels and the 16 digital channels, using the AnalogIn_Record1.py and DigitalIn_Sync.py codes available in the SDK as a base. When executing the code most of the time I correctly get the number of samples I want according to the sampling rate and time, being the same for both digital and analog channels. In the code, I check the acquisition status and the program only exits the acquisition when the status of both (analog and digital) is completed. However, there are cases in which the acquisition is terminated, but there is a divergence between the number of samples obtained for analog and digital reading. Is this the correct and expected behavior? How should I go about solving this problem? Thanks for the help. For the tests I used the default acquisition configuration. As well as configuration 8. Below are some results: For the first setup: 1) cSamples Analog: 2000000 | cSamples Digital: 1967193 NO LOST ANALOG SAMPLES! Corrupted Analogs: 2210 NO LOST DIGITAL SAMPLES! Corrupted Digital: 4559 2) cSamples Analog: 12000000 | cSamples Digital: 11999912 NO LOST ANALOG SAMPLES! NOT CORRUPT ANALOG SAMPLES! NO LOST DIGITAL SAMPLES! NOT CORRUPT DIGITAL SAMPLES! 3) cSamples Analog: 18000000| cSamples Digital: 18000000 NO LOST ANALOG SAMPLES! NOT CORRUPT ANALOG SAMPLES! NO LOST DIGITAL SAMPLES! NOT CORRUPT DIGITAL SAMPLES! 4) cSamples Analog : 17991808 | cSamples Digital : 17987713 NO LOST ANALOG SAMPLES! Corrupted Analogs: 1074 NO LOST DIGITAL SAMPLES! NOT CORRUPT DIGITAL SAMPLES! 5) cSamples Analog : 17991808 | cSamples Digital : 17991809 NO LOST ANALOG SAMPLES! Corrupted Analogs: 120 NO LOST DIGITAL SAMPLES! NOT CORRUPT DIGITAL SAMPLES! 6) cSamples Analog : 35901696 | cSamples Digital : 35897601 NO LOST ANALOG SAMPLES! Corrupted Analogs: 10187 NO LOST DIGITAL SAMPLES! NOT CORRUPT DIGITAL SAMPLES! For configuration 8: 1) cSamples Analog : 36000000 | cSamples Digital : 36000000 NO LOST ANALOG SAMPLES! NOT CORRUPT ANALOG SAMPLES! NO LOST DIGITAL SAMPLES! NOT CORRUPT DIGITAL SAMPLES! 2) cSamples Analog : 4000000| cSamples Digital : 3999984 NO LOST ANALOG SAMPLES! NOT CORRUPT ANALOG SAMPLES! NO LOST DIGITAL SAMPLES! NOT CORRUPT DIGITAL SAMPLES! 3) cSamples Analog : 71860736 | cSamples Digital : 72000000 NO LOST ANALOG SAMPLES! NOT CORRUPT ANALOG SAMPLES! NO LOST DIGITAL SAMPLES! NOT CORRUPT DIGITAL SAMPLES! 4) cSamples Analog : 36000000 | cSamples Digital : 36000000 NO LOST ANALOG SAMPLES! NOT CORRUPT ANALOG SAMPLES! NO LOST DIGITAL SAMPLES! Corrupted Digital : 500 5) cSamples Analog : 71860736 | cSamples Digital : 72000000 NO LOST ANALOG SAMPLES! NOT CORRUPT ANALOG SAMPLES! NO LOST DIGITAL SAMPLES! NOT CORRUPT DIGITAL SAMPLES! 6) cSamples Analog : 71967232 | cSamples Digital : 72000000 NO LOST ANALOG SAMPLES! NOT CORRUPT ANALOG SAMPLES! NO LOST DIGITAL SAMPLES! NOT CORRUPT DIGITAL SAMPLES! 7) cSamples Analog : 71983616 | cSamples Digital : 72000000 NO LOST ANALOG SAMPLES! NOT CORRUPT ANALOG SAMPLES! NO LOST DIGITAL SAMPLES! Corrupted Digital : 660 8) cSamples Analog: 3967232 | cSamples Digital: 4000000 NO LOST ANALOG SAMPLES! Corrupted Analogs: 9166 NO LOST DIGITAL SAMPLES! Corrupted Digital : 9716
  3. Hi @attila. Thanks for the answer. You say that the recording/playback rate is between 1-2 MHz, but running the AnalogIn_Record.py and AnalogIn_Record1.py examples present in the WaveForms SDK did not get satisfactory results. The longer the acquisition time and consequently the number of samples I want to collect, the more samples are lost and corrupted for frequencies above 500 kHz. When executing AnalogIn_Record1.py exactly as it is and without making any changes (hzAcq = c_double(1000000) nSamples = 300000000 ) the program never leaves the loop ( while cSamples < nSamples: ) . What would be the other bottleneck and limitation for acquisitions greater than 500 kHz in addition to the USB bandwidth for samples to be lost and corrupted? Another question is how corrupted samples are handled internally? Because in several cases I have corrupted samples, but the generated .csv correctly presents the number of samples desired.
  4. Thank you, Attila. The FDwfDeviceConfigOpen function is just what I need. Where can I find the manual like the one in the image? Because the manual I have access to is different. Where he talks specifically about Analog Discovery 2 is on page 122 (13.3 Analog Discovery 2) and it has 132 pages in total, unlike the image that has 137 pages. I've updated the WaveForms and SDK at this point to see if the WaveForms SDK Reference Manual has had any changes, but it's the same as what I had before.
  5. Hi, I'm using Analog Discovery 2 to perform data acquisition through the two channels of the Oscilloscope, using the AnalogIn_Record.py code available in the SDK as a base. However, when the sampling frequency is greater than 600k Hz, samples are always lost and corrupted. For sampling periods longer than 120 seconds the losses are increased. Writing to a file takes almost the same time as acquisition, which makes the program uninteresting for the application I need. To minimize the effects of such a delay, I use a Thread that writes to file 'in parallel' with acquisition. With this, the problem of delay in writing to the file is satisfactorily minimized. However, the problem regarding corruptions and losses is not solved. The example program AnalogIn_Record.py does not present any solution to this problem. It only requests that the sampling frequency be reduced, which is not satisfactory. After all, Analog Discovery 2 supports frequencies higher than those I want to use. Is there any implementation better suited to mitigate such an error? Thank you in advance for your help.
  6. Hi, I'm using Analog Discovery 2 to perform data acquisition through the two channels of the Oscilloscope, using the AnalogIn_Record.py code available in the SDK as a base. I want to configure Oscilloscope channels with 2x16k buffers. And this way I want to get the Scope (2 x 16k) and Wavegen (2 x 1k) configuration, presented in the second line of the Waveforms Device Manager. By default the configuration is the one shown in the first line, Scope (2 x 8k) and Wavegen (2 x 4k). Studying the Waveforms SDK Reference Manual: the function FDwfAnalogOutDataInfo ( HDWF hdwf, int idxChannel, int *pnSamplesMin, double *pnSamplesMax) gives me the maximum buffer size information at 4096 samples for the output channels. The function FDwfAnalogInBufferSizeInfo (HDWF hdwf, int *pnSizeMin, int *pnSizeMax) tells me the maximum buffer size at 8192 samples for the Oscilloscope's input channels. The function FDwfAnalogInBufferSizeSet (HDWF hdwf, int nSize) should set the buffer size of the device's analog inputs. However, the function is ineffective, as any buffer value passed through this function is ignored and the device's default buffer size is used as the maximum buffer size. The function FDwfAnalogOutDataSet (HDWF hdwf, int idxChannel, double *rgdData, int cdData) should set the device's prefill buffer. However, the function is ineffective, as any buffer value passed through this function is ignored and the device's default size is used. How to properly configure device buffer sizes using the Python API? I want to configure Oscilloscope channels with 2x16k buffers. And this way I want to get the Scope (2 x 16k) and Wavegen (2 x 1k) configuration? Thanks in advance for your help.
×
×
  • Create New...