LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

nubmer to Boolean

Hi all : I want to change number i32 to Boolean value ,, is there an object to do that  Thanks\
0 Kudos
Message 1 of 11
(4,107 Views)

You can convert a number to a binary array in the numeric toolbox -> Conversion -> number to binary array function

 

Is this what you mean?

_____________________________
- Cheers, Ed
Message 2 of 11
(4,103 Views)

 

Are you converting a number greater than 1? If so, yes, it is called Number to Boolean Array.

 

You can find it in the Boolean or Numeric palettes.

 

R

 

 

Message Edited by JoeLabView on 09-02-2008 08:51 AM
Message 3 of 11
(4,100 Views)

I know this object this convert number to array ,, don't want to convert to array because I have one number only

0 Kudos
Message 4 of 11
(4,094 Views)

One number can have, regarding of it's "resolution" many different states where the boolean can only have two. So the easiest way to do a conversion like you want one is to compare the number with a certain value (better use > or <, not = )....

 

hope this helps,

Norbert 

Norbert
----------------------------------------------------------------------------------------------------
CEO: What exactly is stopping us from doing this?
Expert: Geometry
Marketing Manager: Just ignore it.
Message 5 of 11
(4,090 Views)

As you may be able to tell, we have not understood your request.

 

Please illustrate what you would like so we can help further.

 

Wild guess:

 

Have you tried using the bit-wise operations available by using the boolean functions like "And" with a bit mask?

 

Ben

Retired Senior Automation Systems Architect with Data Science Automation LabVIEW Champion Knight of NI and Prepper LinkedIn Profile YouTube Channel
Message 6 of 11
(4,084 Views)
Probably a simple ">0" from the comparison palette will do what you want?
Message 7 of 11
(4,083 Views)

JoeLabView wrote:

 

Are you converting a number greater than 1? If so, yes, it is called Number to Boolean Array


 

JLV, You can use number less than 1 as well. Twos complement is used 🙂

_____________________________
- Cheers, Ed
Message 8 of 11
(4,080 Views)

I guess Elyan wants to convert a number into a binary string 😉

So, as explained at least one thousand times in this forum :

- if this is just for display : just change the display format

     1/ select the indicator type (U8, U16,...I32...  integers only) : right click >> representation.
     2/ ask for "binary" format : right click >> Format and Precision >> Binary
- for other purposes, search the forums !!!!!! For instance here, or here...
Message Edité par chilly charly le 09-02-2008 04:53 PM
Chilly Charly    (aka CC)
Message 9 of 11
(4,041 Views)

yenknip wrote:

JLV, You can use number less than 1 as well. Twos complement is used 🙂


I realize that, but I didn't understand (still don't) why the question was being asked.  I figured, if the person want to convert numbers 0 or 1 to a boolean, then I would have suggested something different.  Converting a "number" to boolean has to give you an array to represent each bit that defines that number..

 

As CC mentionned, similar questions were asked 1000 times...  with just about as many variations on what is actually needed 😉

"Converting a number to boolean" is too vague a question..  SO our answers are just as vague.. LOL! 😄

Message 10 of 11
(4,034 Views)