10-07-2010 12:31 PM
This is driving me nuts... I have a gyro spitting 32 bits of data at me.. The first (MSB's are status bits) I have stripped these off
and left myself with a 26 bit data string that is in two's complement. Of course the positive convertion works fine.....
but how do I have Lab View deal with the negative numbers ??
10-07-2010 01:22 PM - edited 10-07-2010 01:22 PM
I don't quite understand what you are asking.
You have a binary string that is 32 bits coming back from an instrument.
Is this a floating point single precision value (32-bit SGL) ?
Why do you only have 26 bits left?
And what is "twos compliment"
10-07-2010 01:33 PM - edited 10-07-2010 01:43 PM
Is you data in a I32 format?
Cory, this is the format http://en.wikipedia.org/wiki/Two's_complement common for signed integers
Check and see if this work. It is from the top of my head 😉
10-07-2010 01:47 PM
Eh that was wrong try this. And the edit time was up 😞
10-07-2010 01:53 PM
After stripping the k MSBs, left shift k times. Then an I32 correctly interprets the twos complement. Divide by 2^k. Result is an I32 containing the value sent by the instrument.
Lynn