I have a NI 9213 thermocouple module. The specs give it a sample rate of 1200 samples per second. Here's my C# code:
Task task = new Task();
task.AIChannels.CreateThermocoupleChannel("cDAQ1Mod1/ai1","",0,100,AIThermocoupleType.T,AITemperatureUnits.DegreesC);
AnalogSingleChannelReader reader = new AnalogSingleChannelReader(task.Stream);
double data = reader.ReadSingleSample();
The problem is that it's taking 700 ms to get each temp, which seems very slow. When I use the NI Measurement and Automation Explorer Test Panel, it's getting measurements at the rate of about 6 per second (or ~160 ms), which I could live with. I've tried lots of things. I was on the phone with NI tech support for a few hours and made zero progress. He kept trying to get me to set task.Timing.ConfigureSampleClock(), but no combination of parameters would even let it run without crashing. In the NI Test Panel, I'm using the mode "On Demand" rather than "Finite" or "Continuous", and in the "On Demand" mode, both Rate and Sample# are grayed out, so I'm guessing the ConfigureSampleClock() doesn't even apply to me. I've also tried only initializing on the first pass instead of new Task and reader each time. Doesn't help. I've been pounding on this problem for about a month now. Any suggestions appreciated.