i had a very similar problem, and it drove me nuts for a couple days til i realized what was up.
my card is the 6251. it has a maximum sample rate of 1,250,000 samples per second.
so when i was trying to take 1000 samples per *cycle*, and the
frequency of the sampled signal was 15kHz, i blew past the physical
limitations of the device, and I recall it giving me the same error
message that you described (attempting to read data not in
buffer). once i brought the rate back down, everything was fine.
i dont know about your card. i should think that 20,000 samples
per second is reasonable, but maybe you're exceeding its max? or
perhaps you are actually trying to read faster than you
intended? It's suspicious to me, since the
error message you're getting is the same that i was getting.