Test and Measurement Forum

PicoScope 4824 - which mode should I use

Post your .Net discussions here

PicoScope 4824 - which mode should I use

Postby sl0910 » Fri Sep 05, 2014 7:39 am

Hello,

I'm trying to write programm to use PicoScope.
We want to measure signal during 1 minute with 5MHz frequency without loosing data. The result should be a big file with all samples.
My question is which sampling mode should I use?

Thanks
sl0910
Newbie
 
Posts: 0
Joined: Fri Sep 05, 2014 7:25 am

Re: PicoScope 4824 - which mode should I use

Postby Karunen » Fri Sep 05, 2014 10:52 am

Hi,

You may have to have a look at http://www.picotech.com/education/oscilloscopes/data-acquisition-modes.html.

Also before we can recommend a mode can you please tell us how many channels you will have enabled?

Also you mentioned 5MHz frequency is that the frequency you want to sample at or the frequency of the signal?

Kind Regards,
Karunen

Technical Specialist
Pico Technology
Karunen
Zen Master
Zen Master
 
Posts: 194
Joined: Thu Nov 21, 2013 9:22 am

Re: PicoScope 4824 - which mode should I use

Postby sl0910 » Mon Sep 08, 2014 2:28 pm

Hi!

I will have at least 3 channels enabled, the target is 6 channels.
5MHz is sampling frequency.

In instruction is wrote:
The driver supports data streaming,
a mode that captures gap-free
continuous data over USB 3.0 direct
to the PC’s RAM or hard disk at a rate
of 10 MS/s when using PicoScope 6 software (160 MS/s across
all channels when using supplied SDK), so you are not limited by
the size of the scope’s buffer memory.

In block mode and rapid block mode data are loosing - gap have min. 2,5 microseconds, and this is too much lost data for us. In streaming mode is information "Slower sampling rate required".
So how to get data with 5MHz sampling frequency and 1 minute measure time without loosing data?

Thanks
sl0910
Newbie
 
Posts: 0
Joined: Fri Sep 05, 2014 7:25 am

Re: PicoScope 4824 - which mode should I use

Postby Karunen » Wed Sep 10, 2014 9:03 am

Hi,

This looks like you need to be using streaming mode.

As streaming mode can be limited by the USB transfer rate,
the maximum transfer rate that was measured by my PC was around 30 MS/s for USB 2 and around 80 MS/s for USB 3.

So you should not have any issues using streaming mode, with 5 MHz Sampling frequency with 3 channels.

Kind Regards,
Karunen

Technical Specialist
Pico Technology
Karunen
Zen Master
Zen Master
 
Posts: 194
Joined: Thu Nov 21, 2013 9:22 am

Re: PicoScope 4824 - which mode should I use

Postby sl0910 » Wed Sep 10, 2014 1:44 pm

Thanks for your reply.

I’ve written the simple program (attached) using streaming mode, but in result I have gaps between samples.

Could you take a look into my code and tell me what I'm doing wrong?
Attachments
PicoScopeReader - Kopia do psucia.zip
for debugging program is working in loop while(true), so for stop please use Shift + F5
(110.85 KiB) Downloaded 78 times
sl0910
Newbie
 
Posts: 0
Joined: Fri Sep 05, 2014 7:25 am

Re: PicoScope 4824 - which mode should I use

Postby Karunen » Tue Sep 16, 2014 2:15 pm

Hi,

You CallBack needs to use

Code: Select all
private void StreamCallback(short handle, int noOfSamples, uint startIndex, short overflow, uint triggerAt, short triggered, short autoStop, IntPtr pVoid)
        {
            // used for streaming
            _sampleCount = noOfSamples;
            _startIndex = startIndex;

            // flag to say done reading data
            _ready = true;
        }




This is because the number of samples returned each time the Callback is used will change but also the position where the the first value is placed in the array will also change to that is why we use _startIndex to specify where to removing the data from.

Also would you mind explaining why the for loops takes large steps at a time when writing to file?

Kind Regards,
Karunen

Technical Specialist
Pico Technology
Karunen
Zen Master
Zen Master
 
Posts: 194
Joined: Thu Nov 21, 2013 9:22 am

Re: PicoScope 4824 - which mode should I use

Postby sl0910 » Mon Sep 22, 2014 12:59 pm

Hi,

Sorry for the long time response, but I was on forced leave.

I'm trying to implement your tips, but I don't know where should I use this global value _startIndex. In for loop when I read data?

Also would you mind explaining why the for loops takes large steps at a time when writing to file?

You are asking about step with 1000000? It's needed to check size of file: firstly I open stream, then write block of data into this stream, then close stream, in the next step of loop I check file size and if it's too big I create next file. So if I should have 1 GB of data, I get 5 files with 200MB, because it's easier to read and transform data.

Could you tell me if an example of a continuous streaming in C# is available?

Regards
sl0910
Newbie
 
Posts: 0
Joined: Fri Sep 05, 2014 7:25 am

Re: PicoScope 4824 - which mode should I use

Postby Karunen » Tue Sep 30, 2014 8:10 am

Hi,

Would you be able to email support@picotech.com?
Where I can help you further.

Kind Regards,
Karunen

Technical Specialist
Pico Technology
Karunen
Zen Master
Zen Master
 
Posts: 194
Joined: Thu Nov 21, 2013 9:22 am


Return to .Net Languages (C#, VB.Net, .)

Who is online

Users browsing this forum: No registered users and 0 guests