• 0
Sign in to follow this  
timmolter

Why is AnalogIn armed time dependent on Frequency?

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.

Share this post


Link to post
Share on other sites

4 answers to this question

Recommended Posts

  • 1

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

Edited by attila

Share this post


Link to post
Share on other sites
  • 1

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.

Share this post


Link to post
Share on other sites
  • 0

Ah, that also explains why the captured window has the pulse near the middle! Good to know. Ok, I'll try to get things working with that.

Share this post


Link to post
Share on other sites
  • 0

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.

Edited by timmolter
figured out the other question

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
Sign in to follow this