Precision

Forum for discussing PicoLog
Post Reply
erica

Precision

Post by erica »

Hi,

I have a ADC11/12 data logger and I am using C program to control it.

How do I increase the precision of the VALUES i get from using the function get_times_and_values? Currently I print out 4 figures e.g. 1250 corresponding to 1.25 V but I would like 1250324 corresponding to 1.250324

I have tried changing the data type in the declaration in the header file from unsigned int to double but doesn't seem to work.

thanx

e :)

User avatar
markspencer
Site Admin
Site Admin
Posts: 598
Joined: Wed May 07, 2003 9:45 am

Post by markspencer »

Hi,

The values that are returnes by the function adc11_get_times_and_values are a time in microticks (time parameter) and the ADC count (value parameter). The ADC count has to be converted into a voltage. If you are using a version 2 or version 3 unit (this can be found out by using the function adc_get_unit_info) the conversion formulea is as follows:

(A*2.5)/4095

where 2.5 is the maximum voltage measurable. 4095 is the highest ADC count available and A is the measured ADC count. To use this formulea you will get floating point or double precision depending on your variable types.

Best regards,
Regards,

Mark Spencer

Post Reply