LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

how to convert a double to boolean array

Hi,
I'm looking a way to convert a double in a boolean array of 64 elements and viceversa.
0 Kudos
Message 1 of 12
(6,452 Views)
Please test this example.

Good luck!
0 Kudos
Message 2 of 12
(6,452 Views)
Well, I guess that your boolean variable shall be true above or below a certain specified value.
You can use the > or < function on the double array. The result should be the boolean array you are looking for.

Stephan
0 Kudos
Message 3 of 12
(6,452 Views)
The version posted by miguel doesn`t work properly on my machine.

Try this modified version. The problem was the coercion of the bouble (8 byte) to a U32 (4 byte) in the "number to boolean array" funtion.

Shane
Using LV 6.1 and 8.2.1 on W2k (SP4) and WXP (SP2)
0 Kudos
Message 4 of 12
(6,452 Views)
maybe i didn't undertand your answer or you didn't undestand the question: only 1 double in an array of boolean...
0 Kudos
Message 5 of 12
(6,452 Views)
it doesn't work: the number to array works only for 32 bit!!!!
0 Kudos
Message 6 of 12
(6,452 Views)
Thankyou: this maybe works but i founded something simpler, if You are ineterested, i'm working on this, to find a way to reverse it.
0 Kudos
Message 7 of 12
(6,452 Views)
Well, I thought you are looking to process a threshold value fast, but as I have learned from the other postings you are looking for a method to convert a double value to a binary value (which is represented as a array of boolean).
Sorry for my misunderstandig!

Stephan
0 Kudos
Message 8 of 12
(6,452 Views)
You`re doing basically the very same as in my example. Granted, it looks simpler, but the operations are basically the same.

Also, my version has already incorporated a method to reverse the operation. Look carefully at my example, and you`ll see that the DBL is re-created from the boolean array.

Shane.
Using LV 6.1 and 8.2.1 on W2k (SP4) and WXP (SP2)
Message 9 of 12
(6,452 Views)
Hi,
In addition to these examples, I also thought this link might be useful to you.

http://digital.ni.com/public.nsf/websearch/DD5AFE8E829DC16D86256BDF005E1F95?OpenDocument

Good luck,
FerozP
0 Kudos
Message 10 of 12
(6,252 Views)