
DNA/DNR-AI-217 Simultaneous Sampling Differential Analog Input Board
Chapter 2 16
Programming with the High Level API
Tel: 508-921-4600 www.ueidaq.com Vers: 4.5
Date: April 2013 DNx-AI-217 Chap2x.fm
© Copyright 2013
United Electronic Industries, Inc.
2.3.2 Thermocouple
Measurement
For thermocouples, use the object method CreateTCChannel which automat-
ically handles temperature calculations, as follows:
2.3.3 RTD
Measurement
RTD measurements are configured using the Session object method
“CreateRTDChannel”.
RTD sensors are resistive sensors whose resistance varies with temperature.
Knowing the resistance of an RTD, we can calculate the temperature using the
“Callendar Van-Dusen” equations.
RTD sensors are specified using the "alpha" (α) constant. It is also known as the
temperature coefficient of resistance, which defines the resistance change fac-
tor per degree of temperature change. The RTD type is used to select the proper
coefficients A, B and C for the Callendar Van-Dusen equation, which is used to
convert resistance measurements to temperature.
To measure the RTD resistance, we need to know the amount of current flowing
through it. We can then calculate the resistance by dividing the measured volt-
age by the known excitation current.
To measure the excitation current, we measure the voltage from a high precision
reference resistor whose resistance is known.
The reference resistor is built-into the terminal block if you are using a DNA-
STP-AI-U, but you can provide your own external reference resistor, if prefered.
In addition, you must configure the RTD type and its nominal resistance at 0°
Celsius, as shown in the following example:
// Configure channel 0 to 2, scaling for thermocouples;
// thermocouple Type K, degrees F°, using CJC built-in
// compensation from the STP-AI-U board, in differential mode.
mySs.CreateTCChannel("pdna://192.168.100.2/Dev0/Ai0:2",
-10.0, 10.0,
ThermocoupleType.TypeK,
TemperatureScale.Fahrenheit,
ColdJunctionCompensationType.BuiltIn,
0, "",
AIChannelInputMode.Differential);
// Add 4 channels (0 to 3) to the channel list and configure them to
// measure a temperature between 0.0 and 200.0 deg. C.
// The RTD sensor is connected to the DAQ device using two wires, the
// excitation voltage is 5V, and the reference resistor is the 20kOhm
// resistor built-into the DNA-STP-AI-U.
// The RTD alpha coefficient is 0.00385, the nominal resistance at 0° C
// is 100 Ohms, and the measured temperature will be returned in °C.
MySession.CreateRTDChannel(“pdna://192.168.100.2/dev0/Ai0:3”,
0, 1000.0, UeiTwoWires, 5.0,
UeiRefResistorBuiltIn, 20000.0,
UeiRTDType3850, 100.0,
UeiTemperatureScaleCelsius,
UeiAIChannelInputModeDifferential);
Commenti su questo manuale