I would normally calculate my own timestamps from the variable-timed frequency samples. You just need a t0 and a set of relative times that you can calculate with a cumulative sum of the periods (a.k.a. 1/freq). From there, you can do things like interpolation or resampling to *estimate* the frequency at the times of the AI samples you have.
Some devices support a special frequency measurement mode that samples at a constant rate. I *think* your 9178 chassis supports it, but don't know the cDAQ family well enough to say for sure. The special mode goes by the name "dynamic averaging".
I just deleted a bunch of stuff I wrote to describe implementation details for LabVIEW after noticing that you're using Signal Express. I don't know that product and it's options or constraints. I suspect there are limitations in what you can do to configure things.
Basically you end up with 2 alternatives:
- read frequency as you do now. In order to align freq and AI data, you'll need to find a way to establish a common t=0 point for your Ctr and AI tasks. Do the cumulative summation of period to establish timestamps for your frequency measurements. Interpolate or resample if desired. (Advanced note: there's a subtle issue awaiting you for this kind of frequency measurement on your device, making it more difficult to establish a common t=0.)
- use "dynamic averaging" to measure your frequencies *IF* your device supports it. Aligning your data might be straightforward if Signal Express allows you to configure the freq measurement to use the AI sample clock.
Thank you very much Kevin P.
I read the manual of DAQ 9178, it says the device support sample clocked buffered frequency measurement. This is exactly what I want.
In the manual, it also says that it's possible to use AI sample clock as the sample clock for frequency measurement. But I did not find where I can apply AI sample clock in SignalExpress.
When I set SignalExpress step, the advance timing tab is gray (where people can choose internal or external clocks). So the question here is: is this the limitation of SignalExpress, or the Digital module NI9421 does not support the sample clocked frequency measurement?
With best wishes
I do not expect this would be a limitation of the module. The chassis is more responsible for how timing signals get routed and shared.
As to SignalExpress, I simply don't know because I don't use it. Anyone else out there?
Thank you again, Kevin!
I think I need to go for Labview.
Here, I have one question about the start of acquiring both the analog signal and frequency measurement. To make them start to acquiring simultaneously, I believe I can use the same HW trigger to trigger all the channels. I checked the device routing of NI9421 in MAX, the HW trigger signal for the counters are not routed to any terminal of NI9421 at all, and I could not change any routing in MAX. I'm wondering if it's possible to set HW trigger for frequency measurement then. Do you know this?
Anybody else can answer this? Thank you in advance!