Signal Conditioning

cancel
Showing results for 
Search instead for 
Did you mean: 

how to use "if then..else..end if" in formula node

I want to use conditional expressions such as
if () then
statement
else
.
.
.
end if

in the formula node, but there were error messages "unassigned output". Anybody has an idea?

Thanks,

Lei Zhao
0 Kudos
Message 1 of 2
(3,985 Views)
Hi Lei,

The syntax for formula node would be
if (condition)
{statements to be performed if condition is true}
else
{statements to be performed if condition is true}

As a specific example you can copy and paste the following code into a formula node with one input x and two outputs y and z.
if (x<5)
{
y=4;
z=8;
}
else
{
y=8;
z=4;
}

You can also search on LabVIEW VI, Function and How-to help for more information on formula node in LabVIEW.

I hope it helps.

Ankita A.
0 Kudos
Message 2 of 2
(3,975 Views)