Getting back an event when trigger happens?

Post general discussions on using our drivers to write your own software here
Post Reply
Larry_Brent
Newbie
Posts: 0
Joined: Sat Nov 18, 2023 8:34 am

Getting back an event when trigger happens?

Post by Larry_Brent »

Hi ppl!

I am capturing a waveform with a lot of samples after a trigger.
This takes about 6 seconds after the trigger fires. If the buffer is fully captured, the callback happens and I start working with the data.

Is there a way to get an information when the trigger is fired? So I can visualize that the trigger is fired and the scope is now capturing data.

I am working with the 2206b and python-sdk-wrapper on linux.

Best regards,
Andy

bennog
Advanced User
Advanced User
Posts: 208
Joined: Mon Nov 26, 2012 9:16 am
Location: Netherlands

Re: Getting back an event when trigger happens?

Post by bennog »

how many samples per second are you capturing ?

Benno

Larry_Brent
Newbie
Posts: 0
Joined: Sat Nov 18, 2023 8:34 am

Re: Getting back an event when trigger happens?

Post by Larry_Brent »

timebase 0, so all I can get from the 2206B

bennog
Advanced User
Advanced User
Posts: 208
Joined: Mon Nov 26, 2012 9:16 am
Location: Netherlands

Re: Getting back an event when trigger happens?

Post by bennog »

Something is not adding up in your story.

if you set timebase 0 (500 MS/sec) your scope memory is 32 MSamples.
In this case all the data should be read by the scope in less than 0.1 sec.
So the 6.5 sec wait time is not correct or you are not sampling at 500MSamples/sec.

If it really takes 6.5 sec you are sampling at about 2 - 10 MSamples / sec (depending on number of channels active)

It could also because you are using python and reading the samples from the scope in a inefficient way it takes 6.5 sec. (this should take less than 0.5 sec if done right)

Benno

Larry_Brent
Newbie
Posts: 0
Joined: Sat Nov 18, 2023 8:34 am

Re: Getting back an event when trigger happens?

Post by Larry_Brent »

You are right, this doesn't add up because I looked into the wrong part of my config.
Sorry.

The truth is: I am measuring on timebase of 3 with a buffer size of 22000000.
This is what takes a while. Do I have a chance to get back the information from scope if the scope is waiting for the trigger to fire or if it is already capturing to the buffer?

Best regards,
Andy

bennog
Advanced User
Advanced User
Posts: 208
Joined: Mon Nov 26, 2012 9:16 am
Location: Netherlands

Re: Getting back an event when trigger happens?

Post by bennog »

The scope you are using, and the mode you are using it in is capturing in the memory of the scope.
If the trigger fires then the scope captures the number of samples remaining after the capture (if your capture is at the start then the full 22M samples) and only then the scope signals over USB to the software that there was something happening.

However it still does not add up because timebase 3 is 62.5Msamples/sec. so your 22Msamples should be filled in 0.350 sec. Also reading 22 Msamples over USB should take less than 2 sec.

So still not what I am expecting from your 6.5 seconds.
In theory you should about 0.4 sec after the trigger fires know that the scope has the data ready for you.

Benno

Larry_Brent
Newbie
Posts: 0
Joined: Sat Nov 18, 2023 8:34 am

Re: Getting back an event when trigger happens?

Post by Larry_Brent »

Hey Benno,

yes I see. So at this stage I have to check if I am really waiting for the scope to finish capture or if I did some mistake while reading out the scope buffer from python.

Unfortunately I am on a trip through half of the country and I don't have access to my test environment.

So instead of wasting your time I will look into this in detail on Friday when I am back home again and report back what the exact parameters are and how much time it took.

So far thank you for your support!

Andy

Larry_Brent
Newbie
Posts: 0
Joined: Sat Nov 18, 2023 8:34 am

Re: Getting back an event when trigger happens?

Post by Larry_Brent »

Hey Benno,

I apologize, you were exactly right. The time consuming part was indeed my analysis routine looping through the samples.

I was able to hand this over to numpy now which improved things dramatically. :)

Thanks again!

Andy

bennog
Advanced User
Advanced User
Posts: 208
Joined: Mon Nov 26, 2012 9:16 am
Location: Netherlands

Re: Getting back an event when trigger happens?

Post by bennog »

Yes that is the reason my preferred language is C/C++.
If you know what you are doing you can do even protocol decoding Realtime while streaming.
Only downside is you can not save your data as .psdata file so you can look at it in picoscope software.

Benno

Post Reply