LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

anybody know how i can calculate the bpm from my vi?

i have gathered a ecg signal and displayed it on a waveform chart. i also have got the peak detection. i need to get the bpm from this signal.

any ideas

thanx

0 Kudos
Message 1 of 7
(3,267 Views)

Just how many stops do you need to stop a VI? In your case it appears the answer is 4. This is poor design. Also, your top inner loop continuously asks for a filename. This will become quite aggravating quite quickly. Besides, why do you need to read the file at each iteration?

 

As for the bpm question, this has come up before many itmes. I would suggest doing a search. This is a good thread: 

0 Kudos
Message 2 of 7
(3,263 Views)

 How do you do all this when your code opens a file path dialog every time the loop iterates?

 

blah...the above was already stated 😞

Message Edited by for(imstuck) on 02-16-2009 10:26 AM
0 Kudos
Message 3 of 7
(3,254 Views)
if you drag your text file into the file path it will run continuously. then it should not ask for the file every time the loop iterates.
0 Kudos
Message 4 of 7
(3,247 Views)

Yes, but the control is not set with a default value, so it's quite easy to run the VI without a filename, and hence get the behavior mentioned. That still doesn't answer why you need to read the file at every iteration. Is the file being externally changed while the program is running? 

 

For the bpm question: did you take a look at the other thread (as well as others from a search) to see if that answers your question?

0 Kudos
Message 5 of 7
(3,244 Views)

i dont know to be honest. the file is not set to be the default so every time you open the vi you have to manually enter the text file. it shouldnt be changed externally during the running of the program. at least it hasnt with mine.

yeah i have checked out most of the other programs on the forum. i am just finding it difficult to apply them to mine.

0 Kudos
Message 6 of 7
(3,240 Views)

Also, you have three while loops spinning at the same rate it looks like(except one is missing a wait). Why not combine everything in those three into one while loop with a wait of 100 ms. Then you only have one stop control for your entire program.

 

As for the file control, put it outside your main while loop. This way it asks you once for the filename once when you start the program and wont ask you again.

 

0 Kudos
Message 7 of 7
(3,236 Views)