Omega Speaker Systems TC-08 manual Now do something with the cold junction temperature

Page 17

Technical reference

13

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, 0); // use 50Hz mains noise rejection

for (channel = 1; channel < 9; channel++)

{

//set each channel up as a type K thermocouple

//switch off filtering for all channels

usb_tc08_legacy_set_channel(handle, channel, 'K', 0);

}

usb_tc08_legacy_run(handle);

last_cycle_no = 0; no_of_readings = 0;

while (no_of_readings < 50) // collect 50 readings

{

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 = 1; channel < 9; channel++)

{

usb_tc08_legacy_get_temp( &reading[channel], handle, channel,

0);

}

//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);

Image 17
Contents User’s Guide Servicing North America Contents Page Overview Installing the driver Connecting the USB TC-08Refresh TC-08 Users GuideTC-08 Channels window, double-click on Channel 1 unused Safety grounding Safety warningMaximum input range Mains voltagesSpecifications How a thermocouple works Introduction IntroductionModes of operation Streaming mode ================================================== Example Get Single mode Usbtc08setmains handle, 0 // use 50Hz mains noise rejection Legacy mode Now do something with the cold junction temperature New USB mode only Routine Description New USB and serial modeLegacy mode only Driver routinesShort usbtc08openunit void New USB mode and legacy modeNone ArgumentsReturns Positive shortStore the handle in an array handlearrayi = newhandle Arguments None Returns Short usbtc08openunitasync voidHandle any error conditions if result == Progress HandleArguments handle Short tc08closeunit Short handleShort usbtc08stop Short handle Sixtyhertz Short usbtc08setmains Short handle, short sixtyhertzInterval Long usbtc08getminimumintervalms Short handleMinimum Info Short usbtc08getunitinfo Shorthandle, USBTC08INFO * infoUSBTC08MAXINFOCHARS characters long Short usbgetformattedinfo Handle Char UnitinfoStringlength User/Developer error codes Error Further information Code Short usbtc08getlasterror Short handleCode ErrorReserved error codes Tctype New USB mode onlyChannel Long usbtc08run Short handle, long interval Units TempOverflowflags Tempbuffer Long usbtc08gettemp Short Handle Float * tempbufferTimesmsbuffer OverflowShort Channel Units Fillmissing Long usbtc08gettempdeskew Short Handle Float * temp TimesShort usbtc08legacyrun Short handle Legacy mode onlyFilterfactor Filtered Short usbtc08legacygetcoldjunction Long * temp, short handle Driver version Number Short usbtc08legacygetdriverversion VoidVersion Short usbtc08legacygetversion Short * version, short handleCycle Short usbtc08legacygetcycle Long * cycle, short handleDelphi ProgrammingC++ LabVIEW ExcelVisual Basic Agilent VEEKey TroubleshootingCold junction compensation. See CJC GlossaryTechnical reference Page Index TC-08 Users Guide WARRANTY/DISCLAIMER Shop online at omega.com