08-21-2012 10:21 PM
Hello,
I am working on a compactrio to analysis ECG in real time. I am new to cRIO, so I just followed this example, http://www.ni.com/white-paper/11198/en#toc5. and then I try to raise the acquisition rate to 5000 count(us) or to 200Hz (as that all i need). I lost all of my signal to some kind of noise. Does anyone know what this is about? See the pic below.
This is at 500 us.
Solved! Go to Solution.
08-22-2012 01:23 PM
Hi TingLik,
Can you reattach the pictures to your post? They are not showing up for me. What cRIO are you using?
Also - when you say that you lose your signal to noise, are you still able to see data and it just garbage data, or do you no longer get data through the FIFO?
Regards,
08-22-2012 09:21 PM
Hello Jeff,
Sorry about that, I have attached them and their name referred to the Count(uSec). In addition to this, I guess I am a little bit confused regarding on what Count(uSec) mean. I thought it would be 1/# Hz for # to be the value of the Count(uSec). However, I was experimenting with it and found that I had buffer error 50400 when increase the number. This conflicts with what I would expect since increasing the # should lower the sampling frequency. So I am wondering if you can explain the relationship between the acquisition rate, ie # for Count(uSec), the "Timeout (ms)" value, the "Number of Elements", and the number of channels to be used. (I was experiment all of these variables and I found all of them seems somehow interrelated...) Thanks a lot.
Ting
08-23-2012 10:43 AM
Got a few suggestions. Read http://digital.ni.com/public.nsf/allkb/583DDFF1829F51C1862575AA007AC792. I bet your cRIO CPU is at 100%. I see that's in the sample code you linked to but it's an easy fix. Instead of the Wait(ms), use the Wait function from the Real-Time palette. Buffer error 50400 comes from your FIFO read timing out. The timeout is 20s, if you're sampling 1 channel at 10000us it ideally takes exactly 20s to get 20k samples. Miss that by one clock tick and you get an error. You are not overflowing the buffer, instead not filling it by the expected time. The above FIFO change should take care of this.
As for the bad signals at 10000, are you reading multiple channels in the FPGA but only sending one to the FIFO? Ghosting could be an issue at these speeds since you have an aggregate, not simultaneous sampling card. http://digital.ni.com/public.nsf/allkb/73CB0FB296814E2286256FFD00028DDF.
You can do some programmatic analog sampling with method nodes if you need finer control. You can also set a master delay between analog channels in the project to help with ghosting. http://zone.ni.com/reference/en-XX/help/370984R-01/criodevicehelp/scan_item_method/
08-24-2012 08:38 PM
Cool Thanks, I am going to try it out this weekend, but how would you check to see if the RIO is at 100% or not?
Thanks again.
08-26-2012 09:05 PM
Hello Taper,
Thanks, I think your solution helped me to solve the ghosting problem and I change the wait function to realtime ones. I forgot I made that buffer error so i am not sure how to reprodice it or it has been fixed as well.
Ting
08-27-2012 08:41 AM
@Ting Lik wrote:
Cool Thanks, I am going to try it out this weekend, but how would you check to see if the RIO is at 100% or not?
Thanks again.
http://www.ni.com/gettingstarted/setuphardware/compactrio/systemmanager.htm
If you use a custom software installation there's a package you need to install to enable monitoring, the recommended sets already include it.