11-28-2012 07:17 AM
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
Solved! Go to Solution.
11-28-2012 07:27 AM
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
11-28-2012 08:10 AM
You also might try "high light execution" and see if the signal is getting to the LED?
Alan
11-28-2012 08:19 AM - edited 11-28-2012 08:42 AM
11-28-2012 08:25 AM
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?
11-28-2012 08:35 AM
11-28-2012 08:39 AM
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?
11-28-2012 09:07 AM
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
11-28-2012 09:24 AM
@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...
11-28-2012 09:30 AM
Heh, i was just showing how the event works, but with your addition the OPs question is almost solved. 😉
/Y