11-14-2011 05:24 PM
Hi Forum,
I have recently developed a project to measure and record anode current signals from 20 individual anodes.
While my target sampling frequency is 100Hz for each anode, I can only reach about 50Hz, anything above 50Hz would result in an inconsistent sampling frequency for example if I choose 100Hz, the sampling frequency would maintain for probably less than 2 seconds and then it would start dropping and varying around 80Hz.
I have attached my project and it will be greatly appreciated if someone can have a quick look and give me some opinions. Thanks in advance!
Just a quick explanation on my project, in cRIO.vi, the 20 shared variables represent the 20 channels in my measuring device and I have written those values in an array form into a network variable called variable1 which is transferred to computer.vi where the array is written onto the hard disks in my computer using the write to measurement express VI.
11-15-2011 12:53 PM
Hello,
This sounds like your loop rate cannot keep up with your dt. You could try benchmarking your code to see how long the loop actually takes to run, that will be the limit on your sampling rate. There is example benchmarking code in the example finder.
Also, here is a dev zone on advanced benchmarking: http://zone.ni.com/devzone/cda/tut/p/id/5686
If you really want to sample at 100Hz and your real-time code cannot keep up, you can use the onboard FPGA to sample at that rate, then transfer the samples to your real-time code.
Regards,
Matt M.