11-14-2008 07:26 AM
I've used daqmx to acquire (and store) a waveform at a rate of 512Hz (therefore dt = 0.001953125).
When I re-open the file the sample rate is reported as 512.007Hz.
I have found dT is only stored within the waveform as 0.0019531 (missing final 2dp values)
dT value is stored as dbl value, so no reason why LV should need to trim the value.
Has the data been sampled at 512 or 512.007Hz?
Is there a way round this (avoiding the obvious "don't sample at 512Hz" reply)?
Any other thoughts?
cheers
A
Solved! Go to Solution.
11-14-2008 08:01 AM
Hi Andy,
Thanks for your reply and I hope your well today!
The sampling rate is determined by an onboard counter. A
limitation of a counter is that it can only increment or decrement by
integer values. The time base is divided down by the counter to create
the sample clock. Consequently, there are certain “valid sampling
rates” that depend on your time base and the resolution of the counter.
Therefore, the "valid" sampling rates are given by the following formula:
(TIME BASE) / (1 < INTEGER VALUE < 2^COUNTER RESOLUTION) = (VALID SAMPLING RATES).
I specify a sample rate of 101 Hz the next closes “valid rate” is
20,000,000 Hz / 200,000 = 100 Hz
and
20,000,000 Hz / 199,999 = 100.005 Hz
Difference = 0.005 Hz
If
an exact sampling rate is required you can actually provide your own
time base. This is done by wiring a signal to one of the PFI lines and
then specifying the source of the clock as a PFI line (from the “DAQmx
timing.vi"). The maximum allowable time base is dependent on the card
and can be found in the specification sheet for the DAQ card of
interest.
Hope this explains.
Kind Regards,
James
11-17-2008 03:20 AM
Hi Hillman
thanks for the response, all is clear.
we use a wide range of cards in different applications, so it is more convenient to stick with the on-board clock rather than supplying an external one.
is the 20Mhz clock frequency constant across NI acquisition devices (E series, M series etc.)?
if not, is there a device property, or similar, that reports this value?
For information, I am deploying a logging application where the end-user can select their required acquisition rate - so what I want to do now is put a check in my code to warn the user if the actual sample rate is going to differ from their requested one.
cheers
A
11-17-2008 03:34 AM - edited 11-17-2008 03:39 AM
Hi Andy,
Yes the 20MHz onboard clock is consistent acreoss the E, S and M series devices. However on the M-Series devices there is also a 80 MHz clock. This then allows the onboardclock terminal to be either 20 or 80 MHz depending on the expected input / output frequency.
If you want 20 MHz all the time you need to use the advanced terminal /DevX/20MHzTimebase this will force DAQmx to always use the 20MHz reference.
Finally to find the actual rate the DAQ device is using you can wire a DAQmx timing property node into the DAQmx Task wire after the DAQmx Timing VI.
In the property node select Sample Clock >> Rate and make the property readable with the right click menu. This will tell you the rate the DAQ device is running at.
Regards
JamesC
NIUK and Ireland
It only takes a second to rate an answer 🙂
11-17-2008 04:07 AM
Cheers James
This is all very useful information
A