ni.com is currently undergoing scheduled maintenance.

Some services may be unavailable at this time. Please contact us for help or try again later.

LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Problem with formula node

Solved!
Go to solution

Hi,

I am using LabVIEW 2012 and there seems to be a problem with the formula node. The output of a simple not operation is not correct.

I have a U8 input whose value is 255. I apply a not operation(a = ~a;) and value returned by the formula node is also 255.

 

Is it a bug in the node or is there some other way to compute bitwise NOT?


Thanks,

Ritesh

0 Kudos
Message 1 of 2
(2,771 Views)
Solution
Accepted by LVCoder

You need to use the Exclusive OR function.  So what you really need is:

a = a^0xFF

 EDIT:  Digging some more, it is called a "bit complement".  I would consider this a bug.  I'm seeing the same with 2011.



There are only two ways to tell somebody thanks: Kudos and Marked Solutions
Unofficial Forum Rules and Guidelines
"Not that we are sufficient in ourselves to claim anything as coming from us, but our sufficiency is from God" - 2 Corinthians 3:5
Message 2 of 2
(2,766 Views)