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

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 legacy
mode with the USB TC-08 driver:
//==========================================================
// Setting up and running the unit in Legacy mode
// This is designed to make it easier to adapt code written
// for the Serial TC08 for use with the USB TC08
//==========================================================
usb_tc08_set_mains(handle,
for
(channel =
{
// set each channel up as a type K thermocouple
// switch off filtering for all channels
usb_tc08_legacy_set_channel(handle, channel, 'K',
}
usb_tc08_legacy_run(handle);
last_cycle_no =
no_of_readings = 0;
while
(no_of_readings < 50)
{
usb_tc08_legacy_get_cycle(handle, &this_cycle_no);
if
(last_cycle_no != this_cycle_no)
{
last_cycle_no = this_cycle_no;
no_of_readings++;
for
(channel =
{
usb_tc08_legacy_get_temp( &reading[channel],
}
// now do something with the readings
// check that they have not overflowed
// by comparing each reading with 2147483647L
// or LONG_MAX (include limits.h)
usb_tc08_legacy_get_cold_junction(handle, &cold_junction);
// now do something with the cold junction temperature
}
}
usb_tc08_stop(handle);
0
);
// use 50Hz mains noise rejection
1
9
; channel <
; channel++)
0
;
// collect 50 readings
1
9
; channel <
handle,
channel,
0
);
; channel++)
Technical reference
0
);
13

Hide quick links:

Advertisement

Table of Contents
loading

Table of Contents