Multifunction DAQ

cancel
Showing results for 
Search instead for 
Did you mean: 

Multiple cDAQ 9172 frequency measurements

We want to measure the frequency of 10 signals every 20 msec using a cDAQ-9172 chassis and two 9411 modules with the single counter per measurement method. The frequency range being measured is between 1kHz and 10kHz. Initial testing is showing that we cannot accomplish this without using multiple cDAQ chassis. The limiting factor is that there are only 2 counters available per chassis. Each counter measurement requires its own task and only one task can be active on a counter at any one time. I have experimented with starting and stopping the tasks in my measurement loop, but it is taking about 40 msec to start, read, and stop each task, leading to a ~200 msec loop time which is 10 times as long as we can live with. If I just measure one channel on each counter, I can start and stop two counter tasks outside of the acquisition loop and can make the two frequency measurements in parallel in about 3 msec. I also experimented with just doing a read in the acquisition loop and skipping the task start and stop. That works, but not any faster - seems like the start and stop task operations are happening automatically in this case. I tried using the task control VI to reserve and unreserve the resources for each task in the acquisition loop, but that gives similar results as well. I am trying to avoid having to use 5 cDAQ chassis to meet our frequency measurement requirements. Is there a way to accomplish measuring several frequency channels per counter within a 20 msec window? Thanks, Hans
0 Kudos
Message 1 of 7
(4,126 Views)

Hi hansf.

 

You have two options:

 

1) You could N channel sample your data in one DAQmx task, and then FFT your sampled points with some windowing to calculate the frequency on each channel. You need to make sure you sample at twice the input frequency and preferable in powers of 2 as the FFT will run quicker. So you will need to sample faster than 20msec to get enough sampels for a good FFT.

 

2) Use one of the PCI cards with separate counters so you could do separate freg tasks.

 

Using 5 cDAQ will not work as these are USB devices and your bus will not be able to handle the streaming effectively.

 

Regards,

Kind Regards
James Hillman
Applications Engineer 2008 to 2009 National Instruments UK & Ireland
Loughborough University UK - 2006 to 2011
Remember Kudos those who help! 😉
0 Kudos
Message 2 of 7
(4,117 Views)
Hello Hillman,
 
Thank you for your prompt reply. I have a couple complications with the solutions that you proposed.
 
1) We need accurate and high resolution frequency measurements because we are monitoring temperature and pressure sensors that output waveforms whose frequencies represent the measured values.  For example, the pressure sensors put out a frequency from 2 to 7 kHz scaled at 1psi/Hz.  I don't think we'll be able to sample fast enough to give us the accuracy we need via the FFT method.
 
2) We want to be able to use our test hardware and software on more than one PC, including laptops.  The cDAQ chassis makes that really convenient, while a PCI card does not.
 
I have a couple new questions:
a)  The frequency measurements using on board cDAQ counters really shouldn't require much USB bus bandwidth since we aren't transferring digital waveforms across the bus, only the frequency measurents themselves, at a rate of 10 measurements every 20 msec.  So couldn't we actually use the 5 cDAQ chassis solution?
 
b)  Are there other NI hardware options?   It looks like the NI devices with more than 2 counters are the PCI/PXI 66xx series, the R Series PCI/PXI intelligent DAQs, the SCXI-1126.  The SCXI-1126 is an eight channel frequency to voltage converter, so adding an SCXI chassis might meet our needs.  Compact RIO probably could measure multiple channels of frequency data with its FPGA, but that would add a lot of SW complexity to our system.
 
Thanks again,
Hans
0 Kudos
Message 3 of 7
(4,088 Views)

Hello Hans,

 

As far as data throughput is concerned, your assertion about using 5 cDAQ-9172 chassis and 10 NI-9411 modules is correct. When performing frequency measurement counter input, the cDAQ only sends the frequency measurement to the computer through the USB protocol.  Thus if you were only looking to take 1 measurement every 20 msec, times 10 channels, the required data transfer rate would be well below the maximum theoretical USB 2.0 data transfer rate of 60 MB/sec. The problem with this method is that you would have to use implicit timing for your counter input tasks, thus if you require the measurements to happen precisely every 20 msec, you would not be guaranteed this timing.

 

For your second question, I think that any of the other hardware you mentioned would also be suitable for your application.  Which hardware is best depends on the specifics of your application. 

 

Best wishes,

Wallace F. 

National Instruments
Applications Engineer
0 Kudos
Message 4 of 7
(4,056 Views)

Hey Hans,

 

I'll throw in a little more. First off, what are your signal requirements? Do you need the differential DI from the 9411 or are you using just a ttl signal? So for 10 digital frequncy measurements, you're correct that 5 CDAQ chassis with 5 modules (each module has enough lines to route the required 2 frequency signals assuming you're not using the rest of the DIO lines) could do your 10 measurements and that the rates should be well within usable bandwidths. Wallace also raises an excellent point, in that a buffered simple 1 counter frequency measurement is timed by the input signal (check out Frequency Measurement 1 in the 9172 user Manual) but with a higher freuqncy signal you can always pop off the latest buffered point. This is a HW/signal limitation, not something from USB.

 

Another potential option: the 9411 modules support correlated (clocked) DI. You can run these at up to 2 MHz. What you can do is clock in the values of the digital lines at a specified rate, proccess the number of samples in a period (run a quick algorythm to count the number of samples between rising edges) and calculate the frequency. This is not as accurate as using the counters since you're essentially using the same method but you're using a 2 MHz clock rather than an 80Mhz clock. This is still pretty good for a 10kHz (10khz +/- 50hz vs 10khz +/-2hz) signal. The advantage is that the 9172 chassis has 32 correlated DIO lines, so with 3 9411 you can montior the 10 lines you need. This would require some post proccessing - are you just logging/monitoring this data or do you need to do some control with it? This would be slightly slower than using just counters for it. Also if you can use a different module (9401) that supports higher CDIO rates you can do better.

 

Hope this helps and gives you some more options, please post back if you have any questions about these suggestions.

 

Cheers,

Andrew S

MIO DAQ Product Support Engineer

National Instruments 

 

   

 

0 Kudos
Message 5 of 7
(4,037 Views)

Hi Andrew,

Thank you for your reply. I'll ask about our accuracy requirements for our frequency measurements, but I don't think the +/-50Hz at 10kHz or +/-13Hz at 5KHz accuracies that the 9411 can provide is good enough.

 

What is the sample rate for the 9401? The spec in the 9401 manual is a little confusing. It doesn't give a max sample rate, instead it specs max input signal switching frequency. How does that translate to a sample rate? The max input signal switching rate decreases as the number of channels used increases, which makes sense. That would seem to indicate that using more 9401s each with fewer input channels used would result in a faster sample rate. What would be the effective sample rates when using 8, 4, or 2 channels per card?

 

Why would we need 3 9411s or 9401s? Couldn't we use 2? Perhaps that has to do with the sample rate decreasing as the number of channels increases. We only have two slots available for our counters if we want to use one cDAQ chassis which we'd prefer.  USB Bandwidth issue - DI sampling will use USB bandwidth and we do have other AI acq channels. How can we estimate how much of the bandwidth would be used for the DI streaming and how much would be left for our AI channels?

 

Seems like our needs are hitting a bit of a hole in the NI product offerings. Our signals are not TTL. We'd like to use the PCI-6624, but our signals are differential with an amplitude of 2 to 5 V. The PCI-6624 spec shows a guaranteed on voltage of 4V so we can't use it. It would be really cool if NI offered a cDAQ module with at least 4 on board counters and a differential PCI counter module with a lower, ideally programmable, threshold voltage. Right now it looks like we'll go with two PCI-6602s with $40 RS422 level shifters on each signal to convert to TTL.

 

Thanks again,

Hans

0 Kudos
Message 6 of 7
(4,008 Views)

Hey Hans,

 

Sorry for the typo - 2 9411's would support 10 channels. Input rates on the 9401 will vary, but typically with 8 channels you're at 8MHz. On cDAQ the limiting factors are really the clocks (all are derived from dividing down the 80 MHz clock) and the USB throughput.with two 9401's and 10 channels distrubuted across both modules, on a decent system with USB 2.0 you should be able to read at 8 MHz, maybe 10.

 

As far as USB Bandwidth, we don't add a lot of overhead to transfers so calculating out bandwidth isn't too hard. With DIO and 10 channels, we're going to transfer 16 bit per sample (each sample contains the 10 input lines + some padding to get to a 16 or 32 bit transfer size). This is 2 bytes per sample, and at 8 MHz we would be transfering 16MB/s. The theoretical limit of USB is 60 MB/s, but in practice on most systems tops out at 40 or as low as 12. On my HP laptop with XP I get around 28MB/s - but this is system dependent and using lots of system resources on other things will effect performance. AI transfer sizes will depend on the modules. Modules with resolution of 16 bits and lower will use 16 bit transfers per sample, 24 bit will take up 32 bits. by multiplying acquisition rate with the bytes per transfer you get the bandwidth usage.

 

In your case, using counters would take up less bandwidth, but we just don't have the number of counters you need. Thanks for the feedback on DAQ modules. Another thing to consider would be an FPGA board, but 2 6602s would be more cost effective and should give you the functionality you need.

 

Cheers,

Andrew S   

0 Kudos
Message 7 of 7
(3,992 Views)