Problem with the number of samples retrieved

Post your C and C++ discussions here
Post Reply
jbl
User
User
Posts: 8
Joined: Fri Dec 16, 2016 2:35 pm

Problem with the number of samples retrieved

Post by jbl »

Hi,

I am still writing a C-code to communicate with my 5244B Picoscope.
After some troubles with the ps5000aOpenUnit everything seems to be ok.
Thanks to Hitesh for his help on this first problem.

The C-code is written with the graphical library gtk+. The program is very simple.
It displays a window in which the signal on channel A is given. Some buttons and combo boxes allow timebase, sensitivity and trigger tunings.

The whole code is given in attachement.

My question is about the number of samples in the CallBack function "Oscilloscope".
I don't understand why the the number of samples that is required with the function ps5000aGetValues (4096) is not the actual number retrieved (1024). This actual number is always 1024 whatever the timebase parameter in ps5000aRunBlock function.

I think I haven't understood something, but what ?

Thank you for your help.

Regards
Attachments
PicoV1.c
(8.57 KiB) Downloaded 557 times

jbl
User
User
Posts: 8
Joined: Fri Dec 16, 2016 2:35 pm

Re: Problem with the number of samples retrieved

Post by jbl »

Hi,
Sorry for this silly question (in very poor english).
I haven't seen that parameters 2 and 3 of ps5000aRunBlock function give the number
of required samples.
Here is a better code.
Regards
Attachments
PicoV1.c
(8.53 KiB) Downloaded 541 times

Martyn
Site Admin
Site Admin
Posts: 4491
Joined: Fri Jun 10, 2011 8:15 am
Location: St. Neots

Re: Problem with the number of samples retrieved

Post by Martyn »

Looking at the code the first example had 512 pre trigger and 512 post trigger samples. The second example looks correct, so I am guessing that the code is doing what you expect :)
Martyn
Technical Support Manager

jbl
User
User
Posts: 8
Joined: Fri Dec 16, 2016 2:35 pm

Re: Problem with the number of samples retrieved

Post by jbl »

Yes, it's working fine now.
4096 samples retrieved with no lost.
Here is the last version with a spin button for threshold tuning.
PicoV1.jpeg
The gtk widget "curve" is used to display the signal.
This widget is deprecated by gtk developers.
Does somebody know or use a gtk graphical tool that could replace it ?
Attachments
PicoV1.c
(8.65 KiB) Downloaded 515 times

Post Reply