Technical reference
12
© 2005 Pico Technology Limited. All rights reserved.
USBTC08044-2
Note: The function call overhead can be significant, since it takes approximately 360 ms
to convert all 9 channels, equating to 40 ms per channel. To reduce this overhead,
disable channels that are not required.
The following code is a fragment of a C application demonstrating how to use Get Single
mode with the USB TC-08 driver:
//========================================================
// Setting up and converting readings with Get Single mode
//========================================================
// use 50Hz mains noise rejection
// set each channel up as a type K thermocouple
// channel 0 is the cold junction and will be enabled
// by setting the third argument to anything other than ' '
// find out the approximate conversion time
// for a call to usb_tc08_get_single
usb_tc08_get_minimum_interval_ms
// Collect 10 readings over approximately 9 minutes
last_time = GetTickCount();
// do the conversion for all channels
// check for overflows on each channel
// with a bitwise & comparator
// shift the comparison bit to match the channel
"\nChannel %d overflowed"
(GetTickCount() - last_time))
// let other applications run
last_time = GetTickCount();