LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

boolean arrays



@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.

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.
----------------------------------------------------------------------------------
I have still not got what I love.....
0 Kudos
Message 11 of 18
(1,157 Views)

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  07.00 in the morning.. ( Like an alarm system.) Either I need to put it in event structure to watch change in values in the array, or I need to have a vi with a while loop running all the time..

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 2..

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..

0 Kudos
Message 12 of 18
(1,146 Views)

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 :

 

0 Kudos
Message 13 of 18
(1,138 Views)
Benji I got your point. But you have to figure out the programming part because I can't see the whole picture right?
What I gave you was the reseting part. You have to take care of the timing cases.
Why each element has a timing constraint?
----------------------------------------------------------------------------------
I have still not got what I love.....
0 Kudos
Message 14 of 18
(1,134 Views)
Hello Benji,
I made this VIs for you. I hope they do what you need. You have to run the Wrapper- VI.



This is the BD of the core- VI, where set Detectors are counted up in the Alarm Counts- Array.

greets, Dave


Message Edited by daveTW on 04-28-2008 02:17 PM
Greets, Dave
0 Kudos
Message 15 of 18
(1,129 Views)

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

0 Kudos
Message 16 of 18
(1,122 Views)
Hai Benji,
 
This is in LV8.0
Message 17 of 18
(1,115 Views)

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..

0 Kudos
Message 18 of 18
(1,092 Views)