LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Holding a boolean value for 500 ms

Solved!
Go to solution

Hi everybody,

 

I'm fairly new at LabVIEW programming, so I thought you could help me with a project for a course I'm taking.

 

We are to develop a peak detector VI to measure the time between and show the peaks in an ECG signal. To this, we utilize a Boolean indicator, which lights up when a peak is detected. The only problem is, that the indicator doesn't light up (we've concluded that it is because of the sampling frequency is too high, so the input changes from TRUE to FALSE too quickly to register, but feel free to comment on that conclusion). That's why I am thinking if it is possible to hold a Boolean value for an extended period of time, say 500 ms, even though the indicator is being fed FALSE logical values in the meantime?

 

Hope you can help me and thanks in advance!

 

Neergaard

0 Kudos
Message 1 of 15
(3,880 Views)

One solution could be to send an event or occurance when a peak is found which lights a boolean and pause for 500ms. If the listener is a separate loop it wont affect the measurement.

/Y

G# - Award winning reference based OOP for LV, for free! - Qestit VIPM GitHub

Qestit Systems
Certified-LabVIEW-Developer
0 Kudos
Message 2 of 15
(3,873 Views)

You also might try "high light execution"  and see if the signal is getting to the LED?

 

Alan

 

 

0 Kudos
Message 3 of 15
(3,867 Views)
Solution
Accepted by Neergaard69

 

Spoiler
peak_VI_BD.png

 

 

you can OR' it to a "false initialized shift registered"

0 Kudos
Message 4 of 15
(3,861 Views)

Could you elaborate a bit on that? What is the wiring in the Event structure, Type, Time, CtlRef, OldVal, NewVal etc.? And would the pause be made possible by a Wait or a Wait until next multiple?

0 Kudos
Message 5 of 15
(3,857 Views)
You probably dont need the event wires, only the fact that it fires asynchronosly. In the event you can True the led, wait 500ms and False it.
/Y
G# - Award winning reference based OOP for LV, for free! - Qestit VIPM GitHub

Qestit Systems
Certified-LabVIEW-Developer
0 Kudos
Message 6 of 15
(3,850 Views)

Okay, I'm not really familiar with the Event structure and how it works (I'm fairly new to LabVIEW), but from what I understand I can just create an Event structure, wire the boolean true/false signal from the outside to the Event structure border, and then just put a LED inside in the event of it changing values, and then what?

0 Kudos
Message 7 of 15
(3,847 Views)

Almost, unless you create User events you dont need to wire anything to the event structure. In the structure you Add event and User event (the pretty solution) or LED value change-event (less pretty, but will probably work for now).

When an event is activated windows send a signal this event catches and activaes the correct event. It'll need to be in a loop else it'll only fire once. 🙂

Simple example attached.

/Y

G# - Award winning reference based OOP for LV, for free! - Qestit VIPM GitHub

Qestit Systems
Certified-LabVIEW-Developer
0 Kudos
Message 8 of 15
(3,829 Views)

@Yamaeda wrote:

Almost, unless you create User events you dont need to wire anything to the event structure. In the structure you Add event and User event (the pretty solution) or LED value change-event (less pretty, but will probably work for now).

When an event is activated windows send a signal this event catches and activaes the correct event. It'll need to be in a loop else it'll only fire once. 🙂

Simple example attached.

/Y


your vi made absolutely no sense? i modified it...

Message 9 of 15
(3,822 Views)

Heh, i was just showing how the event works, but with your addition the OPs question is almost solved. 😉

 

/Y

G# - Award winning reference based OOP for LV, for free! - Qestit VIPM GitHub

Qestit Systems
Certified-LabVIEW-Developer
0 Kudos
Message 10 of 15
(3,814 Views)