LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Creating Single impulse for datalogging event once?

Hi,

I've created a simple warning a system to light up a boolean when my
measurement exceeds a preset value. However I would like to data log the
time or date of the event when such event occurs.

The problem is when the warning lights up my log in multiple time due to the
while loop. Could someone please teach me how to generate a single impulse
from the boolean so that my log which is put into a case loop would only run
once when the boolean lights up?(single shot) Or is there other methods


Thanks in advance

Regards,
Richard
0 Kudos
Message 1 of 3
(2,843 Views)
Add a shift register to your loop. Initialize it to False. Connect the boolean to the right side terminal of the shift register. Compare the current value of the boolean to the prior value of the shift register. When the boolean is true and the shift register is false, the boolean has just changed and you should log the data. In all other cases do not log. Using the shift register this way detects the rising edge of the boolean. You could also detect the falling edge by looking for boolean = False and shift register = True.

Lynn
0 Kudos
Message 2 of 3
(2,843 Views)
Richard,
Just create a "last value" indicator (initialized to FALSE) and set it equal
to your Boolean in the loop. Then you write to your log only if the Boolean
is TRUE and the "last value" is FALSE.

Tom

"Richard" wrote in message
news:chr0va$kk4$1@mawar.singnet.com.sg...
> Hi,
>
> I've created a simple warning a system to light up a boolean when my
> measurement exceeds a preset value. However I would like to data log the
> time or date of the event when such event occurs.
>
> The problem is when the warning lights up my log in multiple time due to
the
> while loop. Could someone please teach me how to generate a single impulse
> from the boolean so that my log which is put into a case loop would only
run
> once when the boolea
n lights up?(single shot) Or is there other methods
>
>
> Thanks in advance
>
> Regards,
> Richard
>
>
0 Kudos
Message 3 of 3
(2,843 Views)