Multifunction DAQ

cancel
Showing results for 
Search instead for 
Did you mean: 

10 samples per second 9229

Solved!
Go to solution

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

0 Kudos
Message 1 of 10
(4,683 Views)

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

---
Brad Keryan
NI R&D
Message 2 of 10
(4,669 Views)

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

0 Kudos
Message 3 of 10
(4,664 Views)

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.  

0 Kudos
Message 4 of 10
(4,661 Views)

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

 

 

---
Brad Keryan
NI R&D
Message 5 of 10
(4,653 Views)

Brad,

 

You are right, my mistake.

0 Kudos
Message 6 of 10
(4,650 Views)

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?

0 Kudos
Message 7 of 10
(4,646 Views)

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

0 Kudos
Message 8 of 10
(4,636 Views)
Solution
Accepted by topic author 4U2C

Hi Matt,

 

I didn't realize you were using SignalExpress.

 

Does this do what you want?

  • DAQmx Acquire:
    • Acquisition Mode = Continuous Samples
    • Samples to Read = 200 (or 2000, if you want to see 1 second at a time on the graph)
    • Rate (Hz) = 2k
  • Subset and Resample:
    • Return subset = false
    • Resample = true
    • dt = 100m

Brad

---
Brad Keryan
NI R&D
Message 9 of 10
(4,630 Views)

Thanks Brad, that was it!

 

Anyway to have the Time coloumn continue incrementing until stopped manually?

0 Kudos
Message 10 of 10
(4,623 Views)