TC-08 (USB): Reading temperature in Kelvins problem

 
Post new topic   Reply to topic    Pico Technology Forum Index -> General Software Discussions
Author Message
duxxx001
Active User
Active User


Joined: 07 Jun 2005
Posts: 6
Location: Edinburgh

PostPosted: Thu Jun 16, 2005 1:06 pm    Post subject: TC-08 (USB): Reading temperature in Kelvins problem Reply with quote

I have a problem getting right temperature in Kelvins from the driver for the last channel (8.). Cold Junction temperature and first seven channels work OK, but 8. channel always output temperature in degrees Celsius.

Here is the C code that verifies that:
Code:
/**************************************************************************
 * C program for reading temperatures from TC-08 (USB) device in Kelvins
 * author: Dusan P Djurdjevic, Edinburgh UNI, 2005.
 ***************************************************************************/

#include <stdio.h>
#include "usbtc08.h"

#define TC_TYPE_K 'K'

int main()
{
  short       hTC08;
  int            i;
  float     buf1[10], buf2[10];
  short     overflow;

  // open unit
  hTC08 = usb_tc08_open_unit ();
 
  // check if everything OK
  if (hTC08 <= 0)
      {
      printf("Error Code: %d\n",usb_tc08_get_last_error (0));
      return(99);
      }


  // set channels
  for (i=0; i<=8; i++) usb_tc08_set_channel (hTC08, i, TC_TYPE_K);



  // read temperature in Celsius Kelvin
  usb_tc08_get_single(hTC08, buf1, &overflow,USBTC08_UNITS_CENTIGRADE);
  usb_tc08_get_single(hTC08, buf2, &overflow,USBTC08_UNITS_KELVIN);

  // write output
  printf("%10s %10s %10s\n","Channel No","C","K");
  for (i=0; i<=8; i++) printf("%-10d %10.3f %10.3f\n", i, buf1[i], buf2[i]);
}


Results from the program:
Code:
D:\Projects\Experiments_SEE\Driver\Drivers\Win32>kelvin_problem.exe
Channel No          C          K
0              25.757    298.757
1              25.467    298.595
2              25.544    298.555
3              25.695    298.672
4              25.743    298.643
5              25.503    298.444
6              25.698    298.621
7              25.312    298.235
8              25.772     25.728

This problem does not appear if I use other Temperature units (Rankine or Fahrenheit).

My feeling is that problem is in the driver, where temperature conversion takes place, and if ther is a loop, upper boundary of that loop should be increased by 1.
Back to top
Sarah
Guest





PostPosted: Tue Jun 21, 2005 11:40 am    Post subject: Reply with quote

Hi

Thank you for your post.

We have investigated this and found that there was an error in the driver. We have corrected this and if you email tech@picotech.com requesting a copy then we will send it to you.

Best Regards
Back to top
duxxx001
Active User
Active User


Joined: 07 Jun 2005
Posts: 6
Location: Edinburgh

PostPosted: Fri Jul 01, 2005 8:41 am    Post subject: Reply with quote

Sarah wrote:

We have investigated this and found that there was an error in the driver. We have corrected this and if you email tech@picotech.com requesting a copy then we will send it to you.


Many Thanks Sarah.
Actually it would be of great help if the source code of the driver is available. In that case, more developers could be involved, and maintaining of such piece of software would be much easier.

Regards,
Dusan
Back to top
Sarah
Guest





PostPosted: Fri Jul 01, 2005 9:24 am    Post subject: Reply with quote

Hi Dusan

Thank you for your post.

I do see your point, however Pico do not release the source code for their drivers. If you see any potential programming errors with them then let us know and we will investigate for you.

Best Regards
Back to top
Display posts from previous:   
Post new topic   Reply to topic    Pico Technology Forum Index -> General Software Discussions
All times are GMT
Page 1 of 1

 


Pico Technology topic RSS feed 
Powered by phpBB © 2001, 2005 phpBB Group