Main Content

Acquire Signals from an Oscilloscope Using the PicoScope MATLAB Instrument Driver

This example shows how to use a generic MATLAB Device Driver (MDD) with the icdevice function to acquire and visualize analog voltage signals from a PicoScope device.

Requirements

Set Up Software

Find your PicoScope model and download the zip folder from https://github.com/picotech/picosdk-c-wrappers.git.

PicoScope binaries by model

Find your platform and download the zip folder from https://github.com/picotech/picosdk-c-wrappers-binaries.

PicoScope wrapper binary options by platform

Download and install the PicoScope 2000 Series or PicoScope 2204A series software from Pico Technology Downloads. Choose according to your instrument and system architecture. This figure shows the selection for the recommended PicoScope 2204A software on Windows®.

PicoScope software options

This is a list of files expected after all the installation is completed.

Installed PicoScope files

Add all the installed PicoScope related files to the MATLAB® path.

Connect Device and Load Configuration

Connect your PicoScope device to your computer.

Run the PS2000Config script in MATLAB to set up the hardware.

PS2000Config; % Loads trigger and channel settings

Connect App to the PicoScope

Open the Instrument Explorer app from the Apps tab on the MATLAB toolstrip. Alternatively, you can open the app by executing instrumentExplorer at the MATLAB command prompt.

Click Configure New Instrument to manually configure the PicoScope. The PicoScope driver should now be available on the MATLAB path and in the app driver list. Click Driver and select your driver from the drop-down.

Driver options

Verify a connection to the device by clicking Confirm Parameters.

Configure Device Settings

Navigate to Functions > Parent > ps2000SetChannel. Then enter the following values

  • channel: 0

  • enabled: 1

  • dc: 1

  • range: 6

Click Execute.

View of ps2000SetChannel values

Similarly, enable the second channel with values

  • channel: 1

  • enabled: 1

  • dc: 1

  • range: 7

Set Acquisition Parameters

Set the following parameter by entering the specified values and clicking Execute.

Navigate to the node Functions > Blocks > setBlockIntervalUs, and set the following parameter values:

  • timeIntervalUs: 100

Navigate to Properties > parent > numberOfSamples, and set the following parameter values:

  • Value: 2048

Navigate to Select Properties > trigger > delay, and set the following parameter values:

  • Value: 50

Navigate to Select Properties > trigger > autoTriggerMs, and set the following parameter values:

  • Value: 1000

Navigate to Functions > trigger > setSimpleTrigger, and set the following parameter values:

  • source: 0

  • thresholdMv: 500

  • direction: 2

Acquire Block Data

Navigate to the node Functions > block > getBlockData and click Execute.

Navigate to the node Functions > parent > ps2000Stop and click Execute.

View Activity Log

The Activity Log shows all the property and function actions.

Instrument Explorer Activity Log

Plot the Acquired Signal

To plot an analog signal, select a value in the Activity Log and click Plot Data in the toolstrip.

Plot of acquired data

See Also

Apps