LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

How do I count how many times a control boolean is true

As part of a college project using LabVIEW 5.1.1 I am trying to count how many times a control boolean is set to true. Any help would be greatfully appreciated, plus if possible an example as I'm new to LabVIEW.

Thanks

Blip
0 Kudos
Message 1 of 7
(8,656 Views)
See if this helps you, if you need more info Ill explain more tomorrow but I need to run.

-Dave
Message 2 of 7
(8,646 Views)
Forgot something.....
Message 3 of 7
(8,645 Views)
Since Dave's VI was saved in LV 7.1, here's my contribution.
You use a shift register to check in each iteration of the loop whether the boolean value changed, and if it has whether it has changed to T or F. If it has changed to T, you increase the counter.
Keep in mind that this code can't catch changes that happen quicker than the loop rate - that means that if the value changed to T and then back to F before the loop could start again, it won't detect it. This is good for user input, but if you want software or hardware input, there are other methods.

___________________
Try to take over the world!
0 Kudos
Message 4 of 7
(8,628 Views)
Hi Blip,

I hope this helps. It is similar to what NIDave done. Also it is written in LV 5.1.

Regards

Seamus
0 Kudos
Message 5 of 7
(8,569 Views)

Great example, I was stuck but close.

Thanks for posting.

0 Kudos
Message 7 of 7
(3,451 Views)