USB TC08 User guide Copyright 2004 Pico Technology Limited. All rights reserved.
I USB TC-08 Help Table of Contents Part I Introduction 2 1 Overview ................................................................................................................................... 2 2 Installing ................................................................................................................................... the driver 2 3 Connecting ...................................................................................................................................
Introduction 1 Introduction 1.1 Overview 2 The USB TC-08 is a temperature and voltage logger designed to support multiple thermocouples. With the accompanying PicoLog software, the unit can be used with any laptop or PC running Windows 98SE, ME, 2000, XP, and higher. If you are technically-minded and want to tailor the product to a particular application, you can write your own programs with the supplied driver. The driver provides cold junction compensation for thermocouples.
3 USB TC-08 Help 3. Click the OK button. The Sampling Rate dialog box appears 4. Click the OK button. The Converter details dialog box appears 5. Select USB TC-08 from the drop-down list of converters. The device name and serial number should appear in the USB Devices pane and the USB enumeration progress bar gradually expands to 100%. If the progress bar does not start moving, disconnect and reconnect the USB TC-08, then click Refresh 6. In the USB Devices pane, select the USB TC-08.
Introduction 4 The following dialog box appears 8. In the TC-08 Channels window, double-click on Channel 1 unused The Edit TC-08 Channel dialog box appears 9. From the Thermocouple drop-down list, select the type of thermocouple you are using and click the OK button. The TC-08 Channels dialog box reappears 10. Click the OK button. Channel 1 should now appear in the monitor window with the current temperature reading. Copyright 2004 Pico Technology Limited. All rights reserved.
5 1.4 USB TC-08 Help Legal information The material contained in this release is licensed, not sold. Pico Technology Limited grants a license to the person who installs this software, subject to the conditions listed below. Access The licensee agrees to allow access to this software only to persons who have been informed of these conditions and agree to abide by them. Usage The software in this release is for use only with Pico products or with data collected using Pico products.
Introduction 1.5 6 Safety warning We strongly recommend that you read the general safety information below before using your product for the first time. If the equipment is not used in the manner specified, then the protection provided may be impaired. This could result in damage to your computer and/or injury to yourself or others. Maximum input range The USB TC-08 is designed to measure voltages in the range of ±70mV. Any voltages in excess of ±30V may cause permanent damage to the unit.
7 1.6 USB TC-08 Help Company details Address: Pico Technology Limited The Mill House Cambridge Street St Neots Cambridgeshire PE191QB United Kingdom Phone:+44(0)1480396395 Fax:+44(0)1480396296 Email: Technical Support support@picotech.com Sales sales@picotech.com Web site: www.picotech.com Copyright 2004 Pico Technology Limited. All rights reserved.
Product information 2 Product information 2.1 Specifications Resolution Thermocouple types Number of input channels Conversion time - per active channel Conversion time - CJC Uncalibrated accuracy Full scale input Common mode range Overvoltage protection Input impedance Input connectors Output connector Power requirements Environmental conditions 8 20bits(16.25 NFR) B,E,J,K,N,R,S,T 8 100ms 100ms The sum of ±0.2% and ±0.5 °C ±70mV ±7.
9 2.2 USB TC-08 Help How a thermocouple works A discovery by T. J. Seebeck almost 150 years ago opened the way for modern thermoelectric circuitry. In 1831, Seebeck discovered that an electric current flows in a closed circuit of two dissimilar metals when one of the two junctions is heated with respect to the other. In such a thermocouple circuit the current continues to flow as long as the two junctions are at different temperatures.
Technical reference 3 Technical reference 3.1 Introduction 10 The USB TC-08 is supplied with driver routines that you can build into your own programs. The USB TC-08 driver is supported by the following versions of the Windows operating system: 98SE, ME, 2000, and XP. Once you have installed the software, the DRIVERS directory will contain the drivers and a selection of examples of how to use the drivers. The driver is supplied as a Windows DLL.
11 USB TC-08 Help 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, 0); // use 50Hz mains noise rejection for (channel = 0; channel < 9; channel++) { // set each channel up as a type K thermocouple // channel 0 is the cold junction and will be ena
Technical reference 3.2.3 12 Get Single mode Get Single mode is an operational mode in which readings are produced on demand, using the usb_tc08_get_single function. Since the function relies entirely on the timing of the calling application, it is ideal for time intervals of greater than 1 minute. If high-speed sampling is required, use Streaming mode. 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.
13 USB TC-08 Help printf("\nChannel %d overflowed", c); } else // no overflow { printf("\nChannel %d: %f", c, value_array[c]); } } if (i < 9) { while (60000 > (GetTickCount() - last_time)) // 60000ms = 1 minute { Sleep(100); // let other applications run } last_time = GetTickCount(); } } 3.2.
Technical reference 14 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;
15 USB TC-08 Help 3.3 Driver routines 3.3.1 Introduction The following table explains each of the USB TC-08 routines: Routine Description New USB and serial mode usb_tc08_open_unit Opens the USB TC-08 unit and gets a valid USB handle. usb_tc08_open_unit_async Opens the unit asynchronously. usb_tc08_open_unit_progress usb_tc08_close_unit Polls the unit's enumeration progress during asynchronous operation. Closes the handle. usb_tc08_stop Stops the unit streaming.
Technical reference 3.3.2 New USB mode and legacy mode 3.3.2.1 usb_tc08_open_unit 16 short usb_tc08_open_unit (void) This routine returns a valid handle to the USB TC-08 if the driver successfully opens it. In the case of the routine failing, see the error code explanations in the usb_tc08_get_last_error section. If you wish to use more than one USB TC-08, this routine should be called once for each unit connected to the PC the function will return 0 if there are no more units found.
17 USB TC-08 Help // could terminate the application here } // // Start using the open units // 3.3.2.2 usb_tc08_open_unit_async short usb_tc08_open_unit_async (void) This routine begins enumerating USB TC-08 units in the background and provides a return immediately, so the calling thread can continue executing other code. Note: The driver is thread safe and will not allow access to a single unit from more than one application.
Technical reference 18 // could terminate the application here } // No errors, so start polling usb_tc08_open_unit_progress // continuously for its enumeration state do { result = usb_tc08_open_unit_progress(&handle, &progress); switch (result) { case USBTC08_PROGRESS_FAIL: // enum equates to: -1 error_code = usb_tc08_get_last_error(0); printf("Unit failed to open\nThe error code is %d", error_code); // could terminate the application here break; case USBTC08_PROGRESS_PENDING: // enum equates to: 0 printf
19 USB TC-08 Help Returns: -1 (USBTC08_PROGRESS_FAIL) An error occurred, call usb_tc08_get_last_error with a handle of 0 to obtain the error code. 0 (USBTC08_PROGRESS_PENDING) Enumeration has not completed (keep calling usb_tc08_open_unit_progress) . 1 (USBTC08_PROGRESS_COMPLETE) Enumeration has completed and the handle is now valid. 3.3.2.4 usb_tc08_close_unit short tc08_close_unit(short handle) This routine closes the unit for a specified USB handle.
Technical reference 3.3.2.6 20 usb_tc08_set_mains short usb_tc08_set_mains( short handle, short sixty_hertz) This routine sets the USB TC-08 to reject either 50 or 60 Hz. Arguments: handle sixty_hertz - Specifies the USB TC-08 unit. - Specifies whether to reject 50Hz or 60Hz. If set to 1, the unit will reject 60Hz, if set to 0, the unit will reject 50Hz. Returns: 0 1 - Use usb_tc08_get_last_error. - Mains rejection set correctly.
21 USB TC-08 Help This routine gets the unit information and copies it to the USBTC08_INFO structure, declared in the usbtc08.h header file. If zero is passed to the function as the handle, only the driver version member will be valid, but the function will return 1 (success.) Arguments: handle info - Specifies the TC-08 unit. - A pointer to a structure containing unit information. Returns: 0 1 3.3.2.9 - Use usb_tc08_get_last_error. - Routine was successful.
Technical reference 22 User/Developer error codes: Error Error code 0 USBTC08_ERROR_OK 1 USBTC08_ERROR_OS_NOT_SUPPORTED Further information No error occurred. Need to use Windows 98 SE (or later) or Windows 2000 (or later.) 2 USBTC08_ERROR_NO_CHANNELS_SET A call to usb_tc08_set_channel is required. 3 USBTC08_ERROR_INVALID_PARAMETER One or more of the function arguments were invalid. 4 USBTC08_ERROR_VARIANT_NOT_SUPPORTED The hardware version is not supported. Download the latest driver.
23 USB TC-08 Help Arguments: handle - Specifies the USB TC-08 unit. -1 - Invalid handle. - See the error code information above for further explanation. Returns: Error code 3.3.3 New USB mode only 3.3.3.1 usb_tc08_set_channel short usb_tc08_set_channel ( short handle, short channel, char tc_type) You should call this routine once for each channel that you want to use. You can do this any time after calling usb_tc08_open_unit. By default, all channels are disabled.
Technical reference 24 Returns: - Use usb_tc08_get_last_error. Interval - Actual interval allowed by the driver. 0 3.3.3.3 usb_tc08_get_single short usb_tc08_get_single( short handle, float * temp, short * overflow_flags, short units) The channels must be set up before calling this function, and the unit must not have been put into Streaming mode with usb_tc08_run, as this will cause usb_tc08_get_single to fail. The function will convert all readings on demand.
25 USB TC-08 Help float * temp_buffer, long * times_ms_buffer, long buffer_length, short * overflow, short channel, short units, short fill_missing) Once you open the driver and set up some channels, you can call the usb_tc08_run routine. The driver will then begin to continually take readings from the USB TC-08. Use the usb_tc08_get_temp routine to retrieve readings from the driver's buffer periodically.
Technical reference 26 Arguments: handle - Specifies the USB TC-08 unit. temp_buffer - Pointer to a location where the readings are to be placed. times_ms_buffer - Returns the time that the first channel was converted (optional.) buffer_length - Length of data buffers. overflow - Pointer to a variable that will be assigned a value of 1 if an overflow occured on any of the readings copied into temp_buffer, or 0 if an overflow did not occur.
27 3.3.3.5 USB TC-08 Help usb_tc08_get_temp_deskew long usb_tc08_get_temp_deskew ( short handle, float * temp, long * times, long buffer_length, short * overflow, short channel, short units, short fill_missing) Same as usb_tc08_get_temp but the times take account of small differences caused by the order in which channels are converted. Note: Unless there is a specific reason to use the usb_tc08_get_temp_deskewed routine, usb_tc08_get_temp should be used instead.
Technical reference 28 Returns: - An error occurred, use usb_tc08_get_last_error to get the code. - Currently no readings to collect. - Number of readings copied into array (there may still be more readings in the driver's internal buffer.) -1 0 > 0 3.3.4 Legacy mode only 3.3.4.1 usb_tc08_legacy_run short usb_tc08_legacy_run(short handle) This routine starts the sampling thread and forces the specified unit to run in legacy mode. Arguments: handle - Specifies the USB TC-08 unit.
29 USB TC-08 Help Arguments: handle - Specifies the USB TC-08 unit. channel - Specifies which channel you want to set the details for: This should be between 0 and 8. tc_type - Specifies what type of thermocouple is connected to this channel. Set to one of the following characters 'B', 'E', 'J', 'K', 'N', 'R', 'S', 'T.' Use a space in quotes to disable the channel. filter_factor - Specifies the size of the median filter.
Technical reference 30 Arguments: channel - Specifies from which channel to read temperature. Should be 0 for CJC, 1 for Channel 1, 2 for Channel 2 and so on. temp - Pointer to a location where readings are to be placed. Each reading should be compared with 2147483647L or LONG_MAX (include limits.h) to check for overflows. An overflow occurs when the input signal is higher than the measuring range of the USB TC-08. filtered - Specifies whether or not to filter the data.
31 USB TC-08 Help used. Arguments: none Returns: Driver version number 3.3.4.6 usb_tc08_legacy_get_version short usb_tc08_legacy_get_version (short * version, short handle) This routine sets the 'version' variable to match the version of the USB TC-08 currently being used. Arguments: handle - Specifies the USB TC-08 unit. version - Pointer to a location where the version number is to be stored. 0 - Invalid handle. 1 - Retrieval of version number successful.
Technical reference 3.3.4.7 32 usb_tc08_legacy_get_cycle short usb_tc08_legacy_get_cycle (long * cycle, short handle) This routine gives the number of complete cycles of readings taken from a particular USB TC-08. Calling usb_tc08_legacy_get_temp causes the most recent reading for the specified channel to be returned immediately. If you wish to record values only when the driver has taken a new reading, you can use this routine to find out how many complete cycles of readings the driver has taken.
33 USB TC-08 Help 3.4 Programming 3.4.1 Introduction We supply examples for the following programming languages: C and C++ Delphi Excel LabVIEW Visual Basic HP-Vee 3.4.2 C and C++ C The C example program is a generic Windows application: it does not use Borland AppExpert or Microsoft AppWizard. To compile the program, create a new project containing the following files: either or usb_tc08tes.c usb_tc08tes.rc usbtc08bc.lib (Borland 32-bit applications) usbtc08.
Technical reference 3.4.4 34 Excel The easiest way to transfer data to Excel is to use the PicoLog software application. If, however, you need to do something that is not possible using PicoLog, you can write an Excel macro which calls usbtc08.dll to read in a set of data values. The Excel Macro language is similar to Visual Basic. The example USBTC0832.XLS reads in 20 values of the cold junction temperature and channel 1 temperature, one per second, and assigns them to cells A1..B20. 3.4.
35 3.5 USB TC-08 Help Troubleshooting The following table lists each of the error codes described in the usb_tc08_get_last_error section, and divides them into categories, so that you know what to do in the event of a particular error occurring.
Technical reference 3.6 36 Glossary CJC A method of compensating for ambient temperature variations in thermocouple circuits. Cold junction compensation See CJC. Common mode range The voltage range, relative to the ground of the data logger, within which both inputs of a differential measurement must lie in order to achieve an accurate measurement. DLL An abbreviation for Dynamic Link Library.
37 USB TC-08 Help Type B thermocouple Type B thermocouples are made from platinum and rhodium and are suitable for high temperature measurements of up to 1820°C. Unusually, due to the shape of their temperature / voltage curve, type B thermocouples give the same output at 0°C as at 42°C. Type E thermocouple Type E thermocouples are made from chromel and constantan. They have a high output (68uV/°C), making them well suited to low temperature (cryogenic) use. They are non-magnetic.
Technical reference 38 typedef struct tUSBTC08Info { short size; short DriverVersion; short PicoppVersion; short HardwareVersion; short Variant; char szSerial[USBTC08_MAX_SERIAL_CHARS]; char szCalDate[USBTC08_MAX_DATE_CHARS]; }USBTC08_INFO,*LPUSBTC08_INFO; This structure is used to receive information from the usb_tc08_get_unit_info function and is defined in the usbtc08.h header file.
39 USB TC-08 Help Index -GGet single mode -CC 33 C++ 33 Cold junction 9 Connection 2 Contact details 7 -D- -EError codes Excel 34 -HHot junction 9 HP-Vee 34 -IImpedance Installation Delphi 33 DLLs 10 Driver routines 15 usb_tc08_close_unit 15, 19 usb_tc08_get_formatted_info 15, 21 usb_tc08_get_last_error 15, 21 usb_tc08_get_minimum_interval_ms 15, 20 usb_tc08_get_single 15, 24 usb_tc08_get_temp 15, 24 usb_tc08_get_temp_deskew 15 usb_tc08_get_unit_info 15, 20 usb_tc08_legacy_get_cold_junction 15, 30
Index Resolution 8 -SSafety 6 Specification 8 Streaming mode 10 -TThermocouple 9 Troubleshooting 35 -Uusb_tc08_close_unit 15, 19 usb_tc08_get_formatted_info 15, 21 usb_tc08_get_last_error 15, 21 usb_tc08_get_minimum_interval_ms 15, 20 usb_tc08_get_single 15, 24 usb_tc08_get_temp 15, 24 usb_tc08_get_temp_deskew 15 usb_tc08_get_unit_info 15, 20 usb_tc08_legacy_get_cold_junction 15, 30 usb_tc08_legacy_get_cycle 15, 32 usb_tc08_legacy_get_driver_version 15, 30 usb_tc08_legacy_get_temp 15, 29 usb_tc08_lega
Pico Technology Ltd The Mill House Cambridge Street St Neots PE19 1QB United Kingdom Tel: +44 (0) 1480 396 395 Fax: +44 (0) 1480 396 296 Web: www.picotech.