PS5000 multiple-record

 
Post new topic   Reply to topic    Pico Technology Forum Index -> General Software Discussions
Author Message
akisugita
User
User


Joined: 12 Oct 2007
Posts: 3

PostPosted: Mon Oct 15, 2007 4:53 am    Post subject: PS5000 multiple-record Reply with quote

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);
Back to top
markspencer
Site Admin
Site Admin


Joined: 07 May 2003
Posts: 610

PostPosted: Mon Jun 02, 2008 8:43 am    Post subject: Reply with quote

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.

Code:
ps5000SetNoOfCaptures (handle, SegmentCounts);


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.

Code:
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


There is a description on how to use the rapid capture in the PS5000 manual.
Back to top
Display posts from previous:   
Post new topic   Reply to topic    Pico Technology Forum Index -> General Software Discussions
All times are GMT
Page 1 of 1

 


Pico Technology topic RSS feed 
Powered by phpBB © 2001, 2005 phpBB Group