Multifunction DAQ

cancel
Showing results for 
Search instead for 
Did you mean: 

how do you recieve the heart rate from an ecg.vi?

HI,

I am building a remote accessed ECG monitoring system for my senior project. I am using labview to display and filter my raw ecg data. This part is working fine but i can not figure out how to have the VI measure the heart rate . I would like to measure the heart rate and than set alarms for limits that are out of the range for the person. If anyone has an idea on how I could go about this please let me know.

Ray
0 Kudos
Message 1 of 22
(9,165 Views)

Hi Ray,

With regards to the heart rate measurement I believe this forum answers your issue. Then based on the RR data that you will receive you can use a case structure implement your alarms. I have attached a very simple VI that illustrates this concept. I hope this helps!!

JaceD
Signal Sources Product Support Engineer
National Instruments
0 Kudos
Message 2 of 22
(9,140 Views)
Hi Jace,

I can not open the vi you sent because we only have labview 8.0 at the school and it will not let me open anything in 8.5.

Ray
0 Kudos
Message 3 of 22
(9,096 Views)
Sorry about that. I have saved the example for 8.0
JaceD
Signal Sources Product Support Engineer
National Instruments
0 Kudos
Message 4 of 22
(9,088 Views)
Hi Jace

Thank you for the example. To get the the heart rate I am taking the derivative of the ecg waveform to limit the number of peaks to one. From there I want to use the waveform peak detector vi to find the peak to peak interval but I keep recieving this error: An exception occured with in the externall code call library function node.This might have corrupted labviews menmory please save data somewhere else and close labview.  VI "doctor display1.vi" was stopped at node 0x0of subVI" NI_Mapro.ivlib: Peak Detector no state.vi"

Do you know why i would keep recieving this error. I have attached the doctors screen vi. I have two different vi's for my project. THe patients vi is the one that actually collects the ecg data and saves it to a database server and the doctors vi uploads the information from the database server and is supposed to read the data and do some measurements. The project is a remote ECG monitor. I also have attached some ecg data so that the vi will run for you. Any help that you can give would be gratly appreciated.

Ray

P.S. Also I set up my filter parameters and save them but everytime that I reopen the vi the filter values go back to the default settings. Is there a way to save my settings permenately.

Also it will not let me attach the data because it says that the extensions are invalid

Download All
0 Kudos
Message 5 of 22
(9,074 Views)

HI Ray,

This error seems to be coming from the Waveform Peak Detection vi, Based on the error it appears that either your VI or a sub VI has somehow become corrupted. The first thing that I would try is to copy your entire VI into a new blank VI and attempting to run it. If this does not work then in order to narrow down the source you could simulate a waveform and use the Peak Detection VI in a test VI. If none of these trials change anything then I would suggest repairing your installation of LabVIEW. This can be done by navigating to Add/Remove programs>> National Instruments Software>> LabVIEW 8.0 and selecting repair.  You can also attempt to run this VI on another computer to verify that it is not something wrong with the programming but rather a corruption. With regards to the filter parameters in the VI that you posed there are no controls on the terminals so I am assuming these are incomplete, but I have attached a screenshot of how to set the default value for a control. I hope this helps!!



Message Edited by jaced on 12-20-2007 02:10 PM
JaceD
Signal Sources Product Support Engineer
National Instruments
0 Kudos
Message 6 of 22
(9,064 Views)
Hi Jace,

I still can not recieve the beats per minute (heart rate). Can you look at the vi I have attached and see if you can offer me some guidance on where I am going wrong. I recieve a clear ecg signal both in labview and on the oscilloscope. I can calculate the bpm by hand off of the o-scope but when I try to apply the same mathematical expressions in labview I do not recieve anything at all.

Ray
0 Kudos
Message 7 of 22
(9,014 Views)

Hi Ray,

I believe that the issue stems from the inherent discontinuity in the ECG signal. I believe that taking a derivative is unnecessary and that the following method should work. I believe something like this:

should work if used on your waveform data. I do not have a ecg signal so therefore cannot test this. If you could post some of your data that would be helpful. I do however believe that this method should give you satisfactory results.



Message Edited by jaced on 12-31-2007 03:12 PM
JaceD
Signal Sources Product Support Engineer
National Instruments
0 Kudos
Message 8 of 22
(8,996 Views)
Hi Jace,

Happy New Year. Here is some data it is saved in TDM form For the Vi that I sent you I am taking data straight from the person(patient). But I am saving it in a file and using this vi to look at it.

Ray


It would not let me send a .TDM file so i saved it as a doc so you will probably have to resave it as a TDM file in order to run it.

Ray
Download All
0 Kudos
Message 9 of 22
(8,986 Views)

Hi Ray,

Happy New Year to you as well! I have been unable to open the document as a .tdm file. Did you just change the extension or did you modify it in some way? I suggest zipping both of these files into a single .zip file and attaching it, that way no modification will be needed. Have you tried my suggestion from the previous post if so what were the results?  

JaceD
Signal Sources Product Support Engineer
National Instruments
0 Kudos
Message 10 of 22
(8,973 Views)