LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Plotting real time ECG data via serial port

Hello.

 

I'm looking for a sample VI that can read in binary (digitalized) ECG data via the serial port and plot out the corresponding ECG waveform in real time.

 

I've browsed through the forums hoping to find some sort of sample VI but can't seem to find any that fits the description.

 

If anyone could help me by providing me a sample or directing me to some kind of open-source link I would very much appreciate it.

 

Thank you.

 

Regards

Matt

 

 

Message 1 of 38
(8,298 Views)

Hi Matt,

 

When you say "binary (digitized) ECG data", do you mean that the serial port receives data in hexadecimal?  Or do you mean that it is the numeric values for the digitized ECG waveform that corresponds to the analog (real) waveform?

 

If you can, post an example of what the data looks like.

 

R

0 Kudos
Message 2 of 38
(8,292 Views)

Hi Joe

 

To be more specific, my data acquisition hardware converts the actual analog ECG signal into 8 bit or 10 bit binary form. My micro-controller performs the analog to digital conversion.

For example in 8 bit (resolution) binary format, 0000 0000 = 0V DC & 1111 1111 = 3.3V DC or higher.

 

I hope the above information is useful. 

 

Regards

Matt

Message Edited by MatuC on 10-05-2008 01:49 PM
0 Kudos
Message 3 of 38
(8,271 Views)

Thanks Matt,

 

One more question.  Does the microcontroller send binary data over the serial port (ie, a stream of 8 bits:  "01011010", or does it send it as an Hexadecimal "5A" ) ?

This will be useful in knowing how to treat (convert) the serial data.

 

R

Message Edited by JoeLabView on 10-06-2008 09:34 AM
0 Kudos
Message 4 of 38
(8,225 Views)

Hi Joe

 

The value transmitted by the microcontroller by default is in binary stream. However it is programmable to output as HEX. The microcontroller used is the PICAXE 08M in case you are familiar with this particular range.

 

Regards

Matt
0 Kudos
Message 5 of 38
(8,220 Views)

Hi Joe

 

Sorry there was a mistake in my earlier reply, to clarify the microcontroller is able to send a byte number or a word number.

 

For example the microcontroller will store a value of 65 after the ADC and transmit an "A" to the PC.

0 Kudos
Message 6 of 38
(8,200 Views)

Okay..  Thanks,

 

I will prepare an example tonight.  (No LabVIEW installed on this PC 😞 )

 

R

0 Kudos
Message 7 of 38
(8,188 Views)

Hi Joe

 

Thank you so much for the time and effort...i'm actually not familiar with labview but my school has the 8.0 version and i heard its pretty good for my kind of application.

 

Maybe just to add on to my earlier reply, the microcontroller uses ASCII to represent its data thus "A" is the ASCII equivalent of 65.

 

Once again thanks for all the help.

 

Regards

Matt 

0 Kudos
Message 8 of 38
(8,185 Views)

Since you are using LV8.0, here is an example in LV 7.1

 

The main program is ECG.  I also include a little "debug" program called try to understand what is going on.  It either generates random data or uses existing data in an array.  The data is in Hex and will be converted to a spreadsheet string to simulate the data being received from the serial port.  It's the same concept as in ECG.

 

ECG will continuously try to get data from the serial port.  It does NOT have a feature to exclude command echo or other non-data values.  You'll have to add that to the Consumer Loop.  So whatever data you get, it will convert to a numeric equivalent where you can set the upper voltage level equivalent (ie: FF = 3.3V) and it will convert the Hex value to that level (Hex / 255 * Max Level).

 

If there is no data to be read, it will simply run the upper loop (Producer) at 5 ms intervals.  You can change the interval value.

 

Try it, and let me know how it goes.

 

R

Download All
0 Kudos
Message 9 of 38
(8,174 Views)

Hi Joe

 

Thanks for the examples I will try them once I get to school and will post later on in the evening (Its 8am now).

 

Would like to clarify, since the main program is called "ECG.vi" and "try.vi" is the debugger, I'm guessing "configure serial port.vi"should be running concurrently with "ECG.vi"?

 

Thanks

 

Regards

Matt

0 Kudos
Message 10 of 38
(8,160 Views)