LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

ECG analyzer: Discontinuation points in recorded data.

Hi

I have a problem with my programming work: I am trying to make a real-time ECG analyzer
which should be able to recognise irregular ECG and store the data. I am using a while loop
with shift registers to store the whole data. The problem is that it takes a while for the
while loop to start over again between iterations and during that time it looses data
resulting discontinuation points in the recorded data. Which is not good considering the
post-recording analyzation.

Is there a way to collect the data that is lost between while loop iterations? Or is there
a better way to do the recording? I need to record more than 20 seconds of data.

I'd be grateful for any advice.

- Amateur
0 Kudos
Message 1 of 3
(2,639 Views)
You are probably using an append-to-array node inside your loop. This is OK when working with small array, but takes a lot of time with large arrays, since the memeory manager has to allocate a new memory area, and to make a copy of the previous data at each iteration.
A better method is to initialize an array with a size larger than the max number of data you are expecting, then to use the replace array element function to progressively fill your array. Use a NaN value as initial value, to get a clean display.
Whebn your acquisition is terminated, you can search for the first occurence of a NaN value, and use the corresponding index to truncate the array.

CC
Chilly Charly    (aka CC)
0 Kudos
Message 2 of 3
(2,625 Views)
tke,

use a producer-consumer architecture.
Split your code into two sections , one loop for DAQ and the second for UI and data-processing. Make them run 'independently', use for example a queue to transport your data and events to handle user input and data processing . See examples provided by NI
Greetings from Germany
Henrik

LV since v3.1

“ground” is a convenient fantasy

'˙˙˙˙uıɐƃɐ lɐıp puɐ °06 ǝuoɥd ɹnoʎ uɹnʇ ǝsɐǝld 'ʎɹɐuıƃɐɯı sı pǝlɐıp ǝʌɐɥ noʎ ɹǝqɯnu ǝɥʇ'


Message 3 of 3
(2,603 Views)