Jump to content
  • 0

Discarded samples when sampling >2Mhz with SDK


Tood

Question

Hi,

I am sampling DIO 7 from wavegen GUI. The mode is record without triggers. Sampling rate is 4MHz.
I am using 16x16k buffers. The results are perfect. No corrupt samples (see picture below).

When I am using sample code digitalin_record.cpp as base and sampling above 2MHz the result is a lot of corrupt samples.
See attached C file digitalin_record.c.

My OS is win10 and the compiler is gcc. Output from digitalin_record.exe:

$ ./digitalin_record.exe
Open automatically the first available device
Starting record...
receivedSamples: 93743 discardedCorruptSamples: 83844
sample:0  pinstate:0x01b9
sample:1  pinstate:0x01b9
sample:2  pinstate:0x01b9
sample:3  pinstate:0x01b9
sample:4  pinstate:0x01b9
sample:5  pinstate:0x01b9
sample:6  pinstate:0x01b9
sample:7  pinstate:0x01b9
sample:8  pinstate:0x01b9
sample:9  pinstate:0x01b9
sample:10  pinstate:0x01b9

What is wrong with my implementation?

Best Regards,
Tood

 

wave_forms_4mhz_sampling.thumb.JPG.7a7a36307dcbae382e3f34e13df2e337.JPG

digitalin_record.c

Link to comment
Share on other sites

2 answers to this question

Recommended Posts

  • 0

Hi @Tood

Use data compression by specify the interested DIOs, like for DIO 7 only:
FDwfDigitalInSampleSensibleSet(hdwf, 1<<7)

See DigitalIn_Record_Compress.py

image.png.79adcb2a3fdd9e7cd2d166d057cc2bdf.png

 

You can also set the FDwfDigitalInTriggerPrefillSet 0 to start streaming data only after trigger and specify samples after trigger with FDwfDigitalInTriggerPositionSet.

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...