Hello!
I want to develop the LabVIEW program using Picosope 5203, and realize the multiple-record function using the memory segment which the digitizer of NI or GaGe has.
Would you tell me whether the following codes are right which realizes multiple-record?
Although ps5000GetValues was used in following codes, should ps5000GetValuesAsync and ps5000DataReady be used?
Thanks in advance
Akihiro
/************************************************************
* My sample code of multiple-record part using the memory segments
***********************************************************/
/************************************************************
* Memory Segments
************************************************************/
/* divide scope memory into segments */
ps5000MemorySegments(handle, SegmentCounts, &nMaxSamples);
/************************************************************
* Multiple Recording by Memory Segments
************************************************************/
/* Aquiring data to PS5000 memory segments */
for (currentSegments = 0; currentSegments < SegmentCounts;
currentSegments++)
{
/* start block mode */
ps5000RunBlock(handle, PreTrigger, PostTrigger,
timebase, oversample,
&timeIndisposedMs, currentSegments,
CallBackBlock, NULL);
/* Check Timeout */
while (!g_ready && !g_timeout[currentSegments])
{
g_timeout[currentSegments] = check_timeout(timeout_ms, time0);
Sleep(0);
}
}
/* Transfer data from PS5000 memory segments to PC memory */
for (currentSegments = 0; currentSegments < SegmentCounts;
currentSegments++)
{
/* register data buffer with driver */
ps5000SetDataBuffer(handle, channel, buffer_array[currentSegments],
sampleCount);
/* retrieve block-mode data with callback */
ps5000GetValues(handle, 0, &sampleCount,
downSampleRatio, downSampleRatioMode,
currentSegments, &overflow);
}
/* stop data capture */
ps5000Stop(handle);
PS5000 multiple-record
- markspencer
- Site Admin
- Posts: 598
- Joined: Wed May 07, 2003 9:45 am
Hi,
Thank you for your post.
The code that you posted looks fine however I would advise that the return values are checked.
An alternative method that you might wish to consider is the use of rapid captures.
This would allow you to set the number of waveforms that you want to capture, then call ps5000RunBlock once. Then when the callback function indicates that all waveforms have bee taken, you have a choice how the reading he using the orginal ps5000GetValues which gets one segment at a time and allows aggregation or uses the ps5000GetValuesBulk, that allows more than one segment to be assess at a time.
There is a description on how to use the rapid capture in the PS5000 manual.
Thank you for your post.
The code that you posted looks fine however I would advise that the return values are checked.
An alternative method that you might wish to consider is the use of rapid captures.
Code: Select all
ps5000SetNoOfCaptures (handle, SegmentCounts);
Code: Select all
for (currentSegments = 0; currentSegments < SegmentCounts;
currentSegments++)
{
/* register data buffer with driver */
ps5000SetDataBufferBulk(handle, channel, buffer_array[currentSegments],
sampleCount, currentSegments);
}
ps5000GetValuesBulk
(
handle,
&sampleCount,
0,
segmentCount - 1,
overflow
)
// overflow is an array of segmentCount elements
Regards,
Mark Spencer
Mark Spencer