Saving quickly captured data

Post any questions you may have about our current range of oscilloscopes
Post Reply
DangerNoodle
Newbie
Posts: 0
Joined: Thu Aug 11, 2022 1:53 pm

Saving quickly captured data

Post by DangerNoodle »

Hello. I use the picoscope 3205D MSO. My hardware creates 20triggers per second and I would like to capture every trace of each trigger and save it. I tried the option at alarms to save at trigger, but it's really slow, so I had to add a 1s delay into my trigger. The problem is, I have to record about 10k traces multiple times, so I would like to accelerate the trace saving. How can I achieve that?

Another problem would be, is there a way to read out the captured traces with python in order to save each trace as a numpy array?

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

Re: Saving quickly captured data

Post by bennog »

It depends on the number of samples you need per trigger.
If all samples fit in the scope memory then you can use rapid trigger mode.
you then have all 10k captures in a single .psdata file and you can export it to a matlab file.

then you can in numpy read the .mat file.
https://stackoverflow.com/questions/874 ... -in-python

Benno

DangerNoodle
Newbie
Posts: 0
Joined: Thu Aug 11, 2022 1:53 pm

Re: Saving quickly captured data

Post by DangerNoodle »

hey, thanks for the answer.

What do you mean by rapid trigger mode? Is it some kind of "sequence" mode used in standard scopes, where I record only one trace with all my samples, then I have to split them into my 10k different captures? How do I activate that mode?

What scope memory are you refering to? How do I define if my scope is capable of recording that many traces? One trace required around 280kB

How do I convert the already recorded .psdata into a matlab file? I recorded 10k different files and would like to create one numpy array out of them

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

Re: Saving quickly captured data

Post by bennog »

See for rapid trigger mode and explanation.
viewtopic.php?t=17801

Then you can export to matlab and have a array of array's in matlab.

The 3205D MSO has 256 MSamples memory for all channels toghether.

So if you use 1 channel you can get 1000 captures of 250k Samples
If you use 2 cannels you can get 500 captures of 250k Samples.

Benno

DangerNoodle
Newbie
Posts: 0
Joined: Thu Aug 11, 2022 1:53 pm

Re: Saving quickly captured data

Post by DangerNoodle »

Hello, thanks for the answers. I use two channels, although one channel is for the trigger only, which is unfortunately also saved together with the first data channel. Is there a way not to record this trigger into my saved files? I dont actually need to see it either

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

Re: Saving quickly captured data

Post by bennog »

As far as I know not, maybe in the V7 version of the software.

Benno

DangerNoodle
Newbie
Posts: 0
Joined: Thu Aug 11, 2022 1:53 pm

Re: Saving quickly captured data

Post by DangerNoodle »

Hello. I have occured another problem. I used a command to convert all the .psdata into .mat files:
Picoscope /c *.psdata /f mat /b all

The problem is, the traces arent converted in an order, for example 20220811-0001 (1).mat is number 1, while 20220811-0001 (10) is number 2 and 20220811-0001 (100) is number 3. I am not sure if the script I used is reading the data wrongly or if the captured traces are wrongly named. Or maybe the other .mat to python script converts the data wrongly?


mat_files = glob.glob('**/*.mat')
alldata = []
for fname in mat_files:
.
data = scipy.io.loadmat(fname)

# Append data to the list, only array A is interesting as it contains data from channel A
alldata.append(data["A"])


Could you tell me how to fix that?

Post Reply