Picoscope Buffer

Post general discussions on using our drivers to write your own software here
Post Reply
Rumchiller
Newbie
Posts: 0
Joined: Sat Feb 21, 2015 12:18 pm

Picoscope Buffer

Post by Rumchiller »

Hello!

Could you provide me some information to the ps3000aSetDataBuffer function? In general I know that I have to set a certain place for the provided data. But how exactly does it work?

"* buffer" - I think the location in the scopes memory? More info on how to declare please.
"bufferLth" - How long it should be?
"segmentIndex" - When I set more segments with "ps3000aMemorySegments", how it works exactly?

Maybe you have a good link for me with general infos about how buffers works and how to set them (with the Picoscope).

Its my first attempt to communicate with an external device with Matlab, so bear with me :|

Thanks for your help!

Reggie


PS: Matlab2014 32bit, Win7 64bit, Picoscope 3203D, Picotech Instrument-Driver.

Hitesh

Re: Picoscope Buffer

Post by Hitesh »

Hi Reggie,

The buffer parameter is a pointer to the array in which data is to be stored. For this particular call you have to use a libpointer object in order to pass the array to the driver - there is code in the example scripts that shows how to do this e.g.

Code: Select all

data.BUFFER_SIZE = 1024;
channelA = enuminfo.enPS3000AChannel.PS3000A_CHANNEL_A;
pBufferChA = libpointer('int16Ptr',zeros(1024,1));

status = invoke(ps3000a_obj, 'ps3000aSetDataBuffer', channelA, pBufferChA, data.BUFFER_SIZE, 0, 0);
The bufferLth parameter is the length of the array (the sum of the pre- and post-trigger samples if collecting raw data).

The segmentIndex parameter would normally be set to 0, if the memory of the device has not been segmented.

If the device memory has been segmented into n segments, then 0 corresponds to the first segment, 1 would be second and so on until n - 1 corresponds to the last. The memory in each segment is shared between the enabled channels.

I hope this helps.

Post Reply