03-09-2010 09:24 AM
Hello,
is there anyone can help me with this problem? I having difficulties to turn on the LED after the comparison i made.
This is the situation, i input a value and using conditional method to compare the input then after the comparison the output would be just come out one or zero. Therefore, if the output is one then the LED will light on but zero will result in turning off the LED.
Here is situation: How to convert the output number to the Boolean so that it will turn on the LED?
Best Regards,
Nicky
03-09-2010 09:27 AM
03-09-2010 09:31 AM
03-09-2010 09:31 AM
Hi,
The comparison have been made. Just that, I want to convert the output number to Boolean so that it will light up the LED. If i just connect the output to the Boolean, there is an error which stated that the number is no compatible to boolean true or false. I have used Number to Boolean but thre is no use..
03-09-2010 09:38 AM
03-09-2010 09:38 AM - edited 03-09-2010 09:41 AM
Not Equal to Zero will give you a boolean.
03-09-2010 09:39 AM
03-09-2010 09:42 AM
You have not used the not equal to zero function. Place it on your block diagram and connect it to the output of the formula node. You should also be working with ints if you are going to do equal/not equal comparisons.
p.s. The use of the formula node seems silly. Why don't you just do it all in LabVIEW?
This is very basic LabVIEW programming. Have you taken the free tutorials?
03-09-2010 09:44 AM - edited 03-09-2010 09:45 AM
Why are you using a formula node in the first place? Let me guess: you're a C programmer trying to do LabVIEW. Am I right? Gotta be, especially given the line if (x || y == 1). Booleans in LabVIEW are their own datatype, unlike Booleans in C, which are just integers. Forget the formula node. All you need is to implement the True condition of your test, which is if (x > 0 OR y == 1) using LabVIEW Boolean operators and Comparison functions.
To learn more about LabVIEW it is recommended that you go through the tutorial(s) and look over the material in the NI Developer Zone's Learning Center which provides links to other materials and other tutorials. You can also take the online courses for free.
P.S. In the future please crop your images.
03-09-2010 09:46 AM - edited 03-09-2010 09:47 AM
I couldn't edit this drawing fast enough to beat Dennis & smercurio's posts... 😉
But they are correct..
If the content of the formula node is what you want to do, then what I posted earlier should do the trick. They do the same thing. If the ring control selection is not zero, it will light up the boolean indicator.