Own software versus PicoLog sampling for TC08-USB

Post general discussions on using our drivers to write your own software here
Post Reply
Guest

Own software versus PicoLog sampling for TC08-USB

Post by Guest »

Hello.

I've created some software in C++ to store temperature readings from a TC08 USB unit in an array temp_array - see code fragment below. My problem is that when measuring the same temperature variation using the same settings (1500 samples @ 200ms interval), my software produces a graph of temperature data which is "compressed" compared to that produced by PicoLog. This compression is of about 10%. I thought that the problem might be that around 1 in 10 samples were being overwritten in the array, but I cannot see a problem with my code which would cause that. Another explanation is that each of the sampling interval is slightly longer than 200ms, but the values stored in the time_array state that the interval is indeed 200ms. I would be very grateful if someone could suggest what the problem is here.

Code fragment:
-------
tc08_handle = usb_tc08_open_unit();
usb_tc08_set_mains(tc08_handle, 0);
usb_tc08_set_channel(tc08_handle, 1, 'K');

usb_tc08_run(tc08_handle, 200);

overflow = 0;
total_number_of_readings = 0;
temp_array_index = 0;

while (total_number_of_readings < 1500)
{
number_of_readings = usb_tc08_get_temp(tc08_handle, temp_buffer, time_buffer, buffer_length, overflow, 1, 0, 0);

total_number_of_readings = total_number_of_readings + number_of_readings;

Thread::Sleep(1000);

for (i = 0; i < number_of_readings; i++)
{
temp_array[temp_array_index+i] = temp_buffer;
time_array[temp_array_index+i] = time_buffer;
}

temp_array_index = temp_array_index + number_of_readings;
}

usb_tc08_stop(tc08_handle);
usb_tc08_close_unit(tc08_handle);
-------

Guest

Post by Guest »

Hello.

I'm still struggling with this problem. Does anyone have any ideas at all? Even guesses would be welcome...

ziko
Advanced User
Advanced User
Posts: 1705
Joined: Fri Dec 01, 2006 10:03 am
Location: St Neots

Post by ziko »

Hi a couple of our software engineers have had a look at this, could you send me a file with your results indicating where the problem is and what you are expecting.

Kind regards
Ziko

Technical Specialist

Post Reply