Jump to content
  • 0

Why is AnalogIn armed time dependent on Frequency?


timmolter

Question

This is about the AD2 Waveforms SDK. I've been successfully capturing single pulses by setting up AnalogIn to trigger on a rising edge, waiting 20 ms, then firing a pulse. However, it fails when doing longer pulse widths (>1ms). I found that it stays in the prefill state (DwfStatePrefill = 5) for a long time before it gets into the armed state. See some samples stats below.

sampleFrequency = 20000.0
time = 205 ms
sampleFrequency = 6666.666666666667
time = 615 ms
sampleFrequency = 2000.0
time = 2049 ms


Lower than ~5000 Hz sample freq. I cannot even capture a pulse even if I wait until the armed state. Any ideas what I can do? Thanks in advance.

Link to comment
Share on other sites

4 answers to this question

Recommended Posts

Hello,

The default trigger position is zero relative to middle of the acquisition. The device will look for trigger only after the buffer is prefilled, the required pretrigger samples are collected. This default prefill time takes samples/2/frequency

To set the trigger position closer the start of the acquisition, for instance to acquire only 10 pretrigger samples, use FDwfAnalogInTriggerPositionSet with (samples/2-10)/frequency

samples = FDwfAnalogInBufferSize
frequency = FDwfAnalogInFrequency

Link to comment
Share on other sites

Is there an updated Waveforms SDK Reference Maual, newer than the October 12, 2015 version that I have? The docs for `FDwfAnalogInTriggerPositionInfo` don't match the  header file that comes with the SDK.

DWFAPI BOOL FDwfAnalogInTriggerPositionInfo(HDWF hdwf, double *psecMin, double *psecMax, double *pnSteps);

Thanks.

Link to comment
Share on other sites

Thank you for the observation. It is typo issue in the manual.

FDwfAnalogInTriggerPositionInfo(HDWF hdwf, double *psecMin, double *psecMax, double *pnSteps)


Parameters:

-          hdwf – Interface handle.

-          psecMin – Variable to receive the minimum trigger position.

-          psecMax – Variable to receive the maximum trigger position.

-          pnSteps – Variable to return the number of steps.

Link to comment
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...