Test and Measurement Forum

Use PicoScope 4225 as DAq

Post your MATLAB discussions here

Use PicoScope 4225 as DAq

Postby MoJou » Fri Jan 29, 2016 11:50 am

Hello,

is it possible to use the PicoScope 4225 as DAq in combination with Matlab? I try to modify the PS400A_ID_Streaming_Example.m where i am limited to 2M Samples. My attemp is to Stream the data and copy it to my HDD using sprintf. The Problem is that I would have to clear the Buffer while measuring. Is this possible? (Actually the measurement stops 'AutoStop: TRUE - exiting loop.' due to collecting 2M Samples.)


Greedings
MoJou
Newbie
 
Posts: 0
Joined: Fri Jan 29, 2016 10:25 am

Re: Use PicoScope 4225 as DAq

Postby Hitesh » Mon Feb 01, 2016 10:53 am

Ho MoJou,

It is possible to use the PicoScope 4225 as a data acquisition device through MATLAB.

The example is designed to show how to setup the device and collect data in streaming mode without the use of a trigger, then stop when the required number of samples has been collected.

You will need to adapt the code for your purposes e.g. set the Instrument Driver Streaming object's autoStop property to false (0) to continuously collect data but ensure that you copy the data from the application buffers to where it needs to be stored/processed.

Regards,
Hitesh

Technical Specialist
Pico Technology
Hitesh
Site Admin
Site Admin
 
Posts: 2063
Joined: Tue May 31, 2011 3:43 pm
Location: St. Neots, Cambridgeshire

Re: Use PicoScope 4225 as DAq

Postby MoJou » Tue Feb 02, 2016 5:14 pm

Hello Hitesh,

i tried to set

Code: Select all
...
ps4000aDeviceObj = icdevice('picotech_ps4000a_generic', '');
ps4000aDeviceObj.Streaming.autoStop=0;
...



after that I checked the value and load the driver.


Code: Select all
...
connect(ps4000aDeviceObj);
...


The terminal shows up

Code: Select all
...
Default Streaming mode parameters:-

Streaming interval: 1.00e-06 s
Streaming auto stop: 1
...


after collecting 20 M samples the program stops.

Do i have to use any special set command?

Regards
MoJou
Newbie
 
Posts: 0
Joined: Fri Jan 29, 2016 10:25 am

Re: Use PicoScope 4225 as DAq

Postby MoJou » Wed Feb 03, 2016 8:53 am

Finally i set
Code: Select all
...
set(streamingGroupObj, 'streamingInterval', 100e-9);
set(streamingGroupObj, 'autoStop', 0);
...

now it works!. But at the moment i am not 100 % sure if the measurements are completely continous or if there are lags between the taken measurements. Have you got any hint?


Regards
MoJou
Newbie
 
Posts: 0
Joined: Fri Jan 29, 2016 10:25 am

Re: Use PicoScope 4225 as DAq

Postby Hitesh » Wed Feb 03, 2016 3:11 pm

Hi MoJou,

Good to see that you found that the set() function must be used to change Instrument Driver device and group object properties prior to data collection.

The data should be continuous so long as you are polling the driver regularly using the 'GetStreamingLatestValues()' and 'IsReady()' functions.

One way to check this is to use a slow signal e.g. a sine or ramp wave at 1Hz and look for any discontinuities.

Hope this helps,
Hitesh

Technical Specialist
Pico Technology
Hitesh
Site Admin
Site Admin
 
Posts: 2063
Joined: Tue May 31, 2011 3:43 pm
Location: St. Neots, Cambridgeshire


Return to MATLAB

Who is online

Users browsing this forum: No registered users and 0 guests