Counting bits

Recommended Posts


I have a stupid question..

I'm trying to sum up some bits (to see how many are active) and I got into some sort of a problem, you'll probably have no problem with..

When I paste the following into the watch monitor it works

+from.Bit(bit4)+ From.Bit(bit5)+From.Bit(bit6))

I get a nice number of active bits..

but when I put the code in a sequence and assign it to a global variable it does not work..


Strange numbers appear..

What do you think could be the problem or am I handling it wrong and should do it another way?

thank you!

Link to comment
Share on other sites


This topic is now archived and is closed to further replies.