Reputation: 1075
I am trying to sample myDAQ NI module at 1 Hz with the below code, but for some reason, no matter what I set as sampling rate, it seems to be sampling at the same rate, much faster than 1 Hz.
Following kosist's advice, I added 'samples per channel' input. But from what I read in the help, that only sets a buffer size. And it doesn't seem to have any effect on how fast the samples are still coming in, though.
cDAQ1Mod1
is a NI 9205. Can it really be that with this device I have to sample my temperatures, which are only slowly changing over 20 hours, at something like 10 Hz (that's what it seems like it's running at now)? That would be kind of crazy.
Ok, I think this hardware that was passed on to me is now 10 years old, but I find it hard to believe there is a fundamental technological limitation that prevents me from sampling slowly even with that older piece of hardware.
I am very new to LabVIEW. Appreciate your help.
Upvotes: 2
Views: 3060
Reputation: 1
The DAQmx Read VI is pulling 1 sample from the DAQ buffer each time the loop runs. Is that what you want?
Typically you'd set the hardware to acquire at X speed (in your case higher than 1 Hz) and you'd want your loop to pull date from the buffer (for example read once every 100ms) This KB explains it well: DAQmx Timing and Sample Rates
For your case, I'd recommend you use the shipped example: Voltage - Continous Input and modify the sample rate from there.
Upvotes: 0