Daqcvttcsetup – Measurement Computing TempBook rev.3.0 User Manual
Page 148

11-24 daqCommand Reference (Enhanced API)
TempBook User’s Manual
daqCvtTCSetup
DLL Function
daqCvtTCSetup(DWORD nscan, DWORD cjcPosition, DWORD ntc, TCType tcType, BOOL
bipolar, DWORD avg);
C
daqCvtTCSetup(DWORD nscan, DWORD cjcPosition, DWORD ntc, TCType tcType, BOOL
bipolar, DWORD avg);
Visual BASIC
VBdaqCvtTCSetup&(ByVal nscan&, ByVal cjcPosition&, ByVal ntc&, ByVal tcType&,
ByVal bipolar&, ByVal avg&)
Delphi
daqCvtTCSetup(nscan:DWORD; cjcPosition:DWORD; ntc:DWORD; tcType:TCType;
bipolar:longbool; avg:DWORD)
Parameters
nscan
The number of readings in a single scan of DaqBook/DaqBoard data. The daqCvtTC… functions can
convert several consecutive scans worth of data in a single invocation.
Valid range: 2 to 512.
cjcPosition
The position of the actual cold-junction compensation circuit (CJC) reading within each scan (not the CJC
zero reading, if any). The first reading of the scan is position 0, and the last reading is nscan -1. Each
scan of temperature data must include a reading of the CJC signal on the expansion board to which the
thermocouples are attached. The CJC readings must be taken with the gain in the section Scan Setup.
Valid range: 0 to nscan-2 with no zero compensation; 2 to nscan-2 with zero compensation.
ntc
The number of thermocouple signals that are to be converted to temperature values. The thermocouple
signal readings must immediately follow the CJC reading in the scan data. The first thermocouple signal
is at scan position cjcPosition+1,; the next is at cjcPosition+2,; and so on. Valid range: 1 to nscan-1-
cjcPosition.
tcType
The type of thermocouples that generated the measurements. Valid range: One of the pre-defined values,
TbkTCTypeJ, TbkTCTypeK, TbkTCTypeT, TbkTCTypeE, TbkTCTypeN28, TbkTCTypeN14,
TbkTCTypeS, TbkTCTypeR
or TbkTCTypeB.
bipolar
Must be set true (non-zero) if the readings were acquired with the Daq* set for bipolar operation. Must be
set false (zero) for unipolar operation. The required gain settings for the CJC and thermocouple channels
change depending on the unipolar/bipolar mode. Valid range: 0 for unipolar or any non-zero value for
bipolar.
avg
The type of averaging to be performed. Valid range: any unsigned integer. Since the thermocouple voltage
may be small compared to the ambient electrical noise, averaging may be necessary to yield a steady
temperature output.
0 specifies block averaging in which all of the scans are averaged together to compute a single temperature
measurement for each of the ntemp thermocouples.
1 specifies no averaging. Each scan’s readings are converted into ntemp measured temperatures for a
total of scans*ntemp results.
2 or more specifies moving average of the specified number of scans. Scan readings are averaged with the
avg-1 preceding scans’ readings before conversion. The first avg-1 scans are averaged with all of the
preceding scans because they do not have enough preceding scans. For example, if avg is 3, then the
results from the first scan are not averaged at all, the results from the second scan are averaged with the
first scan, the results from the third and subsequent scans are averaged with the preceding two scans as
shown in the table.
Returns
DerrTCE_PARAM
- Parameter out of range
DerrTCE_TYPE
- Invalid thermocouple type
DerrNoError
- No Error (also, refer to API Error Codes on page 11-39)
See Also
daqCvtTCConvert, daqCvtTCSetupConvert
Program References
None
Used With
All devices
daqCvtTCSetup
sets up parameters for subsequent temperature conversions. The next table
shows how averages are computed.
Scan
Readings
from
Channel
Results from Channel
0
1
0
1
1
1A
2A
1A
2A
2
1B
2B
(1A+1B)/2
(2A+2B)/2
3
1C
2C
(1A+1B+1C)/3
(2A+2B+2C)/3
4
1D
2D
(1B+1C+1D)/3
(2B+2C+2D)/3
5
1E
2E
(1C+1D+1E)/3
(2C+2D+2E)/3
6
1F
2F
(1D+1E+1F)/3
(2D+2E+2F)/3