03-30-2011 04:52 AM
Hi
In the .NET 4 example 'MeasPulseWidthBuf_SmplClk_Cont' it is stated in the comments that:
An external sample clock must be used.
I have an application running without specifying an external clock. The applications is running, but I'm not sure I can trust the recorded data. Here is the channel creation code:
task.CIChannels.CreatePulseWidthChannel(readTaskCounter,
"ReadPulswidthTask", 25e-9, 20e-6,
CIPulseWidthStartingEdge.Rising,
CIPulseWidthUnits.Seconds);
task.CIChannels.All.DataTransferMechanism = CIDataTransferMechanism.Dma;
task.Stream.Timeout = callbackTimeoutInMilliSeconds;
task.Stream.Buffer.InputBufferSize = 50000;
task.SynchronizeCallbacks = true;
task.Timing.ConfigureImplicit(SampleQuantityMode.ContinuousSamples);
task.Control(TaskAction.Verify);
Note that I'm not specifying any external clock.
1) Which clock is the daq using? -It is obviously using some clock since I can collect data via this task.
2) Do I need to change the configuration to use an external clock to achieve reliable readings - as mentioned in the 'MeasPulseWidthBuf_SmplClk_Cont' example?
/mola
Solved! Go to Solution.
03-30-2011 05:58 AM
I noticed that I can set the clock explicitly like this:
task.Timing.SampleClockRate = 80000000;
If I do not set it, it is defaulted to 0Hz, which suggests that it is not being used at all. Can anyone confirm this?
/mola
03-30-2011 10:37 AM
Hi mola,
That specific example is for sample-clocked pulse width measurements. This type of measurement is only supported on newer hardware such as X Series boards and will not run on the 6602.
Your application that you linked uses Implicit timing, meaning that the signal itself serves as the sample clock. That is, at the end of each pulse width that you measure, the sample is deterministically latched in. So, you end up with a buffered array of every pulse width that is seen by the counter.
Best Regards,