• 0

Waveforms with DDiscovery. How to do a synchronous repeated and trigger acquisition at the same time


Question

Just got my hands on DDiscovery today. Hoping to use it to replace my bulky old logic analyzer for testing my Analog-to-Digital Converters.

Initially, I apologize If I tend to write more than I need to.

I would like to have the below three functions simultaneously in the Logic Analyzer tab.

1) Synchronous with external clock:  To capture 16+ channels using an external clock which would be a DATARDY flag or just sampling clock from my ADC.

2) Trigger-based acquisition

3) Repeat it for number of times while saving to file each time.

 

So far,  in Waveforms, I can only get 1) without 2) or 3) and vice versa.

So basically, I want :

1) Wait for Trigger

2) If Trigger, start a "SYNCHRONOUS" acquisition

3) Once complete, save to file.

4) If total number of acquisitions not complete,  Go back to 1)

 

In Waveforms, if I go to "SYNC" mode, the "trigger options" become disabled. If I go to repeated, it is not "SYNC".

To sum up,

1) Can I,  using Waveforms, get the above working?

2) If not, is it a hardware limitation? or is it just software. If software, can I write my own script to build the above scenario? Note I am not a software guy, pure analog so will be a big thing for me to get familiar with Java scripting stuff.

 

Sorry again for the long question and thanks in advance.

Ahmed

Link to post
Share on other sites

3 answers to this question

Recommended Posts

  • 0

Hi @elshater

The sync mode uses the trigger mechanism for sampling event. Unfortunately 1 and 2 can't be used at the same time. This is a firmware limitation.
Eventually you could use an enable signal for sampling condition...

image.png.854f91f8aa778f245a7744d524016576.png

You could use a Script like this to perform and save 100 captures. Or you can use the Logging tool to save the data.

image.png.9399572e41379fdd4bc9273bebae62c0.png

for(var i = 0; i < 100; i++){
    Logic1.run()
    if(!Logic1.wait()) break;
    Logic1.Export("C:/temp/asd/"+i+".csv")
}

 

Link to post
Share on other sites
  • 0
4 hours ago, attila said:

Hi @elshater

The sync mode uses the trigger mechanism for sampling event. Unfortunately 1 and 2 can't be used at the same time. This is a firmware limitation.
Eventually you could use an enable signal for sampling condition...

image.png.854f91f8aa778f245a7744d524016576.png

You could use a Script like this to perform and save 100 captures. Or you can use the Logging tool to save the data.

image.png.9399572e41379fdd4bc9273bebae62c0.png

for(var i = 0; i < 100; i++){
    Logic1.run()
    if(!Logic1.wait()) break;
    Logic1.Export("C:/temp/asd/"+i+".csv")
}

 

Thank you, this is very helpful especially providing the script syntax for a beginner like me.

Let's say I would like to build my own "script trigger" or "soft trigger". I don't need it to be very accurate in terms of starting immediately but just not before the trigger.

So very crudely, lets say my trigger is rising edge of DIN0 :

Start
Keep reading DIN0 until it is '0'.
then
Keep reading DIN0 until it is '1'.
then
Logic1.run()
wait()
Run a python script in system (to change some GPIB settings of some instrument)
Repeat


So to do the "keep reading DIN0", I am guessing that is a Logic1.run() operation itself with different GUI settings, correct? How would you gracefully code this? One thought I had is configuring Logic1 as a repeated run with trigger being DIN0 rising edge, and run it for a single run and wait on it. Once done, configure Logic1 for sync mode and run.

Of course I am not asking for you to write my code (Even though that would be very helpful .. :) ) but kind of guide me to main script functions that are to be used. In addition, the "Run python script in system", which command would be used for that?

Thanks alot.

Regards,

Ahmed

 

 

Link to post
Share on other sites
  • 0

Hi @elshater

This script waits for pulse on DIN24 then performs the capture and export.
However there can be several millisecond delay until the capture is started.

image.thumb.png.4c87f34428fed51b1373381b120352d6.png

for(var i = 0; i < 100; i++){
    // wait for DIO24 to be 0 then 1
    while(wait() && StaticIO.Channel0.DIO24.Input.value!=0);
    while(wait() && StaticIO.Channel0.DIO24.Input.value!=1);
    // ~millisecond latency
    Logic1.run()
    if(!Logic1.wait()) break; // wait for the capture
    Logic1.Export("C:/temp/asd/"+i+".csv")
}

 

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