LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Analog Input Data Acquisition

I need some help with acquiring data from NI PCI-4472 device.

I have 4 devices with 8 channels each and would like to create a vi that reads the voltages from each of the channels.
I have created a vi that will read the channels but I cannot set the number of samples too high, I get the following error:

Property: SampQuant.SampPerChan
You Have Requested: 18000000
Valid Values Begin with: 2
Valid Values End with: 16777215

I believe this is something to do with the buffer size.
Is there anyway that I can read more than 16777215 samples per channel.

Thank you.
0 Kudos
Message 1 of 12
(4,244 Views)
I want to add a few additional comments regarding my issue that I have stated in my first message.

I am using DAQmx Read.vi and I am trying to figure out how many samples I need to specify as the input to the vi.

If I am running at 30kHz then it means that I am sampling at 30000 samples/second, and if I need this to run for 24 hours then this would mean that I would have 24 x 60 x 60 x 30000 samples as the input to the Read.vi.

Would this be correct? If so why am I getting an error telling me due to a too large number as the samples?


Thank you.
0 Kudos
Message 2 of 12
(4,224 Views)
If I understand correctly, you're trying to let this vi run for 24 hours, taking measurements at 30KHz, and you want it to buffer all of those readings?  That's more than 2.5 billion samples at 8 bytes per sample, which is over 20 GB of data.  What you need to do is call Read.vi once every second or so in a loop and continuously log the data.  What I would do is set Read.vi to read 30000 samples, that way it would complete once every second.  I wouldn't recommend simply adding every value to a text file, either.  If you really need every single value, you would have to make many files, and even that would consume a lot of storage.  My advice is to only log a reading every couple of seconds, depending on how many you actually need.
0 Kudos
Message 3 of 12
(4,201 Views)
There is a fundamental concept, if you are acquiring data for 24 hours, it is no longer considered a "Finite Acquisition" anymore, you will need to configure your VI to acquire data continuously.
 
"Number of samples" is referring to how many samples to digitize from the hardware, once these data are acquired from each channel, they will be stored on the on-board memory of the DSA boards and then streamed to your computer's hard disk. The error you saw is telling you that the onboard memory for this 4472, per channel, is 16777215. However, when you are acquiring data continuously, the content of the buffer will be dumped to the hard disk continuously so it will never be filled (if you are streaming data fast enough).
 
For your case, the sampling rate is only 30K. All you need to do is configure the vi to acquire continuously and put the DAQmx Read vi into a loop, set up a condition where the acquisition will stop after 24 hours. You can follow one of the examples from LV Example Finder to get started.
Message 4 of 12
(4,195 Views)
I like your suggestion and will try to implement it.

One question I have is regarding the timed loop. Can you please tell me how I would implement the timed loop?

At the moment I have an Elapsed Time control within a while loop that will stop the while loop as soon as the time established runs out. This however does not control the while loop.
I would need to have the loop execute once per second and it has to be in sync with the elapsed time control within the loop.

Any suggestions would be greatly appreciated.

Thanks.
0 Kudos
Message 5 of 12
(4,189 Views)

I haven't done this with NI-DAQmx, but I assume Read.vi works the same way as it does with traditional NI-DAQ.  The way I do it is to give Read.vi the number of samples that it will read in 1 second.  For example:

4 channels, 1000 Hz, read 4000 samples in Read.vi

All you have to do to accomplish this is multiply your scan rate and number of channels and pass the answer in as the number of samples to read.  It will always read a second of data, even if it gets behind on one iteration of the loop it can catch up on the next.  I also use a Wait Until Next ms Multiple and wire like 400 to it as not to bog down the CPU.  Then you can just keep track of the elapsed time and stop the loop after 24 hours.  Just be sure to clear the acquisition after the loop now that you're using a continuous acq, otherwise the buffer will overflow.

As I said, this is how AI Read.vi works for traditional NI-DAQ, I'm not positive that DAQmx Read.vi works the same way, but I don't see why it wouldn't.

Message Edited by Marc A on 01-16-2006 05:07 PM

Message Edited by Marc A on 01-16-2006 05:09 PM

0 Kudos
Message 6 of 12
(4,185 Views)
I will try implementing your suggestion.

Thank you.
0 Kudos
Message 7 of 12
(4,160 Views)
I do have one more question regarding the sampling rate.
On a PCI 4472 can I set a different sampling rate and number of samples for each of the different 8 channels?

In other words, is the sampling rate and number of samples set at channel level or board level?

Thank you.
0 Kudos
Message 8 of 12
(4,146 Views)
As far as I know, you have to set both for the entire task, you can't set different sampling rates for each channel.
0 Kudos
Message 9 of 12
(4,127 Views)

To add to marc's answer, the 8 channels share a single ADC and hence you cannot set different sampling rates(program ADC to do this) on different channels.

However here is a workaround to achieve an "effect" of sampling different channels at different sampling rates on a single card

http://sine.ni.com/apps/we/niepd_web_display.display_epd4?p_guid=BCB8746152612330E034080020E74861

Hope this hepls

Regards

Dev

0 Kudos
Message 10 of 12
(4,120 Views)