Hi Dan
Just a few questions before I can help you. Are you using LabVIEW, if so which version. Are you using NI-DAQmx driver, again if so which version. When you receive the underflow warning do you also encounter an error code and description of the warning? Would it be possible to post the message and code in your next post.
You can setup buffer size and sampling rate via LabVIEW. Using the DAQmx API makes this very easy using the DAQmx Timing.vi
Kindest Regards
Yatin | NIUK & Ireland