02-16-2009 10:01 AM
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
02-16-2009 10:12 AM
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:
02-16-2009 10:26 AM - edited 02-16-2009 10:26 AM
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 😞
02-16-2009 10:30 AM
02-16-2009 10:42 AM
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?
02-16-2009 10:49 AM
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.
02-16-2009 11:08 AM
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.