User manual

Chapter 5 Transducer Conversion Functions
NI-DAQ User Manual for PC Compatibles 5-2 ni.com
The conversion routines are included in NI-DAQ as source files rather than
driver function calls so that you have complete access to the conversion
formulas. You can edit the conversion formulas or replace them with your
own to meet your applications specific accuracy requirements. Comments
in the conversion source code simplify the process of making only
necessary changes.
A header file for each language (
convert.h
for C/C++,
convert.bas
for Visual Basic) contains the constant definitions used in the conversion
routines. Include or merge this header file into your application program.
The transducer conversion routine descriptions apply to all languages.
Function Descriptions
RTD_Convert and RTD_Buf_Convert
These functions convert a voltage or voltage buffer that NI-DAQ reads
from an RTD into temperature.
Parameter Discussion
The convType integer indicates whether to use the given conversion
formula, or to use a user-defined formula that you have put into the routine.
0: The given conversion formula.
1: Use a user-defined formula that has been added to the routine.
Iex is the excitation current in amps that was used with the RTD. If a 0 is
passed in Iex, a default excitation current of 150 × 10
-6
A(150mA)is
assumed.
Ro is the RTD resistance in ohms at 0 °C.
A and B are the coefficients of the Callendar Van-Düsen equation that fit
your RTD.
The TempScale integer indicates which temperature units you want your
return values to be. Constant definitions for each temperature scale are
given in the conversion header file.
1: Celsius
2: Fahrenheit
3: Kelvin
4: Rankine