sync channel goes to 0

Post Reply
sinverso
Posts: 2
Joined: Thu Nov 24, 2005 2:03 am

sync channel goes to 0

Post by sinverso »

We are writing C++ acquisition software for the MK1 and were wondering what causes the sync channel to go to 0?

We are using Speed mode 5 (130 channels 4096 Hz). If we read from the ringbuffer as soon as 4 bytes per channel are ready it seems to work fine. However, if we wait for a sample block of 32 ints (128 bytes) per channel the sync channel becomes 0 after a second or so.

So, with the bigger sample block size, the time between READ_POINTER calls is longer because there are more samples to process; could this cause the system to become out-of-sync?

Thank you in advance for any help.

Sincerely,

-Sam

diz
Posts: 5
Joined: Sat Oct 16, 2004 8:54 am
Location: St.-Petersburg, Russia
Contact:

synch channel

Post by diz »

I can see two possible causes of the problem:
- size of ringbuffer (must be large enough to avoid overflow)
- arithmetics to calculate pointer offset in the ringbuffer

It'll be easier to discuss further possible problems if you'll give an example of your code (especially - place where you calculate current pointers)
WBR - DIZ

sinverso
Posts: 2
Joined: Thu Nov 24, 2005 2:03 am

Post by sinverso »

Hi Diz,

Thank you for your quick response.

It turned out the code to calculate the number of bytes available was accumulating too many times, so it looked like there were more bytes than actually existed in the buffer.
When displaying data from the buffer and checking the sync, we were moving past actual data, and everything seemed to turn to zeros because the buffer is initialized to all zeros.

The acquisition looks like its working fine now.

Thank you for your help.

Best regards,

-Sam

Post Reply