08-19-2015 02:03 PM - edited 08-19-2015 02:04 PM
Bob,
Personal experience. Using such techniques as this guy is employing would also need you to worry about both software application and hardware too. One wrong division with wrong resolution can create havoc. Probably could make you lose your PC.
08-19-2015 02:19 PM
@NapDynamite wrote:
Bob,
Personal experience. Using such techniques as this guy is employing would also need you to worry about both software application and hardware too. One wrong division with wrong resolution can create havoc. Probably could make you lose your PC.
... or even worse, your heart ...
BS
08-19-2015 02:21 PM
08-19-2015 11:30 PM
Hello Abuzar,
attached are the 2013 versions.
From timing perspective: you need to be sure that your microprocessor is sampling with a high time accuracy, and that you don't lose data between the processor and the PC. This can also create inacurracies in the heart rate since we are looking to beats per second.
Like Dynamite said: with a NI DAQ device you are ablo to stream data to the PC with high time accuracy, or it is even possible (with some devices) to count pulses directly with the DAQ device.
Best regards,
Martijn
08-19-2015 11:48 PM
Thanks Bob here is the details of my project.
/ Did you see my earlier post?/
I am installing the biomedical toolkit and will let you know about it.
/ I'm curious about the data you are acquiring. It appears that you are getting single bytes (your Byte Count is 1) from some device and processing it in your Consumer loop. I understand that your device is running at 9600 Baud, which means you are getting about 960 Bytes/second. What are these data? Are you acquiring an analog signal (at roughly 1 KHz) representing an EKG?/
Yes i am getting an analog signal being digitized and send on UART. I have not sampled the data as you can see and just presented it on Waveform Chart. So its an anlog signal of EKG which is digitized on 8 bit and then sent on Serial Port.
/ What are you trying to do in the Consumer loop? I can see your code, of course, but I cannot "read your mind" to decide what it is you are trying to compute, particularly with feedback loops, multiple shift registers, creating arrays, and doing Statistics. A verbal description of your intended algorithm would be helpful. Note that without knowing what the data represents, it is impossible to make any assessment on the validity of the code in the Consumer loop, even if it were more transparent./
I have labled my diagram and attached it for your reference.
/ A word about Queues -- the Consumer loop does not need to carry the Queue in a Shift Register, and doesn't need to bring it to the right-hand shift register terminal. A Queue wire is a reference to the Queue -- once the Dequeue function reads it, it knows everything it needs to know to use the Queue./
I have followed the example of Producer Consumer loop at ni page. I will try the changes you mentioned and inform you.
Thanks Bob Schor.
08-20-2015 01:07 AM
Dear all friends especially Dynamite
Pls watch the video on the below link in which i have completly described my project.
http://www.dailymotion.com/video/x32bsxx
Regards
08-20-2015 04:37 AM
Abuzar,
Please post your VI in LV12 version for me to see.
Thank you.
08-20-2015 04:43 AM
Abuzar,
I managed to watch that video you posted. Seems to me that you're acquisition is perfect but your 'processing' has gone nuts. I have doubts over the "maths" you're trying to solve here (particulalry over those shift registers). If you could post your VI again in LV12 version, I could have a look.
Regards.
08-20-2015 04:49 AM
Thanks for the video Abuzar,
With the video in mind, in my opinion, it is more and more advisable to check if you are getting all the data from your micro controller, or is your microcontroller grabbing all the data? But first things first, I would suggest to check all the links between you and the microcontroller.
- Maybe it is best if you can see if (for test purpose) you can leave the zigbee part out of the setup and see if all data is coming through.
- It is also maybe an idea to let the controller just generate an increasing counter at the same rate you are reading the analog input and see if you are getting all the samples
I don't think there is a way in this set up that you can guarantee you are getting all the data and with that exact the correct result. It is maybe possible to increase the size of the serial messages and pack more data into one message. But again this is only reducing the chance of loosing data. Again I am only guessing here and this is something you can just use to trouble shoot.
Good luck!
Best regards,
Martijn
08-20-2015 08:33 AM
Thank you for the video -- it makes it easier to understand what you are doing. Here are some questions/suggestions:
To illustrate the last point I made, let's assume that you have a "perfect" signal and no points are being lost. Let's also assume that your sampling rate is 20Hz (which I made very low in order to illustrate the point I'm about to make). 80 BPM is 1.33 B/s, or 15 samples/beat. If I have a perfect algorithm, I'd expect to see the samples/beat as 15, 15, 15, 15, which would compute to 80, 80, 80, 80 BPM. However, if I'm off by even one sample, say 15, 14, 16, 15, I'd compute 80, 86, 75, 80 BPM.
I look forward to learning more about your setup.
Bob Schor