Darren,
Thanks for your commenets. I can see that the conversion from
unsigned to integer is causing the change. I am still confused
though. How does the integer indicator know to turn 2^32-1 into -1?
Why doesn't it report back 4,294,967,295 as the probe does?
that progressions of the various numbering systems I32, U32, I16, U16,
I8, U8. I see how it works, now. Is this setup "normal" in
programming?>
My original need is to report position in degrees instead of encoder
lines (7200 per rev). If I divide by 20 or multiply by 0.05 the
unsigned, 0 to 2^32-1, number, I get just that. It is OK when the
numbers are positive from the original 0. But when I spin b
ackwards
in the negative direction I get 4,294,967,295/20 = 214,748,364.75.
I have a workaround (create a local variable and divide it), but I
hate not understanding how the coersion is working. I guess my only
complaint is that this seems inelegant.
Maybe my question should be: What is the best way to show degrees
from the output of an encoder?
At least I now have a clearer understanding of the various
representations of numbers.
Mike
Darren wrote in message news:<5065000000050000004E600000-1012609683000@exchange.ni.com>...
> Mike,
>
> The raw position value coming out of the "Counter Get Attribute" VI is
> a U32 datatype. Since the U32 datatype does not support negative
> values, any "negative" position is going to be represented as a
> roll-over...so instead of -1, you'll get 2^32-1. If you take this U32
> value and wire it into an I32 indicator, the rollover value will be
> "correctly" displayed as a negative position value. That's why you
> see a coercion do
t on the indicator terminal for the "measured
> position" indicator...it is coercing a U32 value into an I32.
>
> I hope this explanation makes sense. Please let me know if you need
> any more clarification. Have a nice day.
>
> Darren