Showing results for 
Search instead for 
Did you mean: 

how to build an Boolean array?

Go to solution

I've a Boolean in a while loop which is alternating "true, false, true, false… ". How can write them into an Array like "1, 0, 1, 0…"? Thanks.

0 Kudos
Message 1 of 4
Accepted by topic author Jason2018

Use "Boolean to (0,1)". You can put it inside the loop or outside converting whole Boolean array in numeric array

_____________________________________ - Interface-based multiple inheritance for LabVIEW OOP
Message 2 of 4

Bool to (0,1) takes care of the Boolean to 0,1 conversion.


Building an array in a while loop can be done in several ways, depending on your needs.


1) If the array is needed when the loop is done, wire the scalar Boolean through the while loop. Right click the terminal and set tunnel mode to indexing. The output of the loop will be an array.

2) If you require previous array elements in new loop iterations, create a shift register with an empty array constant wired to it. Use Build Array to prepend or append elements to it.

Message 3 of 4

Thank you very much, problem solved.

0 Kudos
Message 4 of 4