DataLogger 1216 Achieve 1MS/s in Matlab possible?

Post any questions you may have about our current range of USB data loggers
Post Reply
Spiros
Newbie
Posts: 0
Joined: Wed Apr 06, 2016 1:26 pm

DataLogger 1216 Achieve 1MS/s in Matlab possible?

Post by Spiros »

Hello.
I have a signal with 60kHz frequency. My goal is to record at least 120K Samples in less than half a second.

I have the PicoLog DataLogger 1216 which can have sampling rate in block mod at 1MS/s using PicoScope and API.

So, in theory, using Single mod I shall be able to get 120K samples in 0.12 seconds (because 1us/sample), however I can only get 120K smaples in 1.2 seconds (10us/sample)

Code: Select all

%% Load Libraries 
loadlibrary('pl1000.dll','pl1000Api.h','mfilename', 'mHeader')
unloadlibrary('pl1000')
loadlibrary('pl1000.dll',@mHeader)

%% Open the unit - returns a handle to the device
unithandle = 0;
[status_open, unithandle] = calllib('pl1000', 'pl1000OpenUnit', unithandle);

%% Set Up acquisition
blockLength=500;
nrSamples = 1e6; 

%% Initialize Some Variables
channelIDs = [4]; 
nrOfValues = 120000; %%%% Number of Smaples to get
values = zeros(1,nrOfValues);
overflow = 0;
triggerIndex = 0;
ready = false;

%% Get Data
[status_SetInterval] = calllib('pl1000', 'pl1000SetInterval', unithandle, blockLength,nrSamples, channelIDs, length(channelIDs));
[status_Run] = calllib('pl1000', 'pl1000Run', unithandle, nrOfValues,'BM_SINGLE');  
while ~ready 
   [status_Ready, ready] = calllib('pl1000', 'pl1000Ready', unithandle, ready);
end
[status_GetValues, values, nrOfValues, overflow, triggerIndex] = calllib('pl1000', 'pl1000GetValues',unithandle, values, nrOfValues, overflow, triggerIndex);

%% Close the unit
status_close = calllib('pl1000', 'pl1000CloseUnit', unithandle);
unloadlibrary('pl1000');
Do you have any idea why despite the fact that I have set the acquisition mode to 'BM_SINGLE' i still get 10us/S and not 1us/S????

Thank you in advance!

Hitesh

Re: DataLogger 1216 Achieve 1MS/s in Matlab possible?

Post by Hitesh »

Hi Spiros,

According to the Programmer's Guide for the PicoLog 1000 Series devices:
The fastest possible sampling interval is 1 microsecond, when the number of samples
is 8192 divided by the number of channels active and the capture mode is
BM_SINGLE. Under all other conditions, the fastest possible sampling interval is 10
microseconds per channel.
Please try a total of 8192 samples shared between the channels to see if you can achieve a 1 us interval first, then try increasing the number of samples above that value to see what happens.

Regards,

Spiros
Newbie
Posts: 0
Joined: Wed Apr 06, 2016 1:26 pm

Re: DataLogger 1216 Achieve 1MS/s in Matlab possible?

Post by Spiros »

Hitesh wrote:Hi Spiros,

According to the Programmer's Guide for the PicoLog 1000 Series devices:
The fastest possible sampling interval is 1 microsecond, when the number of samples
is 8192 divided by the number of channels active and the capture mode is
BM_SINGLE. Under all other conditions, the fastest possible sampling interval is 10
microseconds per channel.
Please try a total of 8192 samples shared between the channels to see if you can achieve a 1 us interval first, then try increasing the number of samples above that value to see what happens.

Regards,

Hello Hitesh!
Thank you for your reply!

I tried what you propose and I still get 10 us per sample.
So could it be that because of Matlab I cannot achive that speed?
Because in PicoScope I can get 1 us per sample, but similarly to Matlab with PicoLog I can get up to 10 us per sample.

Kind regards,
Spiros

Hitesh

Re: DataLogger 1216 Achieve 1MS/s in Matlab possible?

Post by Hitesh »

Hi Spiros,

It is most likely due to the settings.

Are you using a 32-bit or 64-bit version of MATLAB and what is the version number of the pl1000.dll that you are using?

Regards,

Spiros
Newbie
Posts: 0
Joined: Wed Apr 06, 2016 1:26 pm

Re: DataLogger 1216 Achieve 1MS/s in Matlab possible?

Post by Spiros »

I am using MATLAB Version: 8.4.0.150421 (R2014b).
The version number of the pl1000.dll is: 1.0.7.7.

I have upload an attachment with the code that I have uploaded above and all the dll files I am using, just to check if I am using the correct files.

Thank you for your assistance Hitesh!
Attachments
Pico_Test_x64_1.zip
(192.51 KiB) Downloaded 362 times

Hitesh

Re: DataLogger 1216 Achieve 1MS/s in Matlab possible?

Post by Hitesh »

Hi Spiros,

I have run some tests here using our SDK C console example and I have found that the maximum number of samples is 8128.

I will need to find out if this is intended, and if so, the Programmer's Guide will need an update.

How many channels do you need to capture data from?

Regards,

Spiros
Newbie
Posts: 0
Joined: Wed Apr 06, 2016 1:26 pm

Re: DataLogger 1216 Achieve 1MS/s in Matlab possible?

Post by Spiros »

I would like to get data from 2 channels (Channel 1 and 4).

However if this is not possible I shall get only from 1 channel if needed.

Thank you.

Kind regards,
Spiros

Hitesh

Re: DataLogger 1216 Achieve 1MS/s in Matlab possible?

Post by Hitesh »

Hi Spiros,

Apologies for the delay but I've received confirmation that the limit is 8128 samples.

If you need to collect 120,000 samples at 1 MS/s with 1 or 2 channels you may wish to consider using an oscilloscope such as the PicoScope 2204A, 2205A, or the 2206A.

Regards,

Post Reply