Omega Engineering 8 Channel Thermocouple USB Data Acquisition Module TC-08 User Manual page 13

8 channel thermocouple usb data acquisition module
Table of Contents

Advertisement

Example
The following code is a fragment of a C application demonstrating how to use
Streaming mode with the USB TC-08 driver:
//==================================================
// Setting up and running the unit in Streaming mode
//==================================================
usb_tc08_set_mains(handle,
for
(channel =
{
// 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 ' '
usb_tc08_set_channel(handle, channel, 'K');
}
// find out how fast the unit can sample in its current setup state
minimum_interval = usb_tc08_get_minimum_interval_ms(handle);
usb_tc08_run(handle, minimum_interval);
// not required (just illustrates that the application
// can be idle while the driver collects the readings)
10000
Sleep(
);
// use a two dimensional array with an array of readings for each
channel
// In a real application, this would be a nested loop to regularly poll
// the unit for readings
for
(channel =
{
no_of_readings = usb_tc08_get_temp( handle,
}
// finished polling, now do something with the readings
// if overflows[channel] is high, then one of the readings
// in reading_buffer[channel] has exceeded the input range
// of the USB TC-08
// only stop the unit when we've completely finished streaming
usb_tc08_stop(handle);
Note: You should close down all other applications while you are performing any
timing-critical data logging tasks. Check that the Windows scheduler does not have
any activities planned during the logging session.
0
);
// use 50Hz mains noise rejection
0
9
; channel <
; channel++)
0
9
; channel <
; channel++)
&reading_buffer[channel],
&times_buffer[channel],
buffer_length,
&overflows[channel],
channel,
0
,
// degrees Celsius units
0);
// do not fill missing readings
Technical reference
// sample as fast as possible
9

Hide quick links:

Advertisement

Table of Contents
loading

Table of Contents