04-28-2008 06:58 AM
But Thomas we have to count for each individual boolean and not the whole array. Then if three booleans are true then they sum up to 3 which is not what we want. If a single boolean is 3 times true, then reset the whole array.
@ThomasV wrote:
Best way to count how many elements of a boolean array are true :[boolean array] --------[Boolean to (0,1)-function]-------------[Add array elements-function](change boolean to zero's and one's, and calculate the total sum of all values)Thomas.
04-28-2008 07:03 AM
Hi Halemani, and thank’s again for your example..
We are getting closer..
Let me explain more to you..
This vi should monitor a building from 23.00 until
Let me explain more to you..
Each detector can stay active/high for more than 1 second, and another only for about 200ms, it depends on what activity there is in the room.. So let’s say you put a Boolean array in a while loop, and push one button.. lets say you activate element nr. 5.. it should read 1.. leave it there, and activate element nr. 2.. it should read 1 too, switch off element too.. it should still read 1, and the next time you activate element 2 it should be nr
Element nr. 5 that you activate earlier should still show 1 if it’s still active.. So.. the first element that reach a specific number 3, should reset the array, but the whole vi still need to run and watch the building.. I don’t know if you understand better, but I hope so..
I have study the dsc alarm vi’s, but I need to involve an error margin, that’s why I need some pulses from each detector to be sure that there is somebody in the room..
04-28-2008 07:08 AM
I am sorry,
If I understand correctly, you want to detect if a boolean is true for 3 successive read-operations.
This is then what you need :
04-28-2008 07:11 AM
04-28-2008 07:14 AM - edited 04-28-2008 07:17 AM

04-28-2008 07:20 AM
Hi Dave...
Thank's a lot.. I will try this out..
Is it possible for you to convert the vi you attached to LV8.0 ??
Regards from Benjii
04-28-2008 07:23 AM
04-28-2008 07:42 AM
Dave... THANK you...
I have tested your vi a little bit, and it work's great.. It worked just the way I wanted..
Thanks again.. Very best regards Benjii..