Quantcast
Channel: Measurement Studio for .NET Languages topics
Viewing all articles
Browse latest Browse all 1999

very slow single sample temperature measurement

$
0
0

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.

 


Viewing all articles
Browse latest Browse all 1999

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>