Test and Measurement Forum

PS 5204/ps5000con.c buffer values

Post your C and C++ discussions here

PS 5204/ps5000con.c buffer values

Postby Jay H » Wed Mar 31, 2010 2:35 pm

Hello, new to PicoScope (and to this forum) and playing with a 5204 and the SDK that comes with it, including the C code PS5000con.c.

Not finding much documentation on the values as set by the program in BlockDataHandler via a call to ps5000GetValues into the array "buffers"?

I have a basic signal generator hooked up to the 5204 outputting a simple sine wave at 3khz/100mV and have the the Scope set to an Input Range of 200mV on Channel A/ timebase of 240ns. Channel B is OFF. Scaling to mV is ON/TRUE. Aggregation is set to OFF. Oversampling is set to 1.

I can gather that the output file in data.txt and the function BlockDataHandler that the data output in the file "data.txt" is

timeInterval, raw ADC, converted (mv), raw ADC, converted (mv) (newline)

here are the first 3 lines of data.txt when running a simply Block Data Immediate:

Code: Select all
0,     5120, 31 , -12851 ,  -790
240 ,  5376, 33 , -12851 , -79240
480,.....       , -12851 ,  -79480
720,.....       , -12851 ,  -79720



I can deduce the first column is the sample time based on the timebase/interval, the 2nd column is the raw data, the 3rd column is the converted to mV data.

What is in the buffers[2][sample] and buffers [3][sample]???

it looks like what is in buffers[3] is related to the time interval and perhaps buffers[2] is some kind of default value but I don't see any documentation on how to read this and wondering what that is. I read in other threads about the values being used with aggregation turned on, however, the sample program seems to default to off or RATIO_MODE_NONE is set to the GetValues function.

Can one tell me where to find this data setup and/or what the last pair of data represents???

Jay
Jay H
Newbie
 
Posts: 0
Joined: Wed Mar 31, 2010 2:13 pm

Re: PS 5204/ps5000con.c buffer values

Postby Jay H » Wed Mar 31, 2010 4:39 pm

Jay H wrote:
Code: Select all
0,     5120, 31 , -12851 ,  -790
240 ,  5376, 33 , -12851 , -79240
480,.....       , -12851 ,  -79480
720,.....       , -12851 ,  -79720



Ha, I played with the output to space it better and realized that the last 2 "columns" show up as 1, then looked at the code some more and realize that the sample interval is written at the beginning of the line and also at the end.

But that still leaves me what is the 2nd pair of values? i.e.

raw...., mV
-12851, -79

Jay
Jay H
Newbie
 
Posts: 0
Joined: Wed Mar 31, 2010 2:13 pm

Re: PS 5204/ps5000con.c buffer values

Postby Robin » Thu Apr 01, 2010 12:14 pm

Hi

The second pair of values are the second buffer for the channel.

Two data buffers are required when using aggregation (for min and max values). The function BlockDataHandler in the example doesn't use aggregation and so you can ignore the second buffer.

Aggregation can be set when you call ps5000GetValues

Hope this helps

Robin
Robin
Zen Master
Zen Master
 
Posts: 558
Joined: Fri Sep 19, 2008 10:17 am

Re: PS 5204/ps5000con.c buffer values

Postby Jay H » Thu Apr 01, 2010 3:35 pm

Thanks!

Jay
Jay H
Newbie
 
Posts: 0
Joined: Wed Mar 31, 2010 2:13 pm


Return to C and C++

Who is online

Users browsing this forum: No registered users and 0 guests