Jump to content
  • 0

Time locked measurement with Analog Discovery Python SDK


HeidI

Question

Dear forum members

I am using the Analog Discovery in combination with the Python SDK to test a system. I want to generate an analog output (waveform generator) and record a time locked, synchronized digital input, so the idea is to use cross-triggering. Is this possible? Is there any example code for this case?

Link to comment
Share on other sites

4 answers to this question

Recommended Posts

  • 1

Hi Heidl,

Yes, it is possible. The Analog Discovery provides quite a bit of flexibility in terms of triggering; there's external triggers, triggers on start-of-waveform-generation, and triggering on input (for the AnalogIn and DigitalIn instruments). And each triggerable instrument (AnalogIn, AnalogOut, DigitalIn, DigitalOut) is configurable to use any of those triggers.

If you use Python, I'd recommend that you take a look at the pydwf package. It will take care of all the ctypes shenanigans for you, checks the results of all API calls and turns them into exceptions if an error occurs; and it also provides documentation and examples that show usage, including triggering configuration. Compared to using the low-level ctypes-based interface that Digilent's examples propose, it should make your life considerably easier.

Link to comment
Share on other sites

  • 0

Hi reddish

Sorry for the late reply.

On 11/28/2022 at 6:24 PM, reddish said:

 

If you use Python, I'd recommend that you take a look at the pydwf package. It will take care of all the ctypes shenanigans for you, checks the results of all API calls and turns them into exceptions if an error occurs; and it also provides documentation and examples that show usage, including triggering configuration. Compared to using the low-level ctypes-based interface that Digilent's examples propose, it should make your life considerably easier.

 

That was a very helpful tip, thanks a lot! It really simplified the handling of all the necessary functions.

I was able to get some good results, however, I encountered an interesting phenomena. For my project I used Analog Out (1 channel) as well as Digital In (1 pin), where the signal that comes out of the analog out is basically digital, so I could connect them to each other to test the delay when starting the trigger (this is only for testing, later Analog Out will have a "real" analog output). Now, if I would use the PC trigger or trigger on AnalogOut1 (adapting the corresponding functions; when I checked with an external oscilloscope, the Analog Out always acted as expected, so there must be something going on with Digital In), I would see a kind of random delay of between the start of the recording at Digital and the start of the analog output. However, if I use Digital In as the trigger, I see no delay. What could be the reason for this?

 

Link to comment
Share on other sites

  • 0

Hi @HeidI

Glad to hear you like pydwf.

I don't know the internals of the triggering bus that well I'm afraid, and I don't currently have time to try to replicate the behavior you're describing. Perhaps @attila knows why you see what you're seeing?

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