LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

boolean arrays

Boolean arrays..

Is there anybody that can help me to find a way to count how many times each boolean element in an array is high..

 

Here is what I want to do: 

The Boolean array read about 40 pir detectors. Each element in the array control lights, and I also need it to work as an alarm system. Many detectors can be active/high in the same time,

it only depends on how much movement there is in the area.

I want to count each element in the array, and when one of them reach a limit.. lets say “3”

the buffer(or memory) will reset all values to zero.

 

I have searched in this forum for a long time, but I can’t find any solution..

Is there anybody that have an idea, and can help me?? I use LV8.0

 

Very best regards

Benjii

0 Kudos
Message 1 of 18
(4,036 Views)
Here is the VI which resets each element of the shift register. It can be changed to array too. You wanted whole array to be reset?
Then put a FOR loop in that case and reset whole array.

----------------------------------------------------------------------------------
I have still not got what I love.....
0 Kudos
Message 2 of 18
(4,022 Views)
Hello Benji,
this Vi determines, if the number of trues exceed a given count. there are sketched two ways.
greets, Dave




Message Edited by daveTW on 04-28-2008 12:16 PM
Greets, Dave
Download All
0 Kudos
Message 3 of 18
(4,013 Views)

Hi Benji,

here is another example for you. I understand it in this way. Hope it helps. Smiley Happy

Mike



Message Edited by MikeS81 on 04-28-2008 12:24 PM
Download All
0 Kudos
Message 4 of 18
(4,007 Views)

Hi, and thank's for your fast reply..

Either I didn't explain clearly, or you have missunderstood me.. I have tried many solutions before, but I haven't been lucky to solve this yet... Your exemple wotks fine, but I need to explain to you how I want it to work..

Let's say that one pir detector(element in array) is high for about 500ms, and then goes low again..  Next time the same detector goes high, it will count 2 (for this specific element).. the next time.. 3 etc.. And in the mean time the same could happen to other elements in the array. When one of the array element  reach the counting level 3, an alarm will be active..  and all counters for the arrays, or memory will be reseted.

Thanks again.. regards Benjii

0 Kudos
Message 5 of 18
(3,990 Views)
0 Kudos
Message 6 of 18
(3,984 Views)

Hi Mike...  and thank's for your answer and example..

It didn't work in the way I wanted it to be, but if you read my second explanation, maybe you can help me.. In the mean time.. thanks..

regards from Benjii

0 Kudos
Message 7 of 18
(3,960 Views)

Sorry for this. Damn, no delete post hereSmiley Mad

Message Edited by Halemani on 04-28-2008 06:22 AM

Message Edited by Halemani on 04-28-2008 06:24 AM
----------------------------------------------------------------------------------
I have still not got what I love.....
0 Kudos
Message 8 of 18
(3,953 Views)
Hi, this should help you.
The while loop takes in the boolean values and the case structures deal with the  resetting the array.
If you want delay just put in the proper loop!  Smiley Wink
----------------------------------------------------------------------------------
I have still not got what I love.....
0 Kudos
Message 9 of 18
(3,951 Views)
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.


Message Edited by ThomasV on 04-28-2008 06:40 AM

Message Edited by ThomasV on 04-28-2008 06:46 AM
0 Kudos
Message 10 of 18
(3,928 Views)