05-30-2018 01:15 AM
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.
Solved! Go to Solution.
05-30-2018 01:26 AM
Use "Boolean to (0,1)". You can put it inside the loop or outside converting whole Boolean array in numeric array
05-30-2018 06:52 AM
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.
05-30-2018 07:26 PM
Thank you very much, problem solved.