I have previeously posted a question on this subject:
"ADV11/12 How do you set samplerate when streaming", but I didn't get an answer, so I try again.
I am streaming continuously, and would like to be able to set the sampling rate, here is my code:
n:=Channels_Count(channels); //n is the same as No_Channels
actual := adc11_set_interval (TargetTime, BUFFER_SIZE, channels, n);
adc11_run (BUFFER_SIZE, BM_STREAM);
//Wait for data!
while Not(adc11_ready) do
//Get the data!
while Not(kbhit) do
no_of_values := adc11_get_times_and_values (mytimes, myvalues, BUFFER_SIZE);
//Process the data!
//Wait before getting the next datablock!
Now, this code works, but it takes quite a while before I start getting samples, if I set a samplingrate of 1 second I have to wait around 15 seconds before I start to get readings! is that normal behaviour?
At the same time the samplerate is not precisely 1 second but 0.999424 if I sample one channel and 0.901120 if I sample all 11 channels?
I find that the samplerate changes is a little pussling, because if I set the samplerate to say 1ms I get exactly 1ms, so why does it change just because I choose a longer sampleperiod?
If I continue to stream data as described above, I get a Errormessage from MEMMGR saying: End guard damaged File adc11usb.c line 1410
Is there some kind of handling that I have forgotten, it seams like I am running out of memoryspace, stackspace or something like that?
Regards Palle Koch