04-09-2015 02:00 AM
Hi Guys
Im new to Labview and have absolutely no idea on programming and stuff. Im doing a project on Heart Rate monitor.
I'm using labview to read the analog input to an Arduino Mini. In my attached VI im using Peak Detection Point by point to calculate the BPM but it doesnt seem to work. I took references from several VIs to arrive at my VI.
My instructor told me I could try using FFT to calculate the BPM as well but Im not sure how to carry it out in Labview.
Hope you guys can help me with this.
Thanks alot!
04-09-2015 07:12 AM - edited 04-09-2015 07:12 AM
Ok, we have some problems here.
1. The Data Bits property is the number bits for a single character that is being transmitted. You should not use that. Since you are using an Arduino, it should be sending the termination character. So just tell the VISA Read to read maximum number of bytes you expect from a single message or just some large number (like 25). The VISA Read will stop reading the port when it encounters the termination character.
2. The String Subset is not doing anything. Just remove it.
3. You should move your Wait to be outside of the case structure. As is currently written, if you are not taking readings you will use up all of your CPU.
4. You should have labels for all of your controls and indicators.
5. Your time calculation is completely wrong. You want to subtract the time of the previous peak from the current peak. I recommend you use a Feedback Node to do this.
Here's a slightly cleaned up version of your code.