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: 

Integer Number ( Help )!!!!

Hello

 

I need help from one of you guys which is how can I do a LED light works when I use integer numbers like ( 1, or any integer value  ), and turns off when I use non-integer numbers like ( 0.6, or any non-integer value )

 

Thank for any help...

0 Kudos
Message 1 of 8
(4,380 Views)

Compare the number to the rounded version of itself.

0 Kudos
Message 2 of 8
(4,377 Views)

Sounds a lot like this topic.  Is this the same calculator?

Bill
CLD
(Mid-Level minion.)
My support system ensures that I don't look totally incompetent.
Proud to say that I've progressed beyond knowing just enough to be dangerous. I now know enough to know that I have no clue about anything at all.
Humble author of the CLAD Nugget.
0 Kudos
Message 3 of 8
(4,361 Views)

Thank you so much for every one who is trying to help me, but I am new in using this programe this is why I hope from u to give me more explanation,,,,

 

I use labview 2014

0 Kudos
Message 4 of 8
(4,352 Views)

I do not think so

0 Kudos
Message 5 of 8
(4,350 Views)

Is the number equal to the number when you round it to the nearest integer.  Yes?  It must be an integer.  No?  It must not be an integer.

0 Kudos
Message 6 of 8
(4,334 Views)

hi,

 

1. Divide your number by 1, use 'Quotient & Remainder' function.

2. If the remainder = 0 then LED is ON otherwise OFF.

 

Note: Change the data entry if you want it only for positive numbers

 

See the attached VI.Integer.png

-
Amit
CLAD
0 Kudos
Message 7 of 8
(4,288 Views)

Of course all this only works well if the number is not derived from a calculation involving fractions. For example, the following will deny that 1 (e.g. 10x0.1) is an integer.

 

 

 

You need to be careful!

 

 

Message 8 of 8
(4,279 Views)