Test and Measurement Forum

Readng multiple channels from API

Post any questions you may have about our current range of oscilloscopes

Readng multiple channels from API

Postby amiurunkj » Fri Feb 10, 2017 2:11 am

Hi Everybody,

I have a Picoscope 5242A device connected to my PC, and I would like to read the data from two channels in block mode (and later maybe streaming mode) using python.

My question is: how to do that? With one channel it is no problem, but when I have two I cannot tell the ps5000aGetValues command which channel to read, it does not have an argument for that. Even though I have activated both channels, when I read the data, I get a series of data points which seem to come from Ch1.

Any help would be greatly appreciated!
amiurunkj
Newbie
 
Posts: 0
Joined: Fri Feb 10, 2017 1:58 am

Re: Readng multiple channels from API

Postby Martyn » Fri Feb 10, 2017 7:06 am

You need to specify buffers using ps5000aSetDataBuffer or ps5000aGetValuesSetDataBuffers for all of the enabled channels. The driver will then populate these buffers with the correct data when requested by ps5000aGetValues.
Martyn
Technical Support Manager
Martyn
Site Admin
Site Admin
 
Posts: 2686
Joined: Fri Jun 10, 2011 8:15 am
Location: St. Neots

Re: Readng multiple channels from API

Postby amiurunkj » Fri Feb 10, 2017 10:54 am

Thank you so much!

I have segmented the memory into two and assigned a buffer to each segment, and I am trying to invoke ps5000aGetValues for each of them, but I receive PICO_NO_SAMPLES_AVAILABLE error. This should mean that the run has not been completed which I don't understand, I wait sufficiently long before moving to the next command.
amiurunkj
Newbie
 
Posts: 0
Joined: Fri Feb 10, 2017 1:58 am

Re: Readng multiple channels from API

Postby Martyn » Fri Feb 10, 2017 11:57 am

Can you post your code, we can then see where it is going wrong.
Martyn
Technical Support Manager
Martyn
Site Admin
Site Admin
 
Posts: 2686
Joined: Fri Jun 10, 2011 8:15 am
Location: St. Neots


Return to USB PC Oscilloscopes

Who is online

Users browsing this forum: No registered users and 0 guests