Capture data without triggering

Post any questions related to the new PicoScope 7 software
Post Reply
phgphd
Newbie
Posts: 0
Joined: Wed Jun 16, 2021 12:33 am

Capture data without triggering

Post by phgphd »

Using Picoscope 7 API on 4424A on Ubuntu 22.04.
I want to capture data in block mode without causing a trigger. I thought the following code should work, but it does not. The ps4000aGetValues() returns error code 25hex, PICO_NO_SAMPLES_AVAILABLE. Why?

sts = ps4000aStop(mConfig.device); // stop any previous capture

sts = ps4000aRunBlock(mConfig.device, // begin new capture
mConfig.preTrigSampleCnt, // 2K
mConfig.postTrigSampleCnt, // 6K
mConfig.timeBase, // 39
&mConfig.timeIndisposedMs, // 0
mConfig.segmentIndex, // 1
mConfig.lpReady, // NULL
mConfig.cbParameter); // NULL

usleep(10000); // allow some time to get all new data capture
sts = ps4000aStop(mConfig.device);
sts = ps4000aGetValues(mConfig.device,
startIndex, // 0
&noOfSamples, // 4 * 8192
1, // down sample ratio N/A
PS4000A_RATIO_MODE_NONE, // ignore down sampling
mConfig.segmentIndex, // 0
&overflow); // N/A

phgphd
Newbie
Posts: 0
Joined: Wed Jun 16, 2021 12:33 am

Re: Capture data without triggering

Post by phgphd »

This problem was solved by providing more sleep time. I was capturing 32K of data. In the sample code provided I was waiting 10 milliseconds, which is not enough. That actually makes sense, since at 0.5 microseconds per sample, capturing 32K takes 16 milliseconds. I increased the sleep time to 18 milliseconds and have 100% reliability in the call to ps4000aRunBlock(). However, I also discovered that it is not necessary to call ps4000aStop() . ps4000aRunBlock() can be called at any time to retrieve data without needing stop the capture of data.

Post Reply