Python, 5242D, and ps5000aGetValuesAsync()

Post general discussions on using our drivers to write your own software here
Post Reply
cjkraz
Newbie
Posts: 0
Joined: Mon Oct 29, 2018 2:55 pm

Python, 5242D, and ps5000aGetValuesAsync()

Post by cjkraz »

Hi Folks,

Back with another head scratcher (at least for me).

I have spent a fair amount of time with the PicoSDK at this point and have an OK understanding of using it.

My problem at the moment is, in Python, trying to use the "ps.ps5000aGetValuesAsync()" Function.

Code: Select all

PICO_STATUS ps5000aGetValuesAsync
(
int16_t handle,
uint32_t startIndex,
uint32_t noOfSamples,
uint32_t downSampleRatio,
PS5000A_RATIO_MODE downSampleRatioMode,
uint32_t segmentIndex,
void * lpDataReady,
void * pParameter
)
My issue is particularly with the 7'th parameter * lpDataReady.

I currently call the function with this statement (It doesn't work):

Code: Select all

self.status["getCaptureData"] = ps.ps5000aGetValuesAsync(self.fg['handle'], 0, self.picoMaxSamples, 0, 0, 0,
self.finished_data_collection, None)
assert_pico_ok(self.status["setDataBuffer"])
After doing some reading, I am left without a simple solution to using this function. Short of writing some C & Python code to properly wrap and pass the parameter as the function wants (by pointer), I'm not sure how else I could use this in Python.

Is there something I'm missing so that I can use this function?

- Chris

Hitesh

Re: Python, 5242D, and ps5000aGetValuesAsync()

Post by Hitesh »

Hi Chris,

Can I ask as to the context of the requirement for this function please?

Which mode of data collection are you using?

Regards,

cjkraz
Newbie
Posts: 0
Joined: Mon Oct 29, 2018 2:55 pm

Re: Python, 5242D, and ps5000aGetValuesAsync()

Post by cjkraz »

Hi Hitesh,

I'll do my best to give some context,

We're using both the AWG & 2 Channels on the 5242D. The AWG output is connected to Channel B to trigger Channel A to capture a reflection signal, that's the current hardware setup.

Software wise, the AWG is configured for burst mode. Generating a user defined number of shots on the output. That burst is then repeated based on a user defined repeat period (ms). The Burst is triggered using the software trigger in the API. The scope is configured for 14 bits to run in Block mode. Most of the other parameters are not static.

The control of triggering a burst and collecting the samples is all done in a thread that executes the process sequentially. But in an effort to try and reduce the minimum repeat period, we wanted to use a callback function that polls the sample data from the scope asynchronously instead of sequentially.

Hitesh

Re: Python, 5242D, and ps5000aGetValuesAsync()

Post by Hitesh »

Hi Chris,

How have you defined the ps5000aDataReady() callback function?

You could try setting the lpDataReady() parameter to None and poll ps5000aIsReady() until the driver indicates that data is available.

Otherwise, there is the ps5000aGetValuesOverlapped() function which could be used.

Regards,

Post Reply