This is the same problem as last time but figured I'd start a new thread so we can start fresh (you can forget the old thread I've included all the info in this one).
I use your ADC-16 onboard an underwater vehicle and have uploaded the settings file to my Website:
I'm trying to write a new interface for it but find that the values in the included VB6 sample project don't match up to the readings I get when I run my settings file. These are the values I get:
PicoLog Recorder reads:
Water alarm 2154mv
Heading 303 degrees
Pod Vacuum 1.02bar
Pod Vacuum 0.17bar
Pod Vacuum 1.02bar
24v Monitor 24.12 volts
Depth -0.0metres
Sample VB6 Program reads
Ch1 0.534065766384357
Ch2 2193.33180743114 *
Ch3 279.2401 *
Ch4 -0.1525902 *
Ch5 280.346379797055
Ch6 199.47356 *
Ch7 538.33829251545 *
Ch8 518.120088502327 *
The program has been modified to the same resolution as the settings file:
- Code: Select all
ok% = adc16_set_channel(port, 1, 13, 1, 10)
ok% = adc16_set_channel(port, 2, 16, 1, 10)
ok% = adc16_set_channel(port, 3, 13, 1, 10)
ok% = adc16_set_channel(port, 4, 13, 1, 10)
ok% = adc16_set_channel(port, 5, 13, 1, 10)
ok% = adc16_set_channel(port, 6, 13, 1, 10)
ok% = adc16_set_channel(port, 7, 14, 1, 10)
ok% = adc16_set_channel(port, 8, 14, 1, 10)
and carries out the following calculation on the Timer event (not sure if I changed that:
- Code: Select all
(value * 2500) / 65535
Now according to your last post I have to calculate the actual values using
Resolution |Maximum ADC value
8| 255
9| 511
10| 1023
11| 2047
12| 4095
13| 8191
14| 16383
15| 32767
16| 65535
(5 * raw value/max ADC value) -2.5
So I realise that the conversion formula I use is incorrect but - when I use that to calculate the Channel 1 value it read (I get a raw value of 13.9982760000001 ) and then put that through the correct formula:
(5 * raw value/8191) -2.5
I get -2.4915 which is completely off the 2154mv reading your software gave.
The installed software is version 5.16.2.
Cheers,
Michael
Cart


