LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

How to accept only one true per given period of time

I'm stumped over what I believe is a pretty simple problem... I have a single boolean bit that gets evaluated once per minute... It is typically false... However, once in a while it goes true... When it goes true, some subsequent code runs and does some things... But, what's important, is after that bit goes true I want to ignore any subsequent trues for the next hour. Essentially I want to build a mask, like say an AND gate, where the boolean I mentioned is one input to that AND and the other input is a bit that will now be forced to stay false for the next hour. I have time in seconds as an input and I know how to use shift registers in a while or for loop to "store" time in said shift registers... But my problem is every time I try to write that seemingly simple code that goes off and holds a bit false while counting an hour's amount of time, I get into a "cycle" problem where outputs depend on inputs and so forth... Anyway, I know there is a simple answer but I'm just not seeing it... Anyone have some help to offer??? Again, in summary, I have a single bit that when it goes TRUE, I want to ignore and subsequent TRUES of that bit for the next 3600 seconds (1 hour). Any help on this would be much appreciated... Thanks... Bob...
0 Kudos
Message 1 of 4
(2,757 Views)
Do you mean something like this?
Its not the most elegant solution (lots of local variables) but it works I think. Should help you figure out a more elegant way.
Jeff


Using Labview 7 Express
Download All
Message 2 of 4
(2,746 Views)
Here is a quick and dirty way to do it.  I am sure there are better ways to implement this, but it works and is fairly simple.

It is saved in LV 8.2.
Kenny

0 Kudos
Message 3 of 4
(2,744 Views)
Just of note, I did not put any sort of wait in the while loop to slow it down (wait_ms or similar)  If you want to be able to see the output boolean change when you press the simulated bit button, you will have to turn on highlight execution or add in a wait_ms with 1000 (1 sec) or similar.
Kenny

0 Kudos
Message 4 of 4
(2,739 Views)