06-01-2011 05:48 PM
Looking to capture 10 samples per second to a file using an NI9229.
I think I have the output working correctly using a save to ascii/lvm.
My problem is I can not figure out the ratio to capture at that gives me 10 samples (10 rows of data) per second using "N samples" "samples to read" and "Rate (Hz)".
My goal is to have 10 samples per second, and have the first column correctly lable the time from when I hit "run" till I hit stop, and tell me how many seconds it ran for before I stopped it.
Thanks
Matt
Solved! Go to Solution.
06-02-2011 10:45 AM - edited 06-02-2011 10:47 AM
Hi Matt,
The NI 9229's lowest sample rate that is a multiple of 10 is 2000 S/s. If you log every 200th sample and throw the rest away, you will be logging 10 S/s. (If there is a NI 9234 in the task, then the numbers change to 2560 S/s and every 256th sample.)
Brad
06-02-2011 11:16 AM
Thank you for your reply Brad.
If I understand you correctly, are you saying I should set the Samples to read to 10, and the rate to 200m?
secondly, how do I fix the output file to show the absolute time correctly? Time column never moves from 0.00.
thx
~Matt
06-02-2011 11:49 AM
Hi Matt,
So if I understand correctly, you want to read 10 samples per second and save it to a LVM file, with each point in a new row and associated time data. If you want the acquisition to run until you hit stop, then it sounds like you want "continuous samples" rather than "N Samples", which sets finite acquisition.
The other controls that you mentioned are pretty straightforward, "samples to read" specifies the number of samples that you acquire, and "rate" specifies the rate that you acquire at. So if you want to acquire 10 samples per second, you will want to set the rate to 10 Hz. To save the data to a file, the simplest method is to use the "Write to Measurement File" VI, which allows you to specify the file path, save format, header format and also has options for saving time data. Hope this helps!
Regards,
Joe S.
06-02-2011 12:55 PM - edited 06-02-2011 12:55 PM
Joe, the NI 9229 has a minimum sample rate of 1613 S/s. If you specify a sample rate of 10 S/s, DAQmx will coerce the sample rate up to the minimum supported rate, which is about 161 times too fast. As a result, to log data any slower than 1613 S/s, you must decimate the data. You're right about continuous mode, though: continuous makes more sense than finite for this application.
Matt, an easy way to decimate the data is to set the sample rate to 2000, read 200 samples at a time, and log the first sample of each read. Throw the other 199 samples away.
Brad
06-02-2011 12:56 PM
Brad,
You are right, my mistake.
06-02-2011 01:24 PM
Thanks guys, I was away trying to fix this then saw these helpful posts.
I'm attemping to setup a filter as a step in signal express to filter out the results. Am I asking the impossible of signal express?
06-02-2011 02:18 PM
I am doing something wrong. here are my settings:
Acquisition Mode: Continuous Samples
Samples to Read: 10
Rate in (Hz):10
I run this for 1 second in order to see how many samples are being collected per second. The output file has a time column that increments to .000558 then resets to 0 after 10 samples. (need this to increment until I hit stop)
The number of samples collected is 1470 (not including the header)
The desire is to have 10 rows of output with a timestamp that starts from 0 and increments correctly until I press stop.
My attempt at adding a filter were unsuccesful, (lack of knowledge), but I think part of the problem is in the capture step.
Help Please 🙂
Thank you
~Matt
06-02-2011 03:01 PM
Hi Matt,
I didn't realize you were using SignalExpress.
Does this do what you want?
Brad
06-02-2011 03:22 PM
Thanks Brad, that was it!
Anyway to have the Time coloumn continue incrementing until stopped manually?