Jump to content
  • 0

Waveforms SDK pulse interrupt measurement using record


joeck

Question

Hello,

I only want to measure samples when a pulse is active. I've seen how it should work in the reference manual and this forum thread

Quote

 

To trigger on a pulse configure the following: FDwfDigitalInTriggerCountSet (hdwf, 1, 0);

For positive pulse specify rising and for negative falling edge reset.

FDwfDigitalInTriggerResetSet(hdwf, 0, 0, positive?1«dio:0, negative?1«dio:0);

For positive pulse specify high and for negative low level trigger.

FDwfDigitalInTriggerSet(hdwf, negative?1«dio:0, positive?1«dio:0, 0, 0);

Glitch/Less: To trigger on glitch, a pulse length at most the specified value:

FDwfDigitalInTriggerLengthSet(hdwf, 0, max, 0); / / maximum pulse length in seconds

Timeout: To trigger on pulse timeout, on a pulse after the specified minimum time expires:

FDwfDigitalInTriggerLengthSet(hdwf, min, 0, 0); / / minimum pulse length in seconds.

More: To trigger on pulse ending slope which is longer than the specified minimum time:

FDwfDigitalInTriggerLengthSet(hdwf, min, -1, 0); / / minimum pulse length in seconds

Length: To trigger on a pulse length with the specified minimum and maximum lengths use:

FDwfDigitalInTriggerLengthSet(hdwf, min, max, 0); / / min/max pulse length in seconds

 

When using record however FDwfDigitalInTriggerPositionSet sets the measurement length. I assumed it might be stopped by the reset but that is for me not the case. I also had to specify the counter to 0 as otherwise the trigger didn't work properly.

Is there a way to only measure when the pulse is active and does the triggerReset reset the board or only the trigger?

 

Thanks in advance.

Link to comment
Share on other sites

1 answer to this question

Recommended Posts

  • 0

Hi @joeck

The FDwfDigitalIn-TriggerSet, ResetSet, LengthSet, CountSet and MatchSet, configure the trigger detector on digital signals. Like edge, pulse length, counter or patterns on UART, SPI, I2C.... protocols.

For record mode, the FDwfDigitalInTrigger-PrefillSet and PositionSet specify the pre-trigger (at least how many samples to collect before looking for trigger event) and post-trigger (how many samples to collect after the trigger). From samples/py/DigitalIn_Record.py :
# number of samples after trigger
dwf.FDwfDigitalInTriggerPositionSet(hdwf, c_int(int(nSamples/2))) # trigger in the middle
# number of samples before trigger
dwf.FDwfDigitalInTriggerPrefillSet(hdwf, c_int(nSamples-int(nSamples/2)))

I don't have a full overview on what you want to measure but you could use the pulse condition in your data processing, filter the data after capture.

Link to comment
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
×
×
  • Create New...