I just tried everything again and switched from float64 to int32. All it would give me is 0's.
Probably because you are reading it as a double not as an integer. You have to define the location your reading it into to match. Same as how you defined "string" for a "string" -- you didn't read the string as a floating point number, now, did you?!
Thats one of the areas I haven't learned much about. converting 10128 once i had received it was confusing me as I didn't understand that it needed to be converted, nor did I uderstand how the conversion process should/would take place.
"BCD" means "binary coded decimal". It is actually already decoded in a more efficient manner. Your method, getting a floating point (or even integer) value in KHz might seem to make it easy, but this is only because you are then using a rather large library function to convert it to character format -- converting binary to decimal then characters.
BCD converts to decimal character form in a few very processor-efficient logical steps. Look:
123.45 is encoded as $2345 in BCD16.
That is, in binary: 0010 0011 0100 0101 (Each digit in hexc represents exactly 4 bits in binary).
Now the decimal character "0", in hex is $30, and the numerics "1" to "9" are incremental from that. So you can simply take a 4-bit digit from the BCD16 value, e.g. the 5 (binary 0101), add the charact '0', and get the character '5', directly. No library function, no long conversions.
Say the BCD16 for COM1 is in integer "nCom1". This bit of C code (sorry, I don't know the VB equivalent) would print the actual frequency in decimal:
printf("1%c%c.%c%c", // This is a formatting string meaning 1 then a character, then ... etc)
(nCom1 >> 12) + '0', // This shifts the BCD16 value to thev right 12 bits, so that the value left is from the top (left-most) 4 bits, then adds the '0' to get the correct character value
((nCom1 >> 8) & 15) + '0', // Same for the next 4 bits, but now we have to eliminate the bits above the 4. the and with 15 does this -- 15 is 1111 in binary, so selecting just 4 bits
((nCom1 >> 4) & 15) + '0', // The third digit, same way
(nCom1 & 15) + '0'); // and the last, needing no shifting as it is already in the right place.
Regards
Pete