Reads an analog input channel, linearizes it according to the selected temperature sensor type, if required, and returns the temperature in units determined by the Scale argument.
The CJC channel, the gain, and sensor type are read from the InstaCal configuration file. Run the InstaCal configuration program to set these items.
Member of the MccBoard class.
VB .NET
Public Function TIn(ByVal chan As Integer, ByVal scale As MccDaq.TempScale ByRef tempValue As Single, ByVal options As MccDaq.ThermocoupleOptions) As MccDaq.ErrorInfo
C# .NET
public MccDaq.ErrorInfo TIn(int chan, MccDaq.TempScale scale, out float tempValue, MccDaq.ThermocoupleOptions options)
chan
Input channel to read.
scale
Specifies the temperature scale that the input is converted to. All scale settings are MccDaq.TempScale enumerated constants. Choices are Celsius, Fahrenheit, Kelvin, Volts, and NoScale.
tempValue
The temperature in units determined by the Scale argument is returned here.
options
Bit fields that control various options. Set it to one of the constants in the "options parameter values" section below.
All of the options settings are MccDaq.ThermocoupleOptions enumerated constants. To set a variable to one of these constants, you must refer to the MccDaq object and the ThermocoupleOptions enumeration (for example, variable= MccDaq.ThermocoupleOptions.Filter or variable = MccDaq.ThermocoupleOptions.NoFilter).
| Filter | When selected, a smoothing function is applied to temperature readings, very much like the electrical smoothing inherent in all hand held temperature sensor instruments. This is the default. Ten samples are read from the specified channel and averaged. The average is the reading returned. Averaging removes normally distributed signal line noise. |
| NoFilter | When selected, the temperature readings are not smoothed, resulting in a scattering of readings around a mean. |
| WaitForNewData | Waits for new data to become available. |
Refer to the board-specific information in the Universal Library User's Guide to determine if your hardware supports these options.
Refer to board-specific information in the Universal Library User's Guide to determine if your hardware supports these options.
For CIO-EXP boards, the channel number is calculated using the following formula:
chan = (ADChan × 16) + (16 + MuxChan)
where:
ADChan is the A/D channel that is connected to the multiplexer.
MuxChan is a number ranging from 0 to 15 that specifies the channel number on a particular bank of the multiplexer board.
For example, you have an EXP16 connected to a CIO-DAS08 via the CIO-DAS08 channel 0. (Remember that DAS08 channels are numbered 0, 1, 2, 3, 4, 5, 6 and 7). If you connect a thermocouple to channel 5 of the EXP16, the value for Chan would be (0 × 16) + (16 + 5)= 0 + 21 = 21.
The CJC channel is set in the InstaCal installation and configuration program. If you have multiple EXP boards, the Universal Library will apply the CJC reading to the linearization formula in the following manner:
For example: You have four CIO-EXP16 boards connected to a CIO-DAS08 on channel 0, 1, 2 and 3. You choose CIO-EXP16 #1 (connected to CIO-DAS08 channel 0) to have its CJC read on CIO-DAS08 channel 7, AND, you leave the CIO-EXP16's 2, 3 and 4 CJC channels to NOT SET. Result: The CIO-EXP boards will all use the CJC reading from CIO-EXP16 #1, connected to channel 7 for linearization. It is important to keep the CIO-EXP boards in the same case and out of any breezes to ensure a clean CJC reading.
If an OUTOFRANGE or OPENCONNECTION error occurs, the value returned in TempValue is -9999.0. If a NOTREADY error occurs, the value returned in TempValue is -9000.
If the EXP board is connected to an A/D that does not have programmable gain (DAS08, DAS16, DAS16F) then the A/D board range is read from the configuration file (CB.CFG). In most cases, hardware selectable ranges should be set to ±5 V for thermocouples, and 0–10 V for RTDs. Refer to the board-specific information in the Universal Library User's Guide or in the user manual for your board. If the board has programmable gains, the TIn() method will set the appropriate A/D range.