Jump to content
  • 0

sampling after each successive trigger


mnorth

Question


Hi Attila.  I've generated a triangle wave and a DigitalOutIO square wave as a test using python.
I’d like to take sample(s) from this AnalogIn signal each time the falling-edge of the DigitalOut IO signal occurs throughout a known amount of time for the AnalogIn signal (whatever, ~51msec).
Your examples have really helped. 
Is there an example where a DigitalOut edge is setup as a successive trigger to acquire multiple AnalogIn samples?
I’m assuming (?) that this needs a circular buffer.

image.png

Link to comment
Share on other sites

12 answers to this question

Recommended Posts

  • 0

Hi @mnorth

You could trigger the analog-in capture on the analog-out start with the required position:
dwf.FDwfAnalogInTriggerSourceSet(hdwf, trigsrcDigitalOut)
dwf.FDwfAnalogInTriggerPositionSet(hdwf, c_double(sec)) # trigger position relative to the middle of the buffer

You could also wire the DIO to the a trigger IO and trigger the analog-in on this:
dwf.FDwfAnalogInTriggerSourceSet(hdwf, trigsrcExternal1)
dwf.FDwfAnalogInTriggerConditionSet(hdwf, DwfTriggerSlopeFall)

Or setup digital-in trigger on the DIO and trigger analog-in on this:
dwf.FDwfDigitalInTriggerSet(hdwf, c_int(0), c_int(0), c_int(0), c_int(1<<7)) # DIO7 falling edge
dwf.FDwfAnalogInTriggerSourceSet(hdwf, trigsrcDetectorDigitalIn)

Link to comment
Share on other sites

  • 0

I used your second option.
But, it still seems to trigger on the first digitalOut edge and doesn’t appear to recognize any successive.

I’ve set up 1000 samples for the 50usec window after the trigger.
I get out 1000 samples…and, as expected it's done at that point.  No more triggers.
More samples just seem to race by the next trigger again.
Here’s what I used:

AcqHz = c_double(50000000)
nSamples = 1000
rgdSamples1 = (c_double*nSamples)()

dwf.FDwfAnalogInFrequencySet(hdwf, AcqHz)                                                                                     
sRecord = nSamples/AcqHz.value
dwf.FDwfAnalogInRecordLengthSet(hdwf, c_double(sRecord))

I would sure appreciate any thoughts you have on this situation.  Maybe there’s an example for this situation?

Link to comment
Share on other sites

  • 0

Hi Attila.  I'm triggering off the edge of a digital signal generated from DigitalOut.  I've generated a triangle wave from AnalogOut and am trying to collect 150 samples from the AnalogIn ADC once the trigger sees the falling edge of the digitalIO.  About 50%, of whatever number of samples I use, happens before the falling edge.  I'm guessing I'm missing something in the configuration somewhere.  Can I set something so that there are relatively no samples taken before the falling edge that the trigger is looking for?


image.thumb.png.84d095076cfe72d566cd384822c7cfe6.png

Link to comment
Share on other sites

  • 0

Hi @mnorth

The trigger can't be set exactly to the right, to be the last sample. Due to the pipelining delays, depending on the sample rate it may require 2-20 samples after the trigger.
You can configure it with such margin, for instance to collect 200samples and ignore the last 50 and use the first 150.

Edited by attila
Link to comment
Share on other sites

  • 0

Got it, but …
I think I'm  seeing a bit more than this with the various runs I try.  The triggering point seems to move with the length of the number of samples.  Is there perhaps a way to set the triggering position (left, center, right).  It almost seems like the default is center between the front edge and the back edge of the digital signal.  I was also looking at the delay wrapper.  Could that be useful in any way to this sort of condition?  I've been trying to integrate it and haven't seen any effect on the output. 

Link to comment
Share on other sites

  • 0

HI Atilla.  I have your Zyboz7 board.  I'd like to figure out how to connect the Arm to a couple of GPIB networkable instruments using a pmod port.
Do you sell an adapter for that?  I'm guessing it's something like the photo I attached.  I have the GPIB‑USB‑HS controller.
I'm just making sure...maybe it's just a standard USB out configured with a driver...something like that?
I'd also like to fiddle with I2C as an output from a pmod on the zyboz7.  Same question...is there any type of special connector to the pmod?
thanks!

 

 

 

 

image.png

Link to comment
Share on other sites

  • 0

Hi Atilla.  I'd like to discuss how to connect the GPIO of the zyboz7 board to a couple of GPIB-based instruments using a pmod port.
Do you have an adapter for that?  Maybe what I'm looking for is just a pmod connector to a plan ol' USB? 

 

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...