LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Bit Complement in an Expression Node

I can use bit complement in a formula node but not the expression node. The
"~" tilde is the only text in the expression node. The error is "~#" with
# being the error. The input is a U8. Thanks in advance for any help.
0 Kudos
Message 1 of 7
(3,524 Views)
Hello Pat,
The way to fix this problem is fairly simple, if you change your inputs and outputs to I8, u16 or I16 it will run correctly.
Regards,
Catherine Petronino
National Instrument
www.ni.com/ask
0 Kudos
Message 2 of 7
(3,524 Views)
Hi Catherine,
I've tried your suggestion earlier and tried it again after your
post but it still doesn't work. I am new to expression nodes so maybe my
syntax is incorrect. To do the same in C language I think it looks like
this: "a = ~ b". I made a picture and a copy of the error. Let me know
if you see anything wrong. Thanks!

Error on line 1 is marked by a '#' character: "~#"
[Image]

Pat S.


cfpautx wrote:

> Hello Pat,
> The way to fix this problem is fairly simple, if you change your
> inputs and outputs to I8, u16 or I16 it will run correctly.
> Regards,
> Catherine Petronino
> National Instrument
> www.ni.com/ask
0 Kudos
Message 3 of 7
(3,524 Views)
Hi Catherine,
I've tried your suggestion earlier and tried it again after your
post but it still doesn't work. I am new to expression nodes so maybe my
syntax is incorrect. To do the same in C language I think it looks like
this: "a = ~ b". I made a picture and a copy of the error. Let me know
if you see anything wrong. Thanks!

Error on line 1 is marked by a '#' character: "~#"
[Image]

Pat S.


cfpautx wrote:

> Hello Pat,
> The way to fix this problem is fairly simple, if you change your
> inputs and outputs to I8, u16 or I16 it will run correctly.
> Regards,
> Catherine Petronino
> National Instrument
> www.ni.com/ask
0 Kudos
Message 4 of 7
(3,524 Views)
Hi Catherine,
I've tried your suggestion earlier and tried it again after your
post but it still doesn't work. I am new to expression nodes so maybe my
syntax is incorrect. To do the same in C language I think it looks like
this: "a = ~ b;". I made a picture and a copy of the error. Let me know
if you see anything wrong. Thanks!

Error on line 1 is marked by a '#' character: "~#"
[Image]

Pat S.


cfpautx wrote:

> Hello Pat,
> The way to fix this problem is fairly simple, if you change your
> inputs and outputs to I8, u16 or I16 it will run correctly.
> Regards,
> Catherine Petronino
> National Instrument
> www.ni.com/ask
0 Kudos
Message 5 of 7
(3,524 Views)
Pat,

the correct syntax is "~x". The expression node requires that you use a variable (x) that stands for the input value.


LabVIEW, C'est LabVIEW

Message 6 of 7
(3,524 Views)
The solution works as stated. You simply cannot use U8 types... for whatever reason "~x" in the expression node works fine for the other types.
0 Kudos
Message 7 of 7
(3,524 Views)